From f15320bf6b50a0c02636405561ac8323ae901abd Mon Sep 17 00:00:00 2001 From: Lev Walkin Date: Thu, 3 Jun 2004 03:38:44 +0000 Subject: [PATCH] Initial revision --- AUTHORS | 1 + BUGS | 31 + COPYING | 27 + ChangeLog | 130 + INSTALL | 14 + MANIFEST | 9 + Makefile.am | 8 + Makefile.in | 430 ++ NEWS | 0 README | 69 + TODO | 18 + aclocal.m4 | 998 ++++ asn1c/Makefile.am | 25 + asn1c/Makefile.in | 556 ++ asn1c/README | 1 + asn1c/asn1c.1 | 99 + asn1c/asn1c.c | 267 + asn1c/check-parsing.sh | 18 + asn1c/tests/Makefile.am | 10 + asn1c/tests/Makefile.in | 284 + asn1c/tests/README | 6 + asn1c/tests/check-22.c | 141 + asn1c/tests/check-24.c | 94 + asn1c/tests/check-25.c | 252 + asn1c/tests/check-30.c | 116 + asn1c/tests/check-31.c | 175 + asn1c/tests/check-32.c | 21 + asn1c/tests/check-33.c | 21 + asn1c/tests/check-35.c | 277 + asn1c/tests/check-41.c | 315 + asn1c/tests/check-43.c | 24 + asn1c/tests/check-assembly.sh | 56 + config.guess | 1314 +++++ config.h.in | 81 + config.sub | 1410 +++++ configure | 6937 +++++++++++++++++++++++ configure.in | 95 + depcomp | 411 ++ doc/Makefile.am | 3 + doc/Makefile.in | 221 + doc/asn1c-usage.pdf | Bin 0 -> 129406 bytes examples/Makefile.am | 4 + examples/Makefile.in | 246 + examples/README | 6 + examples/clyx2asn1.pl | 51 + examples/crfc2asn1.pl | 86 + install-sh | 251 + libasn1compiler/Makefile.am | 28 + libasn1compiler/Makefile.in | 424 ++ libasn1compiler/asn1c_C.c | 2021 +++++++ libasn1compiler/asn1c_C.h | 69 + libasn1compiler/asn1c_internal.h | 81 + libasn1compiler/asn1c_lang.c | 32 + libasn1compiler/asn1c_lang.h | 28 + libasn1compiler/asn1c_misc.c | 232 + libasn1compiler/asn1c_misc.h | 28 + libasn1compiler/asn1c_out.c | 75 + libasn1compiler/asn1c_out.h | 31 + libasn1compiler/asn1c_save.c | 225 + libasn1compiler/asn1c_save.h | 6 + libasn1compiler/asn1compiler.c | 160 + libasn1compiler/asn1compiler.h | 41 + libasn1compiler/check_compiler.c | 7 + libasn1fix/Makefile.am | 36 + libasn1fix/Makefile.in | 454 ++ libasn1fix/asn1fix.c | 354 ++ libasn1fix/asn1fix.h | 30 + libasn1fix/asn1fix_bitstring.c | 230 + libasn1fix/asn1fix_bitstring.h | 6 + libasn1fix/asn1fix_class.c | 237 + libasn1fix/asn1fix_class.h | 16 + libasn1fix/asn1fix_compat.c | 132 + libasn1fix/asn1fix_compat.h | 14 + libasn1fix/asn1fix_constr.c | 364 ++ libasn1fix/asn1fix_constr.h | 24 + libasn1fix/asn1fix_cstring.c | 73 + libasn1fix/asn1fix_cstring.h | 6 + libasn1fix/asn1fix_dereft.c | 68 + libasn1fix/asn1fix_dereft.h | 6 + libasn1fix/asn1fix_derefv.c | 56 + libasn1fix/asn1fix_derefv.h | 6 + libasn1fix/asn1fix_enum.c | 136 + libasn1fix/asn1fix_enum.h | 6 + libasn1fix/asn1fix_export.c | 48 + libasn1fix/asn1fix_export.h | 32 + libasn1fix/asn1fix_integer.c | 161 + libasn1fix/asn1fix_integer.h | 6 + libasn1fix/asn1fix_internal.h | 106 + libasn1fix/asn1fix_misc.c | 276 + libasn1fix/asn1fix_misc.h | 47 + libasn1fix/asn1fix_param.c | 165 + libasn1fix/asn1fix_param.h | 6 + libasn1fix/asn1fix_retrieve.c | 366 ++ libasn1fix/asn1fix_retrieve.h | 73 + libasn1fix/asn1fix_tags.c | 47 + libasn1fix/asn1fix_tags.h | 6 + libasn1fix/asn1fix_value.c | 159 + libasn1fix/asn1fix_value.h | 28 + libasn1fix/check_fixer.c | 313 + libasn1parser/Makefile.am | 35 + libasn1parser/Makefile.in | 459 ++ libasn1parser/asn1p_class.c | 135 + libasn1parser/asn1p_class.h | 53 + libasn1parser/asn1p_constr.c | 91 + libasn1parser/asn1p_constr.h | 79 + libasn1parser/asn1p_expr.c | 112 + libasn1parser/asn1p_expr.h | 214 + libasn1parser/asn1p_expr2uclass.h | 41 + libasn1parser/asn1p_expr_str.h | 57 + libasn1parser/asn1p_l.c | 3861 +++++++++++++ libasn1parser/asn1p_l.l | 560 ++ libasn1parser/asn1p_list.h | 57 + libasn1parser/asn1p_module.c | 62 + libasn1parser/asn1p_module.h | 88 + libasn1parser/asn1p_oid.c | 95 + libasn1parser/asn1p_oid.h | 66 + libasn1parser/asn1p_param.c | 111 + libasn1parser/asn1p_param.h | 30 + libasn1parser/asn1p_ref.c | 137 + libasn1parser/asn1p_ref.h | 62 + libasn1parser/asn1p_value.c | 178 + libasn1parser/asn1p_value.h | 60 + libasn1parser/asn1p_xports.c | 34 + libasn1parser/asn1p_xports.h | 40 + libasn1parser/asn1p_y.c | 3484 ++++++++++++ libasn1parser/asn1p_y.h | 132 + libasn1parser/asn1p_y.y | 1982 +++++++ libasn1parser/asn1parser.c | 171 + libasn1parser/asn1parser.h | 73 + libasn1parser/expr-h.pl | 49 + libasn1print/Makefile.am | 14 + libasn1print/Makefile.in | 382 ++ libasn1print/README | 4 + libasn1print/asn1print.c | 456 ++ libasn1print/asn1print.h | 16 + ltconfig | 3096 ++++++++++ ltmain.sh | 4122 ++++++++++++++ missing | 283 + mkinstalldirs | 40 + skeletons/BIT_STRING.c | 96 + skeletons/BIT_STRING.h | 18 + skeletons/BMPString.c | 65 + skeletons/BMPString.h | 17 + skeletons/BOOLEAN.c | 147 + skeletons/BOOLEAN.h | 21 + skeletons/ENUMERATED.c | 26 + skeletons/ENUMERATED.h | 15 + skeletons/GeneralString.c | 27 + skeletons/GeneralString.h | 15 + skeletons/GeneralizedTime.c | 302 + skeletons/GeneralizedTime.h | 26 + skeletons/GraphicString.c | 27 + skeletons/GraphicString.h | 15 + skeletons/IA5String.c | 57 + skeletons/IA5String.h | 20 + skeletons/INTEGER.c | 305 + skeletons/INTEGER.h | 33 + skeletons/ISO646String.c | 27 + skeletons/ISO646String.h | 15 + skeletons/Makefile.am | 7 + skeletons/Makefile.in | 364 ++ skeletons/NULL.c | 51 + skeletons/NULL.h | 19 + skeletons/NativeEnumerated.c | 32 + skeletons/NativeEnumerated.h | 19 + skeletons/NativeInteger.c | 193 + skeletons/NativeInteger.h | 24 + skeletons/NumericString.c | 62 + skeletons/NumericString.h | 17 + skeletons/OBJECT_IDENTIFIER.c | 356 ++ skeletons/OBJECT_IDENTIFIER.h | 95 + skeletons/OCTET_STRING.c | 588 ++ skeletons/OCTET_STRING.h | 51 + skeletons/ObjectDescriptor.c | 27 + skeletons/ObjectDescriptor.h | 15 + skeletons/PrintableString.c | 81 + skeletons/PrintableString.h | 17 + skeletons/README | 6 + skeletons/RELATIVE-OID.c | 155 + skeletons/RELATIVE-OID.h | 30 + skeletons/T61String.c | 27 + skeletons/T61String.h | 15 + skeletons/TeletexString.c | 27 + skeletons/TeletexString.h | 15 + skeletons/UTCTime.c | 105 + skeletons/UTCTime.h | 26 + skeletons/UTF8String.c | 112 + skeletons/UTF8String.h | 22 + skeletons/UniversalString.c | 83 + skeletons/UniversalString.h | 17 + skeletons/VideotexString.c | 27 + skeletons/VideotexString.h | 15 + skeletons/VisibleString.c | 81 + skeletons/VisibleString.h | 17 + skeletons/asn_SEQUENCE_OF.c | 41 + skeletons/asn_SEQUENCE_OF.h | 36 + skeletons/asn_SET_OF.c | 89 + skeletons/asn_SET_OF.h | 46 + skeletons/asn_types.h | 63 + skeletons/ber_decoder.c | 230 + skeletons/ber_decoder.h | 77 + skeletons/ber_tlv_length.c | 159 + skeletons/ber_tlv_length.h | 40 + skeletons/ber_tlv_tag.c | 145 + skeletons/ber_tlv_tag.h | 52 + skeletons/constr_CHOICE.c | 627 ++ skeletons/constr_CHOICE.h | 65 + skeletons/constr_SEQUENCE.c | 588 ++ skeletons/constr_SEQUENCE.h | 53 + skeletons/constr_SEQUENCE_OF.c | 84 + skeletons/constr_SEQUENCE_OF.h | 21 + skeletons/constr_SET.c | 682 +++ skeletons/constr_SET.h | 90 + skeletons/constr_SET_OF.c | 530 ++ skeletons/constr_SET_OF.h | 38 + skeletons/constr_TYPE.c | 58 + skeletons/constr_TYPE.h | 98 + skeletons/constraints.c | 111 + skeletons/constraints.h | 57 + skeletons/der_encoder.c | 143 + skeletons/der_encoder.h | 73 + skeletons/tests/Makefile.am | 9 + skeletons/tests/Makefile.in | 411 ++ skeletons/tests/check-GeneralizedTime.c | 54 + skeletons/tests/check-INTEGER.c | 56 + skeletons/tests/check-OIDs.c | 228 + skeletons/tests/check-UTCTime.c | 54 + stamp-h.in | 1 + tests/00-empty-OK.asn1 | 1 + tests/01-empty-OK.asn1 | 14 + tests/02-garbage-NP.asn1 | 17 + tests/03-enum-OK.asn1 | 22 + tests/04-enum-SE.asn1 | 19 + tests/05-enum-SE.asn1 | 21 + tests/06-enum-SE.asn1 | 20 + tests/07-int-OK.asn1 | 26 + tests/08-int-SE.asn1 | 19 + tests/09-int-SE.asn1 | 20 + tests/10-int-OK.asn1 | 29 + tests/11-int-SE.asn1 | 18 + tests/12-int-SE.asn1 | 17 + tests/13-resolver-OK.asn1 | 47 + tests/14-resolver-OK.asn1 | 45 + tests/15-resolver-SE.asn1 | 35 + tests/16-constraint-OK.asn1 | 23 + tests/17-tags-OK.asn1 | 24 + tests/18-class-OK.asn1 | 36 + tests/19-param-OK.asn1 | 30 + tests/20-constr-OK.asn1 | 30 + tests/21-tags-OK.asn1 | 34 + tests/22-tags-OK.asn1 | 23 + tests/23-bits-OK.asn1 | 22 + tests/24-sequence-OK.asn1 | 21 + tests/25-misc-OK.asn1 | 29 + tests/26-sequence-SE.asn1 | 20 + tests/27-set-SE.asn1 | 21 + tests/28-tags-SE.asn1 | 26 + tests/29-tags-OK.asn1 | 26 + tests/30-set-OK.asn1 | 21 + tests/31-set-of-OK.asn1 | 21 + tests/32-sequence-of-OK.asn1 | 22 + tests/33-misc-OK.asn1 | 33 + tests/34-class-OK.asn1 | 51 + tests/35-set-choice-OK.asn1 | 36 + tests/36-indirect-choice-SE.asn1 | 25 + tests/37-indirect-choice-OK.asn1 | 32 + tests/38-comments-OK.asn1 | 33 + tests/39-sequence-of-OK.asn1 | 24 + tests/39-sequence-of-OK.asn1.-P | 171 + tests/40-int-optional-SE.asn1 | 27 + tests/41-int-optional-OK.asn1 | 27 + tests/42-real-life-OK.asn1 | 67 + tests/42-real-life-OK.asn1.-PR | 569 ++ tests/43-recursion-OK.asn1 | 26 + tests/Makefile.am | 2 + tests/Makefile.in | 219 + tests/README | 24 + 277 files changed, 55557 insertions(+) create mode 100644 AUTHORS create mode 100644 BUGS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 MANIFEST create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 TODO create mode 100644 aclocal.m4 create mode 100644 asn1c/Makefile.am create mode 100644 asn1c/Makefile.in create mode 100644 asn1c/README create mode 100644 asn1c/asn1c.1 create mode 100644 asn1c/asn1c.c create mode 100755 asn1c/check-parsing.sh create mode 100644 asn1c/tests/Makefile.am create mode 100644 asn1c/tests/Makefile.in create mode 100644 asn1c/tests/README create mode 100644 asn1c/tests/check-22.c create mode 100644 asn1c/tests/check-24.c create mode 100644 asn1c/tests/check-25.c create mode 100644 asn1c/tests/check-30.c create mode 100644 asn1c/tests/check-31.c create mode 100644 asn1c/tests/check-32.c create mode 100644 asn1c/tests/check-33.c create mode 100644 asn1c/tests/check-35.c create mode 100644 asn1c/tests/check-41.c create mode 100644 asn1c/tests/check-43.c create mode 100755 asn1c/tests/check-assembly.sh create mode 100755 config.guess create mode 100644 config.h.in create mode 100755 config.sub create mode 100755 configure create mode 100644 configure.in create mode 100755 depcomp create mode 100644 doc/Makefile.am create mode 100644 doc/Makefile.in create mode 100644 doc/asn1c-usage.pdf create mode 100644 examples/Makefile.am create mode 100644 examples/Makefile.in create mode 100644 examples/README create mode 100755 examples/clyx2asn1.pl create mode 100755 examples/crfc2asn1.pl create mode 100755 install-sh create mode 100644 libasn1compiler/Makefile.am create mode 100644 libasn1compiler/Makefile.in create mode 100644 libasn1compiler/asn1c_C.c create mode 100644 libasn1compiler/asn1c_C.h create mode 100644 libasn1compiler/asn1c_internal.h create mode 100644 libasn1compiler/asn1c_lang.c create mode 100644 libasn1compiler/asn1c_lang.h create mode 100644 libasn1compiler/asn1c_misc.c create mode 100644 libasn1compiler/asn1c_misc.h create mode 100644 libasn1compiler/asn1c_out.c create mode 100644 libasn1compiler/asn1c_out.h create mode 100644 libasn1compiler/asn1c_save.c create mode 100644 libasn1compiler/asn1c_save.h create mode 100644 libasn1compiler/asn1compiler.c create mode 100644 libasn1compiler/asn1compiler.h create mode 100644 libasn1compiler/check_compiler.c create mode 100644 libasn1fix/Makefile.am create mode 100644 libasn1fix/Makefile.in create mode 100644 libasn1fix/asn1fix.c create mode 100644 libasn1fix/asn1fix.h create mode 100644 libasn1fix/asn1fix_bitstring.c create mode 100644 libasn1fix/asn1fix_bitstring.h create mode 100644 libasn1fix/asn1fix_class.c create mode 100644 libasn1fix/asn1fix_class.h create mode 100644 libasn1fix/asn1fix_compat.c create mode 100644 libasn1fix/asn1fix_compat.h create mode 100644 libasn1fix/asn1fix_constr.c create mode 100644 libasn1fix/asn1fix_constr.h create mode 100644 libasn1fix/asn1fix_cstring.c create mode 100644 libasn1fix/asn1fix_cstring.h create mode 100644 libasn1fix/asn1fix_dereft.c create mode 100644 libasn1fix/asn1fix_dereft.h create mode 100644 libasn1fix/asn1fix_derefv.c create mode 100644 libasn1fix/asn1fix_derefv.h create mode 100644 libasn1fix/asn1fix_enum.c create mode 100644 libasn1fix/asn1fix_enum.h create mode 100644 libasn1fix/asn1fix_export.c create mode 100644 libasn1fix/asn1fix_export.h create mode 100644 libasn1fix/asn1fix_integer.c create mode 100644 libasn1fix/asn1fix_integer.h create mode 100644 libasn1fix/asn1fix_internal.h create mode 100644 libasn1fix/asn1fix_misc.c create mode 100644 libasn1fix/asn1fix_misc.h create mode 100644 libasn1fix/asn1fix_param.c create mode 100644 libasn1fix/asn1fix_param.h create mode 100644 libasn1fix/asn1fix_retrieve.c create mode 100644 libasn1fix/asn1fix_retrieve.h create mode 100644 libasn1fix/asn1fix_tags.c create mode 100644 libasn1fix/asn1fix_tags.h create mode 100644 libasn1fix/asn1fix_value.c create mode 100644 libasn1fix/asn1fix_value.h create mode 100644 libasn1fix/check_fixer.c create mode 100644 libasn1parser/Makefile.am create mode 100644 libasn1parser/Makefile.in create mode 100644 libasn1parser/asn1p_class.c create mode 100644 libasn1parser/asn1p_class.h create mode 100644 libasn1parser/asn1p_constr.c create mode 100644 libasn1parser/asn1p_constr.h create mode 100644 libasn1parser/asn1p_expr.c create mode 100644 libasn1parser/asn1p_expr.h create mode 100644 libasn1parser/asn1p_expr2uclass.h create mode 100644 libasn1parser/asn1p_expr_str.h create mode 100644 libasn1parser/asn1p_l.c create mode 100644 libasn1parser/asn1p_l.l create mode 100644 libasn1parser/asn1p_list.h create mode 100644 libasn1parser/asn1p_module.c create mode 100644 libasn1parser/asn1p_module.h create mode 100644 libasn1parser/asn1p_oid.c create mode 100644 libasn1parser/asn1p_oid.h create mode 100644 libasn1parser/asn1p_param.c create mode 100644 libasn1parser/asn1p_param.h create mode 100644 libasn1parser/asn1p_ref.c create mode 100644 libasn1parser/asn1p_ref.h create mode 100644 libasn1parser/asn1p_value.c create mode 100644 libasn1parser/asn1p_value.h create mode 100644 libasn1parser/asn1p_xports.c create mode 100644 libasn1parser/asn1p_xports.h create mode 100644 libasn1parser/asn1p_y.c create mode 100644 libasn1parser/asn1p_y.h create mode 100644 libasn1parser/asn1p_y.y create mode 100644 libasn1parser/asn1parser.c create mode 100644 libasn1parser/asn1parser.h create mode 100755 libasn1parser/expr-h.pl create mode 100644 libasn1print/Makefile.am create mode 100644 libasn1print/Makefile.in create mode 100644 libasn1print/README create mode 100644 libasn1print/asn1print.c create mode 100644 libasn1print/asn1print.h create mode 100755 ltconfig create mode 100644 ltmain.sh create mode 100755 missing create mode 100755 mkinstalldirs create mode 100644 skeletons/BIT_STRING.c create mode 100644 skeletons/BIT_STRING.h create mode 100644 skeletons/BMPString.c create mode 100644 skeletons/BMPString.h create mode 100644 skeletons/BOOLEAN.c create mode 100644 skeletons/BOOLEAN.h create mode 100644 skeletons/ENUMERATED.c create mode 100644 skeletons/ENUMERATED.h create mode 100644 skeletons/GeneralString.c create mode 100644 skeletons/GeneralString.h create mode 100644 skeletons/GeneralizedTime.c create mode 100644 skeletons/GeneralizedTime.h create mode 100644 skeletons/GraphicString.c create mode 100644 skeletons/GraphicString.h create mode 100644 skeletons/IA5String.c create mode 100644 skeletons/IA5String.h create mode 100644 skeletons/INTEGER.c create mode 100644 skeletons/INTEGER.h create mode 100644 skeletons/ISO646String.c create mode 100644 skeletons/ISO646String.h create mode 100644 skeletons/Makefile.am create mode 100644 skeletons/Makefile.in create mode 100644 skeletons/NULL.c create mode 100644 skeletons/NULL.h create mode 100644 skeletons/NativeEnumerated.c create mode 100644 skeletons/NativeEnumerated.h create mode 100644 skeletons/NativeInteger.c create mode 100644 skeletons/NativeInteger.h create mode 100644 skeletons/NumericString.c create mode 100644 skeletons/NumericString.h create mode 100644 skeletons/OBJECT_IDENTIFIER.c create mode 100644 skeletons/OBJECT_IDENTIFIER.h create mode 100644 skeletons/OCTET_STRING.c create mode 100644 skeletons/OCTET_STRING.h create mode 100644 skeletons/ObjectDescriptor.c create mode 100644 skeletons/ObjectDescriptor.h create mode 100644 skeletons/PrintableString.c create mode 100644 skeletons/PrintableString.h create mode 100644 skeletons/README create mode 100644 skeletons/RELATIVE-OID.c create mode 100644 skeletons/RELATIVE-OID.h create mode 100644 skeletons/T61String.c create mode 100644 skeletons/T61String.h create mode 100644 skeletons/TeletexString.c create mode 100644 skeletons/TeletexString.h create mode 100644 skeletons/UTCTime.c create mode 100644 skeletons/UTCTime.h create mode 100644 skeletons/UTF8String.c create mode 100644 skeletons/UTF8String.h create mode 100644 skeletons/UniversalString.c create mode 100644 skeletons/UniversalString.h create mode 100644 skeletons/VideotexString.c create mode 100644 skeletons/VideotexString.h create mode 100644 skeletons/VisibleString.c create mode 100644 skeletons/VisibleString.h create mode 100644 skeletons/asn_SEQUENCE_OF.c create mode 100644 skeletons/asn_SEQUENCE_OF.h create mode 100644 skeletons/asn_SET_OF.c create mode 100644 skeletons/asn_SET_OF.h create mode 100644 skeletons/asn_types.h create mode 100644 skeletons/ber_decoder.c create mode 100644 skeletons/ber_decoder.h create mode 100644 skeletons/ber_tlv_length.c create mode 100644 skeletons/ber_tlv_length.h create mode 100644 skeletons/ber_tlv_tag.c create mode 100644 skeletons/ber_tlv_tag.h create mode 100644 skeletons/constr_CHOICE.c create mode 100644 skeletons/constr_CHOICE.h create mode 100644 skeletons/constr_SEQUENCE.c create mode 100644 skeletons/constr_SEQUENCE.h create mode 100644 skeletons/constr_SEQUENCE_OF.c create mode 100644 skeletons/constr_SEQUENCE_OF.h create mode 100644 skeletons/constr_SET.c create mode 100644 skeletons/constr_SET.h create mode 100644 skeletons/constr_SET_OF.c create mode 100644 skeletons/constr_SET_OF.h create mode 100644 skeletons/constr_TYPE.c create mode 100644 skeletons/constr_TYPE.h create mode 100644 skeletons/constraints.c create mode 100644 skeletons/constraints.h create mode 100644 skeletons/der_encoder.c create mode 100644 skeletons/der_encoder.h create mode 100644 skeletons/tests/Makefile.am create mode 100644 skeletons/tests/Makefile.in create mode 100644 skeletons/tests/check-GeneralizedTime.c create mode 100644 skeletons/tests/check-INTEGER.c create mode 100644 skeletons/tests/check-OIDs.c create mode 100644 skeletons/tests/check-UTCTime.c create mode 100644 stamp-h.in create mode 100644 tests/00-empty-OK.asn1 create mode 100644 tests/01-empty-OK.asn1 create mode 100644 tests/02-garbage-NP.asn1 create mode 100644 tests/03-enum-OK.asn1 create mode 100644 tests/04-enum-SE.asn1 create mode 100644 tests/05-enum-SE.asn1 create mode 100644 tests/06-enum-SE.asn1 create mode 100644 tests/07-int-OK.asn1 create mode 100644 tests/08-int-SE.asn1 create mode 100644 tests/09-int-SE.asn1 create mode 100644 tests/10-int-OK.asn1 create mode 100644 tests/11-int-SE.asn1 create mode 100644 tests/12-int-SE.asn1 create mode 100644 tests/13-resolver-OK.asn1 create mode 100644 tests/14-resolver-OK.asn1 create mode 100644 tests/15-resolver-SE.asn1 create mode 100644 tests/16-constraint-OK.asn1 create mode 100644 tests/17-tags-OK.asn1 create mode 100644 tests/18-class-OK.asn1 create mode 100644 tests/19-param-OK.asn1 create mode 100644 tests/20-constr-OK.asn1 create mode 100644 tests/21-tags-OK.asn1 create mode 100644 tests/22-tags-OK.asn1 create mode 100644 tests/23-bits-OK.asn1 create mode 100644 tests/24-sequence-OK.asn1 create mode 100644 tests/25-misc-OK.asn1 create mode 100644 tests/26-sequence-SE.asn1 create mode 100644 tests/27-set-SE.asn1 create mode 100644 tests/28-tags-SE.asn1 create mode 100644 tests/29-tags-OK.asn1 create mode 100644 tests/30-set-OK.asn1 create mode 100644 tests/31-set-of-OK.asn1 create mode 100644 tests/32-sequence-of-OK.asn1 create mode 100644 tests/33-misc-OK.asn1 create mode 100644 tests/34-class-OK.asn1 create mode 100644 tests/35-set-choice-OK.asn1 create mode 100644 tests/36-indirect-choice-SE.asn1 create mode 100644 tests/37-indirect-choice-OK.asn1 create mode 100644 tests/38-comments-OK.asn1 create mode 100644 tests/39-sequence-of-OK.asn1 create mode 100644 tests/39-sequence-of-OK.asn1.-P create mode 100644 tests/40-int-optional-SE.asn1 create mode 100644 tests/41-int-optional-OK.asn1 create mode 100644 tests/42-real-life-OK.asn1 create mode 100644 tests/42-real-life-OK.asn1.-PR create mode 100644 tests/43-recursion-OK.asn1 create mode 100644 tests/Makefile.am create mode 100644 tests/Makefile.in create mode 100644 tests/README diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 00000000..d510bcde --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Lev Walkin diff --git a/BUGS b/BUGS new file mode 100644 index 00000000..3e8145c0 --- /dev/null +++ b/BUGS @@ -0,0 +1,31 @@ + +0. ASN.1 grammar parser is written mostly with respect to constructing a tree, +so a tree destruction is not fully supported and certain memory leaks are +known. Not a huge problem for run-once programs like a compiler. +NOTE: This statement does not apply to the target code _produced_ + by the compiler. + +1. REAL type is not supported yet. + +2. For purposes of compilation, INTEGER type is modelled using a large +static type (asn_integer_t), but defined as any positive or negative value +by ASN.1. Not a problem as most specifications use very small values anyway. +NOTE: This statement does not apply to the target code _produced_ + by the compiler. + +3. ASN Macros are prohibited by the current ASN.1 standard, +and are not supported. + +4. Multiple tags applied at the same level are not supported: + BadTags ::= [0] EXPLICIT [2] IMPLICIT OtherType + The same thing could be achieved by using the indirection: + GoodTags ::= [0] EXPLICIT OtherTypePtr + OtherTypePtr ::= [2] IMPLICIT OtherType + +5. Mixed definite/indefinite length in a _single_ BER tags sequence is not +supported. Should not be a problem in the real world. Please note that it +is still possible, for example, to encode a wrapper structure using definite +length, and encode its substructure member using indefinite length. The BER +decoder is perfectly capable of decoding such sequences. + + diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..5addee94 --- /dev/null +++ b/COPYING @@ -0,0 +1,27 @@ +/*- + * Copyright (c) 2003, 2004 Lev Walkin + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + */ diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 00000000..45a11c82 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,130 @@ + +0.8.10: 2004-Jun-02 + + * Added const qualifier where necessary. + * Changed position of outmost_tag fetcher within asn1_TYPE_descriptor_t + structure. + +0.8.9: 2004-May-26 + + * Added *_{get|set}_arcs_*() functions for OBJECT IDENTIFIER + and RELATIVE-OID, together with test cases. + +0.8.8: 2004-May-09 + + * Introduced subtype constraints support (incomplete!). + * Fixed compiler. If the last member of the SEQUENCE is OPTIONAL + and absent in the encoding, and the type is extensible (...) or + EXTENSIBILITY IMPLIED flag is set, then the structure could not + be correctly decoded. (Severity: high, Security impact: low). + * Compiler: fixed recursive ASN.1 types inclusion (Severity: low, + Security impact: none). + * Parser: IMPORTS/FROM fixes, now allowing multiple sections. + * Code compiled and checked on PowerPC (@MacOS X). No major portability + issues experienced. + +0.8.7: 2004-Apr-11 T-version-0-8-7 + + * Fixed SEQUENCE BER decoder: if the last member of the SEQUENCE is + OPTIONAL and absent in the encoding, RC_FAIL was returned instead + of RC_OK (Severity: high, Security impact: low). + * Added test case to check the above problem. + * Added test case to check -fnative-integers mode. + +0.8.6: 2004-Apr-03 T-version-0-8-6 + + * Fixed compiler output for embedded ASN.1 structures. + +0.8.5: 2004-Mar-28 T-version-0-8-5 + + * Fixed ber_tlv_length() computation problem (Severity: blocker, + Security impact: none). + Reported by + +0.8.4: 2004-Mar-22 + + * Removed RC_ITAG enumeration element from BER decoder. + This return code did not have much practical value. + +0.8.3: 2004-Mar-14 T-version-0-8-3 + + * Fixed SET::BER decoder: restart after reaching a buffer boundary + weas broken (Severity: blocker, Security impact: low). + * Fixed OCTET STRING::BER decoder: restart after reaching a buffer + boundary was broken (Severity: blocker, Security impact: low). + Reported by + * Added test cases to check decoders restartability. + * Slightly more general INTEGER2long decoder. + * Allowed nested /* C-type */ comments, as per X.680:2002. + +0.8.2: 2004-Mar-01 T-version-0-8-2 + + * Fixed SEQUENCE BER decoder: an OPTIONAL element was required, where + should not have been (Severity: major; Security impact: low). + * Fixed print_struct pointer inheritance. + * Added -fno-c99 and -funnamed-unions + +0.8.1: 2004-Feb-22 + + * -R switch to asn1c: Omit support code, compile only the tables. + * Introduced NativeInteger pseudotype. + * Corrected the informal print_struct()'s output format. + +0.8.0: 2004-Feb-03 T-version-0-8-0 + + * Some documentation is created (a .pdf and a short manual page). + * Last touches to the code. + +0.7.9: 2004-Feb-01 T-version-0-7-9 + + * Human readable printing support. + * Support for implicit (standard) constraints. + +0.7.8: 2004-Jan-31 + + * SET now rejects duplicate fields in the data stream. + +0.7.7: 2004-Jan-25 + + * Added types: GeneralizedTime and UTCTime. + +0.7.6: 2004-Jan-24 T-version-0-7-6 + + * DER encoding of a SET OF now involves dynamic sorting. + +0.7.5: 2004-Jan-24 T-version-0-7-5 + + * DER encoding of a SET with untagged CHOICE + now involves dynamic sorting. + +0.7.0: 2004-Jan-19 T-version-0-7-0 + + * A bunch of DER encoders is implemented. + +0.6.6: 2004-Jan-11 + + * Implemented CHOICE decoder. + * Implemented destructors support. + +0.6.5: 2004-Jan-03 + + * Implemented SET decoder. + * Implemented SET OF and SEQUENCE OF decoders. + +0.6.4: 2003-Dec-31 + + * Implemented BOOLEAN, NULL, ENUMERATED decoders. + * Implemented OCTET STRING decoder. + * Implemented BIT STRING decoder. + +0.6: 2003-Dec-30 + + * First decoding of a BER-encoded structure! + +0.5: 2003-Dec-28 + + * Framework and most of the compiler backbone coding done. + +0.1: 2003-Nov-28 + + * Programming started. diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..5d2d54c5 --- /dev/null +++ b/INSTALL @@ -0,0 +1,14 @@ +QUICK START INSTALLATION +======================== + +./configure # Configure the build infrastructure for your platform +make # Build the libraries and the compiler +make check # Ensure that the code is still behaving well + # after compiling on your platform +make install # Install the compiler into standard location + + +QUICK USAGE GUIDE +================= + +For usage guide and more information please refer to README file. diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 00000000..1be9e9f6 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,9 @@ +libasn1compiler +libasn1parser +libasn1print +libasn1fix +skeletons +examples +tests +asn1c +doc diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..da7f6821 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,8 @@ + +SUBDIRS = \ + libasn1parser libasn1print \ + libasn1fix libasn1compiler \ + skeletons examples tests \ + doc asn1c + +EXTRA_DIST = BUGS MANIFEST diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 00000000..1ce7ad4c --- /dev/null +++ b/Makefile.in @@ -0,0 +1,430 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +ADD_CFLAGS = @ADD_CFLAGS@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AWK = @AWK@ +CC = @CC@ +CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@ +CPP = @CPP@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LEX = @LEX@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PATH = @PATH@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +YACC = @YACC@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +SUBDIRS = \ + libasn1parser libasn1print \ + libasn1fix libasn1compiler \ + skeletons examples tests \ + doc asn1c + + +EXTRA_DIST = BUGS MANIFEST +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ + Makefile.am Makefile.in NEWS TODO aclocal.m4 config.guess \ + config.h.in config.sub configure configure.in depcomp \ + install-sh ltconfig ltmain.sh missing mkinstalldirs +DIST_SUBDIRS = $(SUBDIRS) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$@ $(SHELL) ./config.status + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +config.h: stamp-h + @if test ! -f $@; then \ + rm -f stamp-h; \ + $(MAKE) stamp-h; \ + else :; fi +stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h stamp-hT + @echo timestamp > stamp-hT 2> /dev/null + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=config.h \ + $(SHELL) ./config.status + @mv stamp-hT stamp-h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/./stamp-h.in + @if test ! -f $@; then \ + rm -f $(srcdir)/./stamp-h.in; \ + $(MAKE) $(srcdir)/./stamp-h.in; \ + else :; fi +$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) + @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT + @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null + cd $(top_srcdir) && $(AUTOHEADER) + @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in + +distclean-hdr: + -rm -f config.h +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +# Avoid unsightly `./'. +distdir = $(PACKAGE)-$(VERSION) + +GZIP_ENV = --best + +distdir: $(DISTFILES) + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) + mkdir $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(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 + -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ + || (echo "Error: files left after uninstall" 1>&2; \ + exit 1) ) \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && $(MAKE) $(AM_MAKEFLAGS) distclean \ + && rm -f $(distdir).tar.gz \ + && (test `find . -type f -print | wc -l` -eq 0 \ + || (echo "Error: files left after distclean" 1>&2; \ + exit 1) ) + -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) +distclean: distclean-recursive + -rm -f config.status config.cache config.log +distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-libtool clean-recursive dist dist-all \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-recursive distclean-tags distdir \ + dvi dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + +# 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/NEWS b/NEWS new file mode 100644 index 00000000..e69de29b diff --git a/README b/README new file mode 100644 index 00000000..586bb3d3 --- /dev/null +++ b/README @@ -0,0 +1,69 @@ +WHAT TO READ? +============= + +For quick installation tips read INSTALL. + +For more complete documentation on this compiler and on using the +results of compilation please look into ./doc directory. + +An excellent book on ASN.1 is written by Olivier Dubuisson: +"ASN.1 Communication between heterogeneous systems", ISBN:0-12-6333361-0. + + +QUICK START +=========== + +After building [and installing] the compiler (see INSTALL), you may use +the asn1c command to compile the ASN.1 specification: + + asn1c + +If several specifications contain interdependencies, all of them must be +specified: + + asn1c ... + +The ./examples directory contains several ASN.1 modules and a script to +extract ASN.1 modules from RFC documents. To compile X.509 PKI module: + + ./asn1c/asn1c -P ./examples/*PKIX*93*.asn1 + +In this example, -P option is used to instruct the compiler to print the +compiled text on the standard output instead of creating multiple .c +and .h files for every ASN.1 type found inside the specified files. +This is useful for debugging and tests automation. + +The compiler -E and -EF options are used for testing the parser and +the semantic fixer, respectively. These options will instruct the compiler +to dump out the parsed (and fixed) ASN.1 specification as it was +"understood" by the compiler. It might be useful for checking +whether a particular syntactic construction is properly supported +by the compiler. + + asn1c -EF + + +MODEL OF OPERATION +================== + +The asn1c compiler works by processing the ASN.1 module specification +in several stages: +1. In the first stage, the ASN.1 file is parsed. + (Parsing produces an ASN.1 syntax tree for the subsequent levels.) +2. In the second stage, the syntax tree is "fixed". + (Fixing is done by checking the tree for semantic errors + and by transforming the tree into the canonical representation.) +3. In the third stage, the syntax tree is compiled into the target language. + +There are several command-line options reserved for printing the results +after each stage of operation: + + => print (-E) + => => print (-E -F) + => => => print (-P) + => => => save-compiled [default] + + +-- +Lev Walkin +vlm@lionet.info diff --git a/TODO b/TODO new file mode 100644 index 00000000..1316b857 --- /dev/null +++ b/TODO @@ -0,0 +1,18 @@ +MAJOR: + +1. Support for the explicit subtype constraints: + Name ::= IA5String (FROM("A".."Z")) + Status: in progress. + +2. Support for Information Object Classes. + Status: support for parsing IOCs is mostly present. Support for slicing + the IOCs to produce "views" is not yet designed. + +3. Support for PER encoding. Requires advanced subtype constraints support (#1) + +4. Support for XER encoding. + +MISC: + +1. Make sure asn1_DEF__tags is not an empty structure. + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 00000000..f71fa03e --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,998 @@ +# aclocal.m4 generated automatically by aclocal 1.5 + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001 +# 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. + +# Do all the work for Automake. 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. + +# serial 5 + +# 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... + + +# We require 2.13 because we rely on SHELL being computed by configure. +AC_PREREQ([2.13]) + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED. +# The purpose of this macro is to provide the user with a means to +# check macros which are provided without letting her know how the +# information is coded. +# If this macro is not defined by Autoconf, define it here. +ifdef([AC_PROVIDE_IFELSE], + [], + [define([AC_PROVIDE_IFELSE], + [ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE]) +# ---------------------------------------------- +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first]) +fi + +# Define the identity of the package. +PACKAGE=$1 +AC_SUBST(PACKAGE)dnl +VERSION=$2 +AC_SUBST(VERSION)dnl +ifelse([$3],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +ifdef([m4_pattern_allow], + [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl + +# Autoconf 2.50 always computes EXEEXT. However we need to be +# compatible with 2.13, for now. So we always define EXEEXT, but we +# don't compute it. +AC_SUBST(EXEEXT) +# Similar for OBJEXT -- only we only use OBJEXT if the user actually +# requests that it be used. This is a bit dumb. +: ${OBJEXT=o} +AC_SUBST(OBJEXT) + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# 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_DEP_TRACK])dnl +AC_REQUIRE([AM_SET_DEPDIR])dnl +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 +]) + +# +# Check to make sure that the build environment is sane. +# + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + + +# serial 2 + +# 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 +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + am_backtick='`' + AC_MSG_WARN([${am_backtick}missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# 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], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# 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 +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# serial 4 -*- Autoconf -*- + + + +# 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" 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], 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 + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # 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. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type" +AC_SUBST([$1DEPMODE]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null +AC_SUBST(DEPDIR) +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --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]) +pushdef([subst], defn([AC_SUBST])) +subst(AMDEPBACKSLASH) +popdef([subst]) +]) + +# Generate code to set up dependency tracking. +# This macro should only be invoked once -- use via AC_REQUIRE. +# Usage: +# AM_OUTPUT_DEPENDENCY_COMMANDS + +# +# 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_OUTPUT_COMMANDS([ +test x"$AMDEP_TRUE" != x"" || +for mf in $CONFIG_FILES; do + case "$mf" in + Makefile) dirpart=.;; + */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; + *) continue;; + esac + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # 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 -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //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=`echo "$file" | sed -e 's|/[^/]*$||'` + $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +], [AMDEP_TRUE="$AMDEP_TRUE" +ac_aux_dir="$ac_aux_dir"])]) + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include='#' +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote='"' + _am_result=BSD + fi +fi +AC_SUBST(am__include) +AC_SUBST(am__quote) +AC_MSG_RESULT($_am_result) +rm -f confinc confmf +]) + +# serial 3 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +# +# FIXME: Once using 2.50, use this: +# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], + [errprint(__file__:__line__: [$0: invalid condition: $1 +])dnl +m4exit(1)])dnl +ifelse([$1], [FALSE], + [errprint(__file__:__line__: [$0: invalid condition: $1 +])dnl +m4exit(1)])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + + +# serial 40 AC_PROG_LIBTOOL +AC_DEFUN(AC_PROG_LIBTOOL, +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + +# Save cache, so that ltconfig can load it +AC_CACHE_SAVE + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ +|| AC_MSG_ERROR([libtool configure failed]) + +# Reload cache, that may have been modified by ltconfig +AC_CACHE_LOAD + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log +]) + +AC_DEFUN(AC_LIBTOOL_SETUP, +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_RANLIB])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +dnl + +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac + +# Check for any special flags to pass to ltconfig. +libtool_flags="--cache-file=$cache_file" +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], +[libtool_flags="$libtool_flags --enable-dlopen"]) +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[libtool_flags="$libtool_flags --enable-win32-dll"]) +AC_ARG_ENABLE(libtool-lock, + [ --disable-libtool-lock avoid locking (might break parallel builds)]) +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$lt_target" in +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + 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_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) + 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 + ;; + +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +]) +esac +]) + +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) + +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) + +# AC_ENABLE_SHARED - implement the --enable-shared flag +# Usage: AC_ENABLE_SHARED[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_SHARED, [dnl +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(shared, +changequote(<<, >>)dnl +<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], +changequote([, ])dnl +[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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl +]) + +# AC_DISABLE_SHARED - set the default shared flag to --disable-shared +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no)]) + +# AC_ENABLE_STATIC - implement the --enable-static flag +# Usage: AC_ENABLE_STATIC[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_STATIC, [dnl +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(static, +changequote(<<, >>)dnl +<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], +changequote([, ])dnl +[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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl +]) + +# AC_DISABLE_STATIC - set the default static flag to --disable-static +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no)]) + + +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(fast-install, +changequote(<<, >>)dnl +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +changequote([, ])dnl +[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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl +]) + +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no)]) + +# AC_PROG_LD - find the path to the GNU or non-GNU linker +AC_DEFUN(AC_PROG_LD, +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$ac_cv_prog_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. +changequote(,)dnl + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' +changequote([,])dnl + # Canonicalize the path 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(ac_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + ac_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + ac_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$ac_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_PROG_LD_GNU +]) + +AC_DEFUN(AC_PROG_LD_GNU, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + ac_cv_prog_gnu_ld=yes +else + ac_cv_prog_gnu_ld=no +fi]) +]) + +# AC_PROG_NM - find the path to a BSD-compatible name lister +AC_DEFUN(AC_PROG_NM, +[AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(ac_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + ac_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/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 + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" + break + else + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm +fi]) +NM="$ac_cv_path_NM" +AC_MSG_RESULT([$NM]) +]) + +# AC_CHECK_LIBM - check for math library +AC_DEFUN(AC_CHECK_LIBM, +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case "$lt_target" in +*-*-beos* | *-*-cygwin*) + # These system don't have libm + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, main, LIBM="-lm") + ;; +esac +]) + +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl convenience library, adds --enable-ltdl-convenience to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case "$enable_ltdl_convenience" in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) +]) + +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl installable library, and adds --enable-ltdl-install to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, main, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + INCLTDL= + fi +]) + +dnl old names +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl + +dnl This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL])dnl + +# Like AC_CONFIG_HEADER, but automatically create stamp file. + +# serial 3 + +# 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. We must strip everything past the first ":", +# and everything past the last "/". + +AC_PREREQ([2.12]) + +AC_DEFUN([AM_CONFIG_HEADER], +[ifdef([AC_FOREACH],dnl + [dnl init our file count if it isn't already + m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0])) + dnl prepare to store our destination file list for use in config.status + AC_FOREACH([_AM_File], [$1], + [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*])) + m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index)) + dnl and add it to the list of files AC keeps track of, along + dnl with our hook + AC_CONFIG_HEADERS(_AM_File, +dnl COMMANDS, [, INIT-CMDS] +[# update the timestamp +echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index[" +][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS + m4_popdef([_AM_Dest])])],dnl +[AC_CONFIG_HEADER([$1]) + AC_OUTPUT_COMMANDS( + ifelse(patsubst([$1], [[^ ]], []), + [], + [test -z "$CONFIG_HEADERS" || echo timestamp >dnl + patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl +[am_indx=1 +for am_file in $1; do + case " \$CONFIG_HEADERS " in + *" \$am_file "*) + am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\` + if test -n "\$am_dir"; then + am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\` + for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do + am_tmpdir=\$am_tmpdir\$am_subdir/ + if test ! -d \$am_tmpdir; then + mkdir \$am_tmpdir + fi + done + fi + echo timestamp > "\$am_dir"stamp-h\$am_indx + ;; + esac + am_indx=\`expr \$am_indx + 1\` +done]) +])]) # AM_CONFIG_HEADER + +# _AM_DIRNAME(PATH) +# ----------------- +# Like AS_DIRNAME, only do it during macro expansion +AC_DEFUN([_AM_DIRNAME], + [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, + m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1, + m4_if(m4_regexp([$1], [^/.*]), -1, + [.], + m4_patsubst([$1], [^\(/\).*], [\1])), + m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), + m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl +]) # _AM_DIRNAME + + +# AM_PROG_LEX +# Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT +AC_DEFUN([AM_PROG_LEX], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +AC_CHECK_PROGS(LEX, flex lex, [${am_missing_run}flex]) +dnl AC_PROG_LEX +AC_DECL_YYTEXT]) + diff --git a/asn1c/Makefile.am b/asn1c/Makefile.am new file mode 100644 index 00000000..2363c189 --- /dev/null +++ b/asn1c/Makefile.am @@ -0,0 +1,25 @@ + +SUBDIRS = . tests + +AM_CFLAGS = @ADD_CFLAGS@ +AM_CPPFLAGS = \ + -I${top_srcdir}/libasn1compiler \ + -I${top_srcdir}/libasn1parser \ + -I${top_srcdir}/libasn1print \ + -I${top_srcdir}/libasn1fix \ + -DDATADIR=\"${pkgdatadir}\" + +LDADD = \ + ${top_builddir}/libasn1parser/libasn1parser.la \ + ${top_builddir}/libasn1fix/libasn1fix.la \ + ${top_builddir}/libasn1print/libasn1print.la \ + ${top_builddir}/libasn1compiler/libasn1compiler.la + +bin_PROGRAMS = asn1c + +dist_man1_MANS = asn1c.1 + +check_SCRIPTS = check-parsing.sh +TESTS = check-parsing.sh +EXTRA_DIST = check-parsing.sh +CLEANFILES = .check-parsing.*.tmp diff --git a/asn1c/Makefile.in b/asn1c/Makefile.in new file mode 100644 index 00000000..6b7805bc --- /dev/null +++ b/asn1c/Makefile.in @@ -0,0 +1,556 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +ADD_CFLAGS = @ADD_CFLAGS@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AWK = @AWK@ +CC = @CC@ +CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@ +CPP = @CPP@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LEX = @LEX@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PATH = @PATH@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +YACC = @YACC@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +SUBDIRS = . tests + +AM_CFLAGS = @ADD_CFLAGS@ +AM_CPPFLAGS = \ + -I${top_srcdir}/libasn1compiler \ + -I${top_srcdir}/libasn1parser \ + -I${top_srcdir}/libasn1print \ + -I${top_srcdir}/libasn1fix \ + -DDATADIR=\"${pkgdatadir}\" + + +LDADD = \ + ${top_builddir}/libasn1parser/libasn1parser.la \ + ${top_builddir}/libasn1fix/libasn1fix.la \ + ${top_builddir}/libasn1print/libasn1print.la \ + ${top_builddir}/libasn1compiler/libasn1compiler.la + + +bin_PROGRAMS = asn1c + +dist_man1_MANS = asn1c.1 + +check_SCRIPTS = check-parsing.sh +TESTS = check-parsing.sh +EXTRA_DIST = check-parsing.sh +CLEANFILES = .check-parsing.*.tmp +subdir = asn1c +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = asn1c$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + +asn1c_SOURCES = asn1c.c +asn1c_OBJECTS = asn1c.$(OBJEXT) +asn1c_LDADD = $(LDADD) +asn1c_DEPENDENCIES = ${top_builddir}/libasn1parser/libasn1parser.la \ + ${top_builddir}/libasn1fix/libasn1fix.la \ + ${top_builddir}/libasn1print/libasn1print.la \ + ${top_builddir}/libasn1compiler/libasn1compiler.la +asn1c_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/asn1c.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = asn1c.c + +NROFF = nroff +MANS = $(dist_man1_MANS) + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = README $(dist_man1_MANS) Makefile.am Makefile.in +DIST_SUBDIRS = $(SUBDIRS) +SOURCES = asn1c.c + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu asn1c/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +asn1c$(EXEEXT): $(asn1c_OBJECTS) $(asn1c_DEPENDENCIES) + @rm -f asn1c$(EXEEXT) + $(LINK) $(asn1c_LDFLAGS) $(asn1c_OBJECTS) $(asn1c_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1c.Po@am__quote@ + +distclean-depend: + -rm -rf $(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` + +.c.lo: +@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< +CCDEPMODE = @CCDEPMODE@ +uninstall-info-am: + +man1dir = $(mandir)/man1 +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + fi + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-recursive +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: install-man + +install-exec-am: install-binPROGRAMS + +install-info: install-info-recursive + +install-man: install-man1 + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man + +uninstall-info: uninstall-info-recursive + +uninstall-man: uninstall-man1 + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-TESTS check-am \ + clean clean-binPROGRAMS clean-generic clean-libtool \ + clean-recursive distclean distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-recursive \ + distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ + info-recursive install install-am install-binPROGRAMS \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-man1 install-recursive install-strip installcheck \ + installcheck-am installdirs installdirs-am \ + installdirs-recursive maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ + tags tags-recursive uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am \ + uninstall-info-recursive uninstall-man uninstall-man1 \ + uninstall-recursive + +# 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/asn1c/README b/asn1c/README new file mode 100644 index 00000000..158cd115 --- /dev/null +++ b/asn1c/README @@ -0,0 +1 @@ +The ASN.1 Compiler diff --git a/asn1c/asn1c.1 b/asn1c/asn1c.1 new file mode 100644 index 00000000..1b58f4df --- /dev/null +++ b/asn1c/asn1c.1 @@ -0,0 +1,99 @@ +.de Id +.. +.Id $Id" +.TH ASN1C 1 "\*(Dt" "ASN.1 Compiler" "ASN.1 Compiler" +.SH NAME +asn1c \- ASN.1 Compiler +.ND ASN.1 compiler +.SH SYNOPSIS +.B asn1c +.RI "[ " option " | " filename " ].\|.\|." +.SH DESCRIPTION +asn1c is a tool to compile the ASN.1 specifications into C language structures +and accompanying routines to perform data encoding and decoding. +.SH OPTIONS +.TP +.B Overall Options +\-E +\-F +\-L +\-N +\-P +.RI "\-S " directory +\-R +.TP +.B Language Options +.br +\-ftypes88 +\-fnative-integers +\-fno-c99 +\-funnamed-unions +.TP +.B Warning Options +.br +\-Werror +\-Wdebug-lexer +\-Wdebug-fixer +\-Wdebug-compiler +.SH OVERALL OPTIONS +.TP +.B \-E +Stop after the parsing stage. The output is reconstructed ASN.1 +specification code, which is sent to the standard output. +.TP +.B \-F +Used together with \c +.B \-E\c +, instructs the compiler to stop after the ASN.1 syntax +tree fixing stage and dump the reconstructed ASN.1 specification +to the standard output. +.TP +.B \-L +Generate "-- #line" comments in +.B -E +output. +.TP +.B \-N +Do not generate certain type of comments in +.B -E +output. +.TP +.B \-P +Dump the compiled output to the standard output instead of creating the +target language files on disk. +.TP +.B \-S directory +Use the specified directory with ASN.1 skeleton files. +.TP +.B \-R +Restrict the compiler to generate only the ASN.1 tables, +omitting the usual support code. +.SH LANGUAGE OPTIONS +.TP +.B \-ftypes88 +Use only ASN.1:1988 embedded types. +.TP +.B \-fnative-integers +Use native machine's integer types whenever possible, +instead of the complex ASN.1 INTEGER and ENUMERATED types. +.TP +.B \-fno-c99 +Disable use of certain C99 extensions, like designated initializers. +.TP +.B \-funnamed-unions +Enable unnamed unions in structures definitions. +.SH WARNING OPTIONS +.TP +.B \-Werror +Treat warnings as errors; abort if any warning is produced. +.TP +.B \-Wdebug-lexer +Enable lexer debugging during the ASN.1 parsing stage. +.TP +.B \-Wdebug-fixer +Enable ASN.1 syntax tree fixer debugging during the fixing stage. +.TP +.B \-Wdebug-compiler +Enable debugging during the actual compile time. +.SH AUTHORS +Lev Walkin diff --git a/asn1c/asn1c.c b/asn1c/asn1c.c new file mode 100644 index 00000000..afedf6bf --- /dev/null +++ b/asn1c/asn1c.c @@ -0,0 +1,267 @@ +/* + * This is the program that connects the libasn1* libraries together. + * It uses them in turn to parse, fix and then compile or print the ASN.1 tree. + */ +#include +#include +#include +#include +#include /* for stat(2) */ +#include +#include /* for basename(3) */ +#include /* for EX_USAGE */ +#include +#include + +#include /* Parse the ASN.1 file and build a tree */ +#include /* Fix the ASN.1 tree */ +#include /* Print the ASN.1 tree */ +#include /* Compile the ASN.1 tree */ + +static void usage(char *av0); /* Print the Usage screen and exit(EX_USAGE) */ + +int +main(int ac, char **av) { + enum asn1p_flags asn1_parser_flags = A1P_NOFLAGS; + enum asn1f_flags asn1_fixer_flags = A1F_NOFLAGS; + enum asn1c_flags asn1_compiler_flags = A1C_NOFLAGS; + int print_arg__print_out = 0; /* Don't compile, just print parsed */ + int print_arg__fix_n_print = 0; /* Fix and print */ + enum asn1print_flags_e print_arg__flags = APF_NOFLAGS; + int warnings_as_errors = 0; /* Treat warnings as errors */ + char *skeletons_dir = NULL; /* Directory with supplementary stuff */ + asn1p_t *asn = 0; /* An ASN.1 parsed tree */ + int ret; /* Return value from misc functions */ + int ch; /* Command line character */ + int i; /* Index in some loops */ + + /* + * Process command-line options. + */ + while((ch = getopt(ac, av, "EFf:LNPRS:W:")) != -1) + switch(ch) { + case 'E': + print_arg__print_out = 1; + break; + case 'F': + print_arg__fix_n_print = 1; + break; + case 'f': + if(strcmp(optarg, "types88") == 0) { + asn1_parser_flags |= A1P_TYPES_RESTRICT_TO_1988; + } else if(strcmp(optarg, "constr90") == 0) { + asn1_parser_flags |= A1P_CONSTRUCTS_RESTRICT_TO_1990; + } else if(strcmp(optarg, "native-integers") == 0) { + asn1_compiler_flags |= A1C_USE_NATIVE_INTEGERS; + } else if(strcmp(optarg, "no-c99") == 0) { + asn1_compiler_flags |= A1C_NO_C99; + } else if(strcmp(optarg, "unnamed-unions") == 0) { + asn1_compiler_flags |= A1C_UNNAMED_UNIONS; + } else { + fprintf(stderr, "-f%s: Invalid argument\n", optarg); + exit(EX_USAGE); + } + break; + case 'L': + print_arg__flags = APF_LINE_COMMENTS; + break; + case 'N': + print_arg__flags = APF_NO_SOURCE_COMMENTS; + break; + case 'P': + asn1_compiler_flags |= A1C_PRINT_COMPILED; + break; + case 'R': + asn1_compiler_flags |= A1C_OMIT_SUPPORT_CODE; + break; + case 'S': + skeletons_dir = optarg; + break; + case 'W': + if(strcmp(optarg, "error") == 0) { + warnings_as_errors = 1; + break; + } else if(strcmp(optarg, "debug-lexer") == 0) { + asn1_parser_flags |= A1P_LEXER_DEBUG; + break; + } else if(strcmp(optarg, "debug-fixer") == 0) { + asn1_fixer_flags |= A1F_DEBUG; + break; + } else if(strcmp(optarg, "debug-compiler") == 0) { + asn1_compiler_flags |= A1C_DEBUG; + break; + } else { + fprintf(stderr, "-W%s: Invalid argument\n", optarg); + exit(EX_USAGE); + } + break; + default: + usage(av[0]); + } + + /* + * Validate the options combination. + */ + if(!print_arg__print_out) { + if(print_arg__fix_n_print) { + fprintf(stderr, "Error: -F requires -E\n"); + exit(EX_USAGE); + } + } + + /* + * Ensure that there are some input files present. + */ + if(ac > optind) { + ac -= optind; + av += optind; + } else { + fprintf(stderr, "%s: No input files specified\n", + basename(av[0])); + exit(1); + } + + /* + * Iterate over input files and parse each. + * All syntax trees from all files will be bundled together. + */ + for(i = 0; i < ac; i++) { + asn1p_t *new_asn; + + new_asn = asn1p_parse_file(av[i], asn1_parser_flags); + if(new_asn == NULL) { + fprintf(stderr, "Cannot parse \"%s\"\n", av[i]); + exit(EX_DATAERR); + } + + /* + * Bundle the parsed tree with existing one. + */ + if(asn) { + asn1p_module_t *mod; + while((mod = TQ_REMOVE(&(new_asn->modules), mod_next))) + TQ_ADD(&(asn->modules), mod, mod_next); + asn1p_free(new_asn); + } else { + asn = new_asn; + } + + } + + /* + * Dump the parsed ASN.1 tree if -E specified and -F is not given. + */ + if(print_arg__print_out && !print_arg__fix_n_print) { + if(asn1print(asn, print_arg__flags)) + exit(EX_SOFTWARE); + return 0; + } + + + /* + * Process the ASN.1 specification: perform semantic checks, + * expand references, etc, etc. + * This function will emit necessary warnings and error messages. + */ + ret = asn1f_process(asn, asn1_fixer_flags, + NULL /* default fprintf(stderr) */); + switch(ret) { + case 1: + if(!warnings_as_errors) + /* Fall through */ + case 0: + break; /* All clear */ + case -1: + exit(EX_DATAERR); /* Fatal failure */ + } + + /* + * Dump the parsed ASN.1 tree if -E specified and -F is given. + */ + if(print_arg__print_out && print_arg__fix_n_print) { + if(asn1print(asn, print_arg__flags)) + exit(EX_SOFTWARE); + return 0; + } + + /* + * Make sure the skeleton directory is out there. + */ + if(skeletons_dir == NULL) { + struct stat sb; + skeletons_dir = DATADIR; + if((av[-optind][0] == '.' || av[-optind][1] == '/') + && stat(skeletons_dir, &sb)) { + /* + * The default skeletons directory does not exist, + * compute it from my file name: + * ./asn1c/asn1c -> ./skeletons + */ + char *p; + int len; + + p = dirname(av[-optind]); + + len = strlen(p) + sizeof("/../skeletons"); + skeletons_dir = alloca(len); + snprintf(skeletons_dir, len, "%s/../skeletons", p); + if(stat(skeletons_dir, &sb)) { + fprintf(stderr, + "WARNING: skeletons are neither in " + "\"%s\" nor in \"%s\"!\n", + DATADIR, skeletons_dir); + if(warnings_as_errors) + exit(EX_SOFTWARE); + } + } + } + + /* + * Compile the ASN.1 tree into a set of source files + * of another language. + */ + if(asn1_compile(asn, skeletons_dir, asn1_compiler_flags)) { + exit(EX_SOFTWARE); + } + + return 0; +} + +/* + * Print the usage screen and exit(EX_USAGE). + */ +static void +usage(char *av0) { + fprintf(stderr, + "ASN.1 Compiler, v" VERSION "\n" + "Copyright (c) 2003, 2004 Lev Walkin \n" + "Usage: %s [options] ...\n" + "Where [options] are:\n" + "\t-E\tRun only the ASN.1 parser and print out the tree\n" + "\t-F\tDuring -E operation, also perform tree fixing\n" + "\t-L\tGenerate \"-- #line\" comments in -E output\n" + "\t-N\tDo not generate certain type of comments in -E output\n" + "\n" + "\t-P \tConcatenate and print the compiled text\n" + "\t-S \tDirectory with support (skeleton?) files\n" + "\t \t(Default is \"%s\")\n" + "\t-R \tRestrict output (tables only, no support code)\n" + "\n" + "\t-ftypes88\tUse only ASN.1:1988 embedded types\n" +/* + "\t-fconstr90\tUse only ASN.1:1990 constructs (not available)\n" +*/ + "\t-fnative-integers\tUse native integers where possible\n" + "\t-fno-c99\tDisable C99 extensions\n" + "\t-funnamed-unions\tEnable unnamed unions in structures\n" + "\n" + "\t-Werror \tTreat warnings as errors; abort if any warning\n" + "\t-Wdebug-lexer\tEnable verbose debugging output from lexer\n" + "\t-Wdebug-fixer\tDebug ASN.1 semantics processor\n" + "\t-Wdebug-compiler\tDebug ASN.1 compiler\n" + , + basename(av0), DATADIR + ); + exit(EX_USAGE); +} + diff --git a/asn1c/check-parsing.sh b/asn1c/check-parsing.sh new file mode 100755 index 00000000..9a7bfde7 --- /dev/null +++ b/asn1c/check-parsing.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +tmpfile=".check-parsing.$$.tmp" + +ec=0 + +for ref in ../tests/*.asn1.-*; do + src=`echo "$ref" | sed -e 's/\.-[a-zA-Z]*$//'` + flags=`echo "$ref" | sed -e 's/.*\.-//'` + echo "Checking $src against $ref" + ./asn1c "-$flags" "$src" > "$tmpfile" || ec=$? + if [ $? = 0 ]; then + diff "$ref" "$tmpfile" || ec=$? + fi + rm -f "$tmpfile" +done + +exit $ec diff --git a/asn1c/tests/Makefile.am b/asn1c/tests/Makefile.am new file mode 100644 index 00000000..91dc54d3 --- /dev/null +++ b/asn1c/tests/Makefile.am @@ -0,0 +1,10 @@ + +check_SCRIPTS = ./check-assembly.sh + +TESTS_ENVIRONMENT= ./check-assembly.sh +TESTS = check-*.c + +EXTRA_DIST = ${check_SCRIPTS} check-*.c + +clean: + for t in test-*; do rm -rf $$t; done diff --git a/asn1c/tests/Makefile.in b/asn1c/tests/Makefile.in new file mode 100644 index 00000000..6689049c --- /dev/null +++ b/asn1c/tests/Makefile.in @@ -0,0 +1,284 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +ADD_CFLAGS = @ADD_CFLAGS@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AWK = @AWK@ +CC = @CC@ +CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@ +CPP = @CPP@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LEX = @LEX@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PATH = @PATH@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +YACC = @YACC@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +check_SCRIPTS = ./check-assembly.sh + +TESTS_ENVIRONMENT = ./check-assembly.sh +TESTS = check-*.c + +EXTRA_DIST = ${check_SCRIPTS} check-*.c +subdir = asn1c/tests +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = README Makefile.am Makefile.in +all: all-am + +.SUFFIXES: + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu asn1c/tests/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: +tags: TAGS +TAGS: + + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + fi + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-TESTS check-am clean clean-generic \ + clean-libtool distclean distclean-generic distclean-libtool \ + distdir dvi dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool uninstall uninstall-am uninstall-info-am + + +clean: + for t in test-*; do rm -rf $$t; done +# 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/asn1c/tests/README b/asn1c/tests/README new file mode 100644 index 00000000..b7fb5605 --- /dev/null +++ b/asn1c/tests/README @@ -0,0 +1,6 @@ + +This is a very funny test automation. The name of the check-*.c file is used +as a pointer to the file in ../..//tests/*-*.asn1. This file is compiled +using the asn1c from above directory. Then, everything is build together +in a temporary directory with a check-*.c used as a testing engine. + diff --git a/asn1c/tests/check-22.c b/asn1c/tests/check-22.c new file mode 100644 index 00000000..c80f9881 --- /dev/null +++ b/asn1c/tests/check-22.c @@ -0,0 +1,141 @@ +#undef NDEBUG +#include +#include +#include +#include +#include + +#include + +uint8_t buf1[] = { + 32 | 16, /* [UNIVERSAL 16], constructed */ + 12, /* L */ + /* INTEGER a */ + ((2 << 6) + 0), /* [0], primitive */ + 2, /* L */ + 150, + 70, + /* b [1] EXPLICIT CHOICE */ + 32 | ((2 << 6) + 1), /* [1] */ + 3, /* L */ + ((2 << 6) + 1), /* [1] */ + 1, + 'i', + /* UTF8String c */ + ((2 << 6) + 2), /* [2], primitive */ + 1, /* L */ + 'x' +}; + +uint8_t buf2[128]; +int buf2_pos; + +static int +buf2_fill(const void *buffer, size_t size, void *app_key) { + if(buf2_pos + size > sizeof(buf2)) + return -1; + + memcpy(buf2 + buf2_pos, buffer, size); + buf2_pos += size; + + return 0; +} + +static void +check(int is_ok, uint8_t *buf, int size, int consumed) { + T1_t t, *tp; + ber_dec_rval_t rval; + der_enc_rval_t erval; + int i; + + tp = memset(&t, 0, sizeof(t)); + + fprintf(stderr, "Buf %p\n", buf); + rval = ber_decode(&asn1_DEF_T1, (void **)&tp, buf, size); + fprintf(stderr, "Returned code %d, consumed %d\n", + (int)rval.code, (int)rval.consumed); + + if(is_ok) { + assert(rval.code == RC_OK); + assert(rval.consumed == consumed); + assert(t.a.size == 2); + assert(t.b.present == b_PR_n); + assert(t.b.choice.n.size == 1); + assert(t.b.choice.n.buf[0] == 'i'); + assert(t.c.size == 1); + assert(t.c.buf[0] == 'x'); + + } else { + if(rval.code == RC_OK) { + assert(t.a.size != 2 + || t.b.present != b_PR_n + || t.b.choice.n.size != 1 + || t.c.size != 1 + ); + } + assert(rval.consumed <= consumed); + return; + } + + fprintf(stderr, "=> Re-creating using DER encoder <=\n"); + + /* + * Try to re-create using DER encoding. + */ + buf2_pos = 0; + erval = der_encode(&asn1_DEF_T1, tp, buf2_fill, 0); + assert(erval.encoded != -1); + if(erval.encoded != sizeof(buf1)) { + printf("%d != %d\n", (int)erval.encoded, (int)sizeof(buf1)); + } + assert(erval.encoded == sizeof(buf1)); + for(i = 0; i < sizeof(buf1); i++) { + if(buf1[i] != buf2[i]) { + fprintf(stderr, "Recreated buffer content mismatch:\n"); + fprintf(stderr, "Byte %d, %x != %x (%d != %d)\n", + i, + buf1[i], buf2[i], + buf1[i], buf2[i] + ); + } + assert(buf1[i] == buf2[i]); + } + + fprintf(stderr, "=== PRINT ===\n"); + asn_fprint(stderr, &asn1_DEF_T1, tp); + fprintf(stderr, "=== EOF ===\n"); +} + +static void +try_corrupt(uint8_t *buf, int size) { + uint8_t *tmp; + int i; + + fprintf(stderr, "\nCorrupting...\n"); + + tmp = alloca(size); + + for(i = 0; i < 1000; i++) { + int loc; + memcpy(tmp, buf, size); + + /* Corrupt random _non-value_ location. */ + do { loc = random() % size; } while(tmp[loc] >= 70); + do { tmp[loc] ^= random(); } while(tmp[loc] == buf[loc]); + + fprintf(stderr, "\nTry %d: corrupting byte %d (%d->%d)\n", + i, loc, buf[loc], tmp[loc]); + + check(0, tmp, size, size); + } +} + +int +main(int ac, char **av) { + + check(1, buf1, sizeof(buf1), sizeof(buf1)); + try_corrupt(buf1, sizeof(buf1)); + check(1, buf1, sizeof(buf1) + 10, sizeof(buf1)); + + return 0; +} diff --git a/asn1c/tests/check-24.c b/asn1c/tests/check-24.c new file mode 100644 index 00000000..b74ca165 --- /dev/null +++ b/asn1c/tests/check-24.c @@ -0,0 +1,94 @@ +#undef NDEBUG +#include +#include +#include +#include +#include + +#include + +uint8_t buf1[] = { + 32 | ((2 << 6) + 5), /* [5], constructed */ + 17, /* L */ + 32 | 16, /* [UNIVERSAL 16], constructed */ + 15, /* L */ + /* INTEGER a */ + 2, /* [UNIVERSAL 2] */ + 2, /* L */ + 150, + 70, + /* INTEGER b */ + ((2 << 6) + 0), /* [0] */ + 1, /* L */ + 123, + /* INTEGER c */ + ((2 << 6) + 1), /* [1] */ + 1, /* L */ + 123, + /* INTEGER d */ + 32 | ((2 << 6) + 5), /* [5], constructed */ + 3, + 2, + 1, /* L */ + 123, +}; + +static void +check(int is_ok, uint8_t *buf, int size, int consumed) { + T_t t, *tp; + ber_dec_rval_t rval; + + tp = memset(&t, 0, sizeof(t)); + + fprintf(stderr, "Buf %p\n", buf); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, buf, size); + fprintf(stderr, "Returned code %d, consumed %d\n", + (int)rval.code, (int)rval.consumed); + + if(is_ok) { + assert(rval.code == RC_OK); + assert(rval.consumed == consumed); + } else { + if(rval.code == RC_OK) { + assert(t.a.size != 2 + || (!t.b || t.b->size != 1) + || (!t.c || t.c->size != 1) + || t.d.size != 1 + ); + } + assert(rval.consumed <= consumed); + } +} + +static void +try_corrupt(uint8_t *buf, int size) { + uint8_t *tmp; + int i; + + fprintf(stderr, "\nCorrupting...\n"); + + tmp = alloca(size); + + for(i = 0; i < 1000; i++) { + int loc; + memcpy(tmp, buf, size); + + /* Corrupt random _non-value_ location. */ + do { loc = random() % size; } while(tmp[loc] >= 70); + do { tmp[loc] ^= random(); } while(tmp[loc] == buf[loc]); + + fprintf(stderr, "\nTry %d: corrupting byte %d (%d->%d)\n", + i, loc, buf[loc], tmp[loc]); + + check(0, tmp, size, size); + } +} + +int +main(int ac, char **av) { + + check(1, buf1, sizeof(buf1), sizeof(buf1)); + try_corrupt(buf1, sizeof(buf1)); + + return 0; +} diff --git a/asn1c/tests/check-25.c b/asn1c/tests/check-25.c new file mode 100644 index 00000000..bd803da3 --- /dev/null +++ b/asn1c/tests/check-25.c @@ -0,0 +1,252 @@ +#undef NDEBUG +#include +#include +#include +#include +#include + +#include + +uint8_t buf1[] = { + 32 | 16, /* [UNIVERSAL 16], constructed */ + 128, /* L */ + /* a INTEGER */ + 2, /* [UNIVERSAL 2] */ + 2, /* L */ + 150, + 70, + /* b BOOLEAN */ + 128 | 2, /* [2] */ + 1, /* L */ + 0xff, + /* c NULL */ + 5, /* [UNIVERSAL 5] */ + 0, /* L */ + /* d ENUMERATED */ + 10, /* [UNIVERSAL 10] */ + 1, /* L */ + 222, + 4, /* [UNIVERSAL 4] */ + 3, /* L */ + 'x', + 'y', + 'z', + /* f OCTET STRING */ + 32 | 4, /* [UNIVERSAL 4], constructed */ + 128, /* L indefinite */ + 4, /* [UNIVERSAL 4], primitive */ + 2, + 'l', + 'o', + 32 | 4, /* [UNIVERSAL 4], recursively constructed */ + 128, + 4, + 1, + 'v', + 4, + 2, + 'e', + '_', + 0, + 0, + 4, /* [UNIVERSAL 4], primitive */ + 2, + 'i', + 't', + 0, + 0, + /* g BIT STRING */ + 3, /* [UNIVERSAL 3], primitive */ + 3, /* L */ + 2, /* Skip 2 bits */ + 147, + 150, /* => 148 */ + /* h BIT STRING */ + 32 | 3, /* [UNIVERSAL 3], constructed */ + 128, /* L indefinite */ + 3, /* [UNIVERSAL 3], primitive */ + 3, /* L */ + 0, /* Skip 0 bits */ + 140, + 141, + 3, /* [UNIVERSAL 3], primitive */ + 2, /* L */ + 1, /* Skip 1 bit */ + 143, /* => 142 */ + 0, /* End of f */ + 0, + 0, /* End of the whole structure */ + 0, + /* Three bytes of planned leftover */ + 111, 222, 223 +}; + +static void +check(int is_ok, uint8_t *buf, int size, int consumed) { + T_t t, *tp; + ber_dec_rval_t rval; + + tp = memset(&t, 0, sizeof(t)); + + fprintf(stderr, "Buf %p (%d)\n", buf, (int)size); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, buf, size); + fprintf(stderr, "Returned code %d, consumed %d, expected %d\n", + (int)rval.code, (int)rval.consumed, (int)consumed); + + if(is_ok) { + assert(rval.code == RC_OK); + assert(rval.consumed == consumed); + + assert(strcmp(t.e->buf, "xyz") == 0); + assert(strcmp(t.f->buf, "love_it") == 0); + + assert(t.g->size == 3); + assert(t.g->buf[0] == 2); + assert(t.g->buf[1] == 147); + assert(t.g->buf[2] == 148); + + printf("%d\n", t.h->buf[3]); + assert(t.h->size == 4); + assert(t.h->buf[0] == 1); + assert(t.h->buf[1] == 140); + assert(t.h->buf[2] == 141); + assert(t.h->buf[3] == 142); + } else { + if(rval.code == RC_OK) { + assert(t.a.size != 2 + || !t.d + || t.d->size != 1 + || !t.e + || t.e->size != 3 + || !t.f + || t.f->size != 7 + || !t.g + || t.g->size != 3 + || !t.h + || t.h->size != 4 + ); + } + fprintf(stderr, "%d %d\n", (int)rval.consumed, (int)consumed); + assert(rval.consumed <= consumed); + } + + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); +} + +static void +try_corrupt(uint8_t *buf, int size, int allow_consume) { + uint8_t *tmp; + int i; + + fprintf(stderr, "\nCorrupting...\n"); + + tmp = alloca(size); + + for(i = 0; i < 1000; i++) { + int loc; + memcpy(tmp, buf, size); + + /* Corrupt random _non-value_ location. */ + do { loc = random() % size; } while( + loc == 44 /* bit skips */ + || loc == 51 /* bit skips */ + || loc == 56 /* bit skips */ + || tmp[loc] >= 70); + do { tmp[loc] = buf[loc] ^ random(); } while( + (tmp[loc] == buf[loc]) + || (buf[loc] == 0 && tmp[loc] == 0x80)); + + fprintf(stderr, "\nTry %d: corrupting byte %d (%d->%d)\n", + i, loc, buf[loc], tmp[loc]); + + check(0, tmp, size, allow_consume); + } +} + +static void +partial_read(uint8_t *buf, int size) { + T_t t, *tp; + ber_dec_rval_t rval; + int i1, i2; + uint8_t *buf1 = alloca(size); + uint8_t *buf2 = alloca(size); + uint8_t *buf3 = alloca(size); + + fprintf(stderr, "\nPartial read sequence...\n"); + + /* + * Divide the space (size) into three blocks in various combinations: + * |<----->i1<----->i2<----->| + * ^ buf ^ buf+size + * Try to read block by block. + */ + for(i1 = 0; i1 < size; i1++) { + for(i2 = i1; i2 < size; i2++) { + uint8_t *chunk1 = buf; + int size1 = i1; + uint8_t *chunk2 = buf + size1; + int size2 = i2 - i1; + uint8_t *chunk3 = buf + size1 + size2; + int size3 = size - size1 - size2; + + fprintf(stderr, "\n%d:{%d, %d, %d}...\n", + size, size1, size2, size3); + + memset(buf1, 0, size); + memset(buf2, 0, size); + memset(buf3, 0, size); + memcpy(buf1, chunk1, size1); + memcpy(buf2, chunk2, size2); + memcpy(buf3, chunk3, size3); + + tp = memset(&t, 0, sizeof(t)); + + fprintf(stderr, "=> Chunk 1 (%d):\n", size1); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, + buf1, size1); + assert(rval.code == RC_WMORE); + assert(rval.consumed <= size1); + if(rval.consumed < size1) { + int leftover = size1 - rval.consumed; + memcpy(buf2, buf1 + rval.consumed, leftover); + memcpy(buf2 + leftover, chunk2, size2); + size2 += leftover; + } + + fprintf(stderr, "=> Chunk 2 (%d):\n", size2); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, + buf2, size2); + assert(rval.code == RC_WMORE); + assert(rval.consumed <= size2); + if(rval.consumed < size2) { + int leftover = size2 - rval.consumed; + memcpy(buf3, buf2 + rval.consumed, leftover); + memcpy(buf3 + leftover, chunk3, size3); + size3 += leftover; + } + + fprintf(stderr, "=> Chunk 3 (%d):\n", size3); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, + buf3, size3); + assert(rval.code == RC_OK); + assert(rval.consumed == size3); + + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); + } + } +} + +int +main(int ac, char **av) { + + /* Check that the full buffer may be decoded normally */ + check(1, buf1, sizeof(buf1), sizeof(buf1) - 3); + + /* Check that some types of buffer corruptions will lead to failure */ + try_corrupt(buf1, sizeof(buf1) - 3, sizeof(buf1) - 3); + + /* Split the buffer in parts and check decoder restartability */ + partial_read(buf1, sizeof(buf1) - 3); + + return 0; +} diff --git a/asn1c/tests/check-30.c b/asn1c/tests/check-30.c new file mode 100644 index 00000000..9e5adf22 --- /dev/null +++ b/asn1c/tests/check-30.c @@ -0,0 +1,116 @@ +#undef NDEBUG +#include +#include +#include +#include +#include + +#include + +uint8_t buf1[] = { + 32 | 17, /* [UNIVERSAL 17], constructed */ + 8, /* L */ + + /* a INTEGER */ + 64 | 3, /* [APPLICATION 3] */ + 1, /* L */ + 96, + + /* b IA5String */ + 22, /* [UNIVERSAL 22] */ + 3, /* L */ + 'x', + 'y', + 'z' +}; + +/* + * This buffer aims at checking the duplication. + */ +uint8_t buf2[] = { + 32 | 17, /* [UNIVERSAL 17], constructed */ + 8, /* L */ + + /* a INTEGER */ + 64 | 3, /* [APPLICATION 3] */ + 1, /* L */ + 96, + + /* a INTEGER _again_ */ + 64 | 3, /* [APPLICATION 3] */ + 1, /* L */ + 97, +}; + +static void +check(int is_ok, uint8_t *buf, int size, int consumed) { + T_t t, *tp; + ber_dec_rval_t rval; + + tp = memset(&t, 0, sizeof(t)); + + fprintf(stderr, "Buf %p\n", buf); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, buf, size); + fprintf(stderr, "Returned code %d, consumed %d\n", + (int)rval.code, (int)rval.consumed); + + if(is_ok) { + assert(rval.code == RC_OK); + assert(rval.consumed == consumed); + + assert(t.a.size == 1); + assert(t.a.buf[0] == 96); + assert(t.b.size == 3); + assert(t.c == 0); + assert(strcmp(t.b.buf, "xyz") == 0); + } else { + if(rval.code == RC_OK) { + assert(t.a.size != 1 + || t.b.size != 3 + || !t.c + ); + } + assert(rval.consumed <= consumed); + } +} + +static void +try_corrupt(uint8_t *buf, int size) { + uint8_t *tmp; + int i; + + fprintf(stderr, "\nCorrupting...\n"); + + tmp = alloca(size); + + for(i = 0; i < 1000; i++) { + int loc; + memcpy(tmp, buf, size); + + /* Corrupt random _non-value_ location. */ + do { loc = random() % size; } while(tmp[loc] >= 70); + do { tmp[loc] = buf[loc] ^ random(); } while( + (tmp[loc] == buf[loc]) + || (buf[loc] == 0 && tmp[loc] == 0x80)); + + fprintf(stderr, "\nTry %d: corrupting byte %d (%d->%d)\n", + i, loc, buf[loc], tmp[loc]); + + check(0, tmp, size, size); + } +} + +int +main(int ac, char **av) { + + fprintf(stderr, "Must succeed:\n"); + check(1, buf1, sizeof(buf1) + 20, sizeof(buf1)); + + fprintf(stderr, "\nMust fail:\n"); + check(0, buf2, sizeof(buf2) + 1, 5); + + fprintf(stderr, "\nPseudo-random buffer corruptions must fail\n"); + try_corrupt(buf1, sizeof(buf1)); + + return 0; +} diff --git a/asn1c/tests/check-31.c b/asn1c/tests/check-31.c new file mode 100644 index 00000000..53a90cba --- /dev/null +++ b/asn1c/tests/check-31.c @@ -0,0 +1,175 @@ +#undef NDEBUG +#include +#include +#include +#include +#include + +#include + +uint8_t buf1[] = { + 32 | 17, /* [UNIVERSAL 17], constructed */ + 128, /* L, indefinite */ + + 32 | 16, /* [UNIVERSAL 16], constructed */ + 6, /* L */ + + /* height INTEGER */ + 2, /* [UNIVERSAL 2] */ + 1, /* L */ + 100, + /* width INTEGER */ + 2, /* [UNIVERSAL 2] */ + 1, /* L */ + 80, + + 32 | 16, /* [UNIVERSAL 16], constructed */ + 6, /* L */ + + /* height INTEGER */ + 2, /* [UNIVERSAL 2] */ + 1, /* L */ + 110, + /* width INTEGER */ + 2, /* [UNIVERSAL 2] */ + 1, /* L */ + 82, + + 0, /* End of forest */ + 0 +}; + +uint8_t buf1_reconstr[] = { + 32 | 17, /* [UNIVERSAL 17], constructed */ + 16, /* L */ + + 32 | 16, /* [UNIVERSAL 16], constructed */ + 6, /* L */ + + /* height INTEGER */ + 2, /* [UNIVERSAL 2] */ + 1, /* L */ + 100, + /* width INTEGER */ + 2, /* [UNIVERSAL 2] */ + 1, /* L */ + 80, + + 32 | 16, /* [UNIVERSAL 16], constructed */ + 6, /* L */ + + /* height INTEGER */ + 2, /* [UNIVERSAL 2] */ + 1, /* L */ + 110, + /* width INTEGER */ + 2, /* [UNIVERSAL 2] */ + 1, /* L */ + 82 + +}; + +int buf_pos; +int bytes_compare(const void *bufferp, size_t size, void *key) { + const uint8_t *buffer = bufferp; + assert(buf_pos + size <= sizeof(buf1_reconstr)); + + fprintf(stderr, " writing %d (%d)\n", (int)size, buf_pos + (int)size); + + for(; size; buf_pos++, size--, buffer++) { + if(buf1_reconstr[buf_pos] != *buffer) { + fprintf(stderr, + "Byte %d is different: %d != %d (%x != %x)\n", + buf_pos, + *buffer, buf1_reconstr[buf_pos], + *buffer, buf1_reconstr[buf_pos] + ); + assert(buf1_reconstr[buf_pos] == *buffer); + } + } + + return 0; +} + +static void +check(int is_ok, uint8_t *buf, int size, int consumed) { + Forest_t t, *tp; + ber_dec_rval_t rval; + + tp = memset(&t, 0, sizeof(t)); + + fprintf(stderr, "Buf %p\n", buf); + rval = ber_decode(&asn1_DEF_Forest, (void **)&tp, buf, size); + fprintf(stderr, "Returned code %d, consumed %d\n", + (int)rval.code, (int)rval.consumed); + + if(is_ok) { + assert(rval.code == RC_OK); + assert(rval.consumed == consumed); + + assert(t.list.count == 2); + assert(t.list.array[0]->height.size == 1); + assert(t.list.array[0]->width.size == 1); + assert(t.list.array[1]->height.size == 1); + assert(t.list.array[1]->width.size == 1); + } else { + if(rval.code == RC_OK) { + assert(t.list.count != 2 + || t.list.array[0]->height.size != 1 + || t.list.array[0]->width.size != 1 + || t.list.array[1]->height.size != 1 + || t.list.array[1]->width.size != 1 + ); + } + assert(rval.consumed <= consumed); + return; + } + + /* + * Try to re-create the buffer. + */ + buf_pos = 0; + der_encode(&asn1_DEF_Forest, &t, + bytes_compare, buf1_reconstr); + assert(buf_pos == sizeof(buf1_reconstr)); + + asn_fprint(stderr, &asn1_DEF_Forest, &t); + + asn1_DEF_Forest.free_struct(&asn1_DEF_Forest, &t, 1); +} + +static void +try_corrupt(uint8_t *buf, int size) { + uint8_t *tmp; + int i; + + fprintf(stderr, "\nCorrupting...\n"); + + tmp = alloca(size); + + for(i = 0; i < 1000; i++) { + int loc; + memcpy(tmp, buf, size); + + /* Corrupt random _non-value_ location. */ + do { loc = random() % size; } while(tmp[loc] >= 70); + do { tmp[loc] = buf[loc] ^ random(); } while( + (tmp[loc] == buf[loc]) + || (buf[loc] == 0 && tmp[loc] == 0x80)); + + fprintf(stderr, "\nTry %d: corrupting byte %d (%d->%d)\n", + i, loc, buf[loc], tmp[loc]); + + check(0, tmp, size, size); + } +} + +int +main(int ac, char **av) { + + check(1, buf1, sizeof(buf1), sizeof(buf1)); + try_corrupt(buf1, sizeof(buf1)); + check(1, buf1, sizeof(buf1) + 20, sizeof(buf1)); + + return 0; +} diff --git a/asn1c/tests/check-32.c b/asn1c/tests/check-32.c new file mode 100644 index 00000000..3cb0fdac --- /dev/null +++ b/asn1c/tests/check-32.c @@ -0,0 +1,21 @@ +#undef NDEBUG +#include +#include +#include +#include +#include + +#include + +int +main(int ac, char **av) { + Programming_t p; + + memset(&p, 0, sizeof(p)); + + /* + * No plans to fill it up: just checking whether it compiles or not. + */ + + return 0; +} diff --git a/asn1c/tests/check-33.c b/asn1c/tests/check-33.c new file mode 100644 index 00000000..14f5377a --- /dev/null +++ b/asn1c/tests/check-33.c @@ -0,0 +1,21 @@ +#undef NDEBUG +#include +#include +#include +#include +#include + +#include + +int +main(int ac, char **av) { + T_t t; + + memset(&t, 0, sizeof(t)); + + /* + * No plans to fill it up: just checking whether it compiles or not. + */ + + return 0; +} diff --git a/asn1c/tests/check-35.c b/asn1c/tests/check-35.c new file mode 100644 index 00000000..6b6c04d6 --- /dev/null +++ b/asn1c/tests/check-35.c @@ -0,0 +1,277 @@ +#undef NDEBUG +#include +#include +#include +#include +#include + +#include + +uint8_t buf1[] = { + 32 | 17, /* [UNIVERSAL 17], constructed */ + 13, /* L */ + + /* b CHOICE { b2 ObjectDescriptor }*/ + 7, /* [UNIVERSAL 7] */ + 1, /* L */ + 'z', + + /* c BOOLEAN */ + 1, /* [UNIVERSAL 1] */ + 0, /* L */ + + /* a NumericString */ + 18, /* [UNIVERSAL 18] */ + 2, /* L */ + 'n', + 's', + + /* d.r-oid RELATIVE-OID */ + 13, /* [UNIVERSAL 13] */ + 2, /* L */ + 85, + 79, + +}; + +uint8_t buf1_reconstr[] = { + 32 | 17, /* [UNIVERSAL 17], constructed */ + 14, /* L */ + + /* c BOOLEAN */ + 1, /* [UNIVERSAL 1] */ + 1, /* L */ + 0, + + /* b CHOICE { b2 ObjectDescriptor }*/ + 7, /* [UNIVERSAL 7] */ + 1, /* L */ + 'z', + + /* d.r-oid RELATIVE-OID */ + 13, /* [UNIVERSAL 1] */ + 2, /* L */ + 85, + 79, + + /* a NumericString */ + 18, /* [UNIVERSAL 18] */ + 2, /* L */ + 'n', + 's' +}; + +uint8_t buf2[] = { + 32 | 17, /* [UNIVERSAL 17], constructed */ + 13, /* L */ + + /* a NumericString */ + 18, /* [UNIVERSAL 18] */ + 2, /* L */ + 'n', + 's', + + /* c BOOLEAN */ + 1, /* [UNIVERSAL 1] */ + 1, /* L */ + 2, /* True */ + + /* b CHOICE { b1 IA5String }*/ + 22, /* [UNIVERSAL 22] */ + 1, /* L */ + 'z', + + /* d.oid RELATIVE-OID */ + 6, /* [UNIVERSAL 6] */ + 1, /* L */ + 81, + +}; + +uint8_t buf2_reconstr[] = { + 32 | 17, /* [UNIVERSAL 17], constructed */ + 13, /* L */ + + /* c BOOLEAN */ + 1, /* [UNIVERSAL 1] */ + 1, /* L */ + 0xff, /* Canonical True */ + + /* d.oid RELATIVE-OID */ + 6, /* [UNIVERSAL 6] */ + 1, /* L */ + 81, + + /* a NumericString */ + 18, /* [UNIVERSAL 18] */ + 2, /* L */ + 'n', + 's', + + /* b CHOICE { b1 IA5String }*/ + 22, /* [UNIVERSAL 22] */ + 1, /* L */ + 'z' +}; + +static void +check(T_t *tp, uint8_t *buf, int size, int consumed) { + ber_dec_rval_t rval; + + tp = memset(tp, 0, sizeof(*tp)); + + fprintf(stderr, "Buf %p (%d)\n", buf, size); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, buf, size); + fprintf(stderr, "Returned code %d, consumed %d\n", + (int)rval.code, (int)rval.consumed); + + assert(rval.code == RC_OK); + assert(rval.consumed == consumed); + + assert(strcmp(tp->a.buf, "ns") == 0); + assert(strcmp(tp->b.choice.b1.buf, "z") == 0 + && strcmp(tp->b.choice.b2.buf, "z") == 0); +} + +int buf_pos; +int buf_size; +uint8_t *buf; + +static int +buf_fill(const void *buffer, size_t size, void *app_key) { + + if(buf_pos + size > buf_size) { + fprintf(stderr, "%d + %d > %d\n", buf_pos, (int)size, buf_size); + return -1; + } + + memcpy(buf + buf_pos, buffer, size); + buf_pos += size; + fprintf(stderr, " written %d (%d)\n", (int)size, buf_pos); + + return 0; +} + +void +compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) { + der_enc_rval_t erval; + int i; + + buf_size = cmp_buf_size + 100; + buf = alloca(buf_size); + buf_pos = 0; + + /* + * Try to re-create using DER encoding. + */ + erval = der_encode(&asn1_DEF_T, tp, buf_fill, 0); + assert(erval.encoded != -1); + if(erval.encoded != cmp_buf_size) { + printf("%d != %d\n", erval.encoded, cmp_buf_size); + } + assert(erval.encoded == cmp_buf_size); + for(i = 0; i < cmp_buf_size; i++) { + if(buf[i] != cmp_buf[i]) { + fprintf(stderr, "Recreated buffer content mismatch:\n"); + fprintf(stderr, "Byte %d, %x != %x (%d != %d)\n", + i, + buf[i], cmp_buf[i], + buf[i], cmp_buf[i] + ); + } + assert(buf[i] == cmp_buf[i]); + } +} + +static void +partial_read(uint8_t *buf, int size) { + T_t t, *tp; + ber_dec_rval_t rval; + int i1, i2; + uint8_t *buf1 = alloca(size); + uint8_t *buf2 = alloca(size); + uint8_t *buf3 = alloca(size); + + fprintf(stderr, "\nPartial read sequence...\n"); + + /* + * Divide the space (size) into three blocks in various combinations: + * |<----->i1<----->i2<----->| + * ^ buf ^ buf+size + * Try to read block by block. + */ + for(i1 = 0; i1 < size; i1++) { + for(i2 = i1; i2 < size; i2++) { + uint8_t *chunk1 = buf; + int size1 = i1; + uint8_t *chunk2 = buf + size1; + int size2 = i2 - i1; + uint8_t *chunk3 = buf + size1 + size2; + int size3 = size - size1 - size2; + + fprintf(stderr, "\n%d:{%d, %d, %d}...\n", + size, size1, size2, size3); + + memset(buf1, 0, size); + memset(buf2, 0, size); + memset(buf3, 0, size); + memcpy(buf1, chunk1, size1); + memcpy(buf2, chunk2, size2); + memcpy(buf3, chunk3, size3); + + tp = memset(&t, 0, sizeof(t)); + + fprintf(stderr, "=> Chunk 1 (%d):\n", size1); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, + buf1, size1); + assert(rval.code == RC_WMORE); + assert(rval.consumed <= size1); + if(rval.consumed < size1) { + int leftover = size1 - rval.consumed; + memcpy(buf2, buf1 + rval.consumed, leftover); + memcpy(buf2 + leftover, chunk2, size2); + size2 += leftover; + } + + fprintf(stderr, "=> Chunk 2 (%d):\n", size2); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, + buf2, size2); + assert(rval.code == RC_WMORE); + assert(rval.consumed <= size2); + if(rval.consumed < size2) { + int leftover = size2 - rval.consumed; + memcpy(buf3, buf2 + rval.consumed, leftover); + memcpy(buf3 + leftover, chunk3, size3); + size3 += leftover; + } + + fprintf(stderr, "=> Chunk 3 (%d):\n", size3); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, + buf3, size3); + assert(rval.code == RC_OK); + assert(rval.consumed == size3); + + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); + } + } +} + +int +main(int ac, char **av) { + T_t t; + + check(&t, buf1, sizeof(buf1) + 10, sizeof(buf1)); + compare(&t, buf1_reconstr, sizeof(buf1_reconstr)); + asn_fprint(stderr, &asn1_DEF_T, &t); + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); + + check(&t, buf2, sizeof(buf2) + 10, sizeof(buf2)); + compare(&t, buf2_reconstr, sizeof(buf2_reconstr)); + asn_fprint(stderr, &asn1_DEF_T, &t); + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); + + /* Split the buffer in parts and check decoder restartability */ + partial_read(buf1, sizeof(buf1)); + + return 0; +} diff --git a/asn1c/tests/check-41.c b/asn1c/tests/check-41.c new file mode 100644 index 00000000..c2238cf5 --- /dev/null +++ b/asn1c/tests/check-41.c @@ -0,0 +1,315 @@ +#undef NDEBUG +#include +#include +#include +#include +#include + +#include + +uint8_t buf0[] = { + 32 | ((2 << 6) + 1), /* [1], constructed */ + 18, + + /* string [0] IMPLICIT UTF8String, */ + (2 << 6), /* [0] */ + 16, /* L */ + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', +}; + +uint8_t buf0_reconstr[] = { + 32 | ((2 << 6) + 1), /* [1], constructed */ + 18, + + /* string [0] IMPLICIT UTF8String, */ + (2 << 6), /* [0] */ + 16, /* L */ + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', +}; + + + +uint8_t buf1[] = { + 32 | (2 << 6), /* [0], constructed */ + 0x80 | 1, /* L */ + 134, + + /* string [0] IMPLICIT UTF8String, */ + (2 << 6), /* [0] */ + 0x80 | 1, /* L */ + 128, + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + + /* alpha [1] IMPLICIT INTEGER OPTIONAL */ + (2 << 6) + 1, /* [1] */ + 1, /* L */ + 75, +}; + +uint8_t buf1_reconstr[] = { + 32 | (2 << 6), /* [0], constructed */ + 0x80 | 1, /* L */ + 134, + + /* string [0] IMPLICIT UTF8String, */ + (2 << 6), /* [0] */ + 0x80 | 1, /* L */ + 128, + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + + /* alpha [1] IMPLICIT INTEGER OPTIONAL */ + (2 << 6) + 1, /* [1] */ + 1, /* L */ + 75, +}; + +uint8_t buf2[] = { + 32 | ((2 << 6) + 1), /* [1], constructed */ + 0x80 | 1, /* L */ + 134, + + /* string [0] IMPLICIT UTF8String, */ + (2 << 6), /* [0] */ + 0x80 | 1, /* L */ + 128, + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + + /* beta [2] IMPLICIT INTEGER OPTIONAL */ + (2 << 6) + 2, /* [2] */ + 1, /* L */ + 75, +}; + +uint8_t buf2_reconstr[] = { + 32 | ((2 << 6) + 1), /* [1], constructed */ + 0x80 | 1, /* L */ + 134, + + /* string [0] IMPLICIT UTF8String, */ + (2 << 6), /* [0] */ + 0x80 | 1, /* L */ + 128, + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', 'z', + + /* beta [2] IMPLICIT INTEGER OPTIONAL */ + (2 << 6) + 2, /* [2] */ + 1, /* L */ + 75, +}; + + + + + +static void +check(T_t *tp, uint8_t *buf, int size, int consumed) { + ber_dec_rval_t rval; + + tp = memset(tp, 0, sizeof(*tp)); + + fprintf(stderr, "Buf %p (%d)\n", buf, size); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, buf, size); + fprintf(stderr, "Returned code %d, consumed %d\n", + (int)rval.code, (int)rval.consumed); + + assert(rval.code == RC_OK); + assert(rval.consumed == consumed); + + /* + assert(tp->string.size == 128); + assert(strncmp(tp->string.buf, "zz") == 0); + assert(strcmp(tp->b.choice.b1.buf, "z") == 0 + && strcmp(tp->b.choice.b2.buf, "z") == 0); + */ +} + +int buf_pos; +int buf_size; +uint8_t *buf; + +static int +buf_fill(const void *buffer, size_t size, void *app_key) { + + if(buf_pos + size > buf_size) { + fprintf(stderr, "%d + %d > %d\n", buf_pos, (int)size, buf_size); + return -1; + } + + memcpy(buf + buf_pos, buffer, size); + buf_pos += size; + fprintf(stderr, " written %d (%d)\n", (int)size, buf_pos); + + return 0; +} + +void +compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) { + der_enc_rval_t erval; + int i; + + buf_size = cmp_buf_size + 100; + buf = alloca(buf_size); + buf_pos = 0; + + /* + * Try to re-create using DER encoding. + */ + erval = der_encode(&asn1_DEF_T, tp, buf_fill, 0); + assert(erval.encoded != -1); + if(erval.encoded != cmp_buf_size) { + printf("%d != %d\n", erval.encoded, cmp_buf_size); + } + assert(erval.encoded == cmp_buf_size); + for(i = 0; i < cmp_buf_size; i++) { + if(buf[i] != cmp_buf[i]) { + fprintf(stderr, "Recreated buffer content mismatch:\n"); + fprintf(stderr, "Byte %d, %x != %x (%d != %d)\n", + i, + buf[i], cmp_buf[i], + buf[i], cmp_buf[i] + ); + } + assert(buf[i] == cmp_buf[i]); + } +} + +static void +partial_read(uint8_t *buf, int size) { + T_t t, *tp; + ber_dec_rval_t rval; + int i1, i2; + uint8_t *buf1 = alloca(size); + uint8_t *buf2 = alloca(size); + uint8_t *buf3 = alloca(size); + + fprintf(stderr, "\nPartial read sequence...\n"); + + /* + * Divide the space (size) into three blocks in various combinations: + * |<----->i1<----->i2<----->| + * ^ buf ^ buf+size + * Try to read block by block. + */ + for(i1 = 0; i1 < size; i1++) { + for(i2 = i1; i2 < size; i2++) { + uint8_t *chunk1 = buf; + int size1 = i1; + uint8_t *chunk2 = buf + size1; + int size2 = i2 - i1; + uint8_t *chunk3 = buf + size1 + size2; + int size3 = size - size1 - size2; + + fprintf(stderr, "\n%d:{%d, %d, %d}...\n", + size, size1, size2, size3); + + memset(buf1, 0, size); + memset(buf2, 0, size); + memset(buf3, 0, size); + memcpy(buf1, chunk1, size1); + memcpy(buf2, chunk2, size2); + memcpy(buf3, chunk3, size3); + + tp = memset(&t, 0, sizeof(t)); + + fprintf(stderr, "=> Chunk 1 (%d):\n", size1); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, + buf1, size1); + assert(rval.code == RC_WMORE); + assert(rval.consumed <= size1); + if(rval.consumed < size1) { + int leftover = size1 - rval.consumed; + memcpy(buf2, buf1 + rval.consumed, leftover); + memcpy(buf2 + leftover, chunk2, size2); + size2 += leftover; + } + + fprintf(stderr, "=> Chunk 2 (%d):\n", size2); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, + buf2, size2); + assert(rval.code == RC_WMORE); + assert(rval.consumed <= size2); + if(rval.consumed < size2) { + int leftover = size2 - rval.consumed; + memcpy(buf3, buf2 + rval.consumed, leftover); + memcpy(buf3 + leftover, chunk3, size3); + size3 += leftover; + } + + fprintf(stderr, "=> Chunk 3 (%d):\n", size3); + rval = ber_decode(&asn1_DEF_T, (void **)&tp, + buf3, size3); + assert(rval.code == RC_OK); + assert(rval.consumed == size3); + + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); + } + } +} + +int +main(int ac, char **av) { + T_t t; + + /* Check exact buf0 */ + check(&t, buf0, sizeof(buf0), sizeof(buf0)); + compare(&t, buf0_reconstr, sizeof(buf0_reconstr)); + asn_fprint(stderr, &asn1_DEF_T, &t); + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); + + /* Check exact buf1 */ + check(&t, buf1, sizeof(buf1), sizeof(buf1)); + compare(&t, buf1_reconstr, sizeof(buf1_reconstr)); + asn_fprint(stderr, &asn1_DEF_T, &t); + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); + + /* Check slightly more than buf1 */ + check(&t, buf1, sizeof(buf1) + 10, sizeof(buf1)); + compare(&t, buf1_reconstr, sizeof(buf1_reconstr)); + asn_fprint(stderr, &asn1_DEF_T, &t); + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); + + /* Check exact buf2 */ + check(&t, buf2, sizeof(buf2), sizeof(buf2)); + compare(&t, buf2_reconstr, sizeof(buf2_reconstr)); + asn_fprint(stderr, &asn1_DEF_T, &t); + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); + + /* Check slightly more than buf2 */ + check(&t, buf2, sizeof(buf2) + 10, sizeof(buf2)); + compare(&t, buf2_reconstr, sizeof(buf2_reconstr)); + asn_fprint(stderr, &asn1_DEF_T, &t); + asn1_DEF_T.free_struct(&asn1_DEF_T, &t, 1); + + /* Split the buffer in parts and check decoder restartability */ + partial_read(buf0, sizeof(buf0)); + + return 0; +} diff --git a/asn1c/tests/check-43.c b/asn1c/tests/check-43.c new file mode 100644 index 00000000..e44218d8 --- /dev/null +++ b/asn1c/tests/check-43.c @@ -0,0 +1,24 @@ +#undef NDEBUG +#include +#include +#include +#include +#include + +#include +#include + +int +main(int ac, char **av) { + Test_structure_1_t ts1; + Sets_t s1; + + memset(&ts1, 0, sizeof(ts1)); + memset(&s1, 0, sizeof(s1)); + + /* + * No plans to fill it up: just checking whether it compiles or not. + */ + + return 0; +} diff --git a/asn1c/tests/check-assembly.sh b/asn1c/tests/check-assembly.sh new file mode 100755 index 00000000..a1756b4d --- /dev/null +++ b/asn1c/tests/check-assembly.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +# +# This script is designed to quickly create lots of files in underlying +# test-* directories, do lots of other magic stuff and exit cleanly. +# + +# Compute the .asn1 spec name by the given file name. +source=$(echo "$1" | sed -e 's/.*\///') +testno=`echo "$source" | cut -f2 -d'-' | cut -f1 -d'.'` + +args=$(echo "$source" | sed -e 's/\.c$//') +testdir=test-${args} + +OFS=$IFS +IFS="." +set $args +shift +IFS=$OFS + +if [ ! -d $testdir ]; then + mkdir $testdir || exit $? +fi +cd $testdir || exit $? +ln -fs ../$source || exit $? +# Compile the corresponding .asn1 spec. +set -x +../../asn1c \ + -S ../../../skeletons \ + -Wdebug-compiler "$@" \ + ../../../tests/${testno}-*.asn1 || exit $? +set +x + +# Create a Makefile for the project. +cat > Makefile <. +# Please send patches to . +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/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. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-unknown ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE}" in + i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + sparc*:NetBSD:*) + echo `uname -p`-unknown-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + 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 + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + case "${HPUX_REV}" in + 11.[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" ;; + esac ;; + esac + fi ;; + esac + if [ "${HP_ARCH}" = "" ]; then + 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 + eval $set_cc_for_build + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + 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 + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in + big) echo mips-unknown-linux-gnu && exit 0 ;; + little) echo mipsel-unknown-linux-gnu && exit 0 ;; + esac + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-pc-linux-gnu\n", argv[1]); +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-pc-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +eval $set_cc_for_build +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 00000000..1910711f --- /dev/null +++ b/config.h.in @@ -0,0 +1,81 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strtoimax' function. */ +#undef HAVE_STRTOIMAX + +/* Define to 1 if you have the `strtoll' function. */ +#undef HAVE_STRTOLL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER + +/* Define to `int64_t' if does not define. */ +#undef intmax_t + +/* Define to `long' if does not define. */ +#undef off_t + +/* Define to `unsigned' if does not define. */ +#undef size_t diff --git a/config.sub b/config.sub new file mode 100755 index 00000000..12ebc787 --- /dev/null +++ b/config.sub @@ -0,0 +1,1410 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-08-13' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipsel | mipsle | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | s390 | s390x \ + | sh | sh[34] | sh[34]eb | shbe | shle \ + | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 \ + | we32k \ + | x86 | xscale \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alphapca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cray2-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \ + | mipsle-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | s390-* | s390x-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ + | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + 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 | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [cjt]90) + basic_machine=${basic_machine}-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-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=t3e-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh3eb | sh4eb) + basic_machine=sh-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 00000000..b7be2110 --- /dev/null +++ b/configure @@ -0,0 +1,6937 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.57. +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be 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+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="libasn1parser/asn1p_y.y" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_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 +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION EXEEXT OBJEXT ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh INSTALL_STRIP_PROGRAM AWK SET_MAKE AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH DEPDIR PATH MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT RANLIB ac_ct_RANLIB CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC am__include am__quote CCDEPMODE LN_S LIBTOOL CONFIGURE_DEPENDS CPP YACC LEX LEXLIB LEX_OUTPUT_ROOT AR ADD_CFLAGS EGREP LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -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 ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking Speeds up one-time builds + --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) + --disable-autoconf disable automatic generation of configure script + --enable-Werror abort compilation after any C compiler warning + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld default=no + +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 + CPPFLAGS 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. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style 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 + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.57. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&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_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + am_backtick='`' + { echo "$as_me:$LINENO: WARNING: ${am_backtick}missing' script is too old or missing" >&5 +echo "$as_me: WARNING: ${am_backtick}missing' script is too old or missing" >&2;} +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Check whether --enable-dependency-tracking or --disable-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 + + + + +rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null + + +# test to see if srcdir already configured +if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# Define the identity of the package. +PACKAGE=asn1c +VERSION=0.8.10 + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. + +# Autoconf 2.50 always computes EXEEXT. However we need to be +# compatible with 2.13, for now. So we always define EXEEXT, but we +# don't compute it. + +# Similar for OBJEXT -- only we only use OBJEXT if the user actually +# requests that it be used. This is a bit dumb. +: ${OBJEXT=o} + + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + + + + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-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; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$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 + + + +# Check whether --enable-shared or --disable-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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_shared=yes +fi; +# Check whether --enable-static or --disable-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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_static=yes +fi; +# Check whether --enable-fast-install or --disable-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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_fast_install=yes +fi; +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + ac_config_commands="$ac_config_commands default-1" + +am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include='#' +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote='"' + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # 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. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type" + + + +# Check whether --with-gnu-ld or --without-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 "$ac_cv_c_compiler_gnu" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${ac_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + ac_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + ac_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$ac_cv_path_LD" +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${ac_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + ac_cv_prog_gnu_ld=yes +else + ac_cv_prog_gnu_ld=no +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$ac_cv_prog_gnu_ld" >&6 + + +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${ac_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + ac_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/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 + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" + break + else + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm +fi +fi + +NM="$ac_cv_path_NM" +echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + + + +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac + +# Check for any special flags to pass to ltconfig. +libtool_flags="--cache-file=$cache_file" +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" +test "$ac_cv_c_compiler_gnu" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" + + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$lt_target" in +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 3024 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + + +esac + + +# Save cache, so that ltconfig can load it +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, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ +|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5 +echo "$as_me: error: libtool configure failed" >&2;} + { (exit 1); exit 1; }; } + +# Reload cache, that may have been modified by ltconfig +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log + + +# Check whether --enable-autoconf or --disable-autoconf was given. +if test "${enable_autoconf+set}" = set; then + enableval="$enable_autoconf" + enable_autoconf=$enableval +else + enable_autoconf=yes + +fi; +# Extract the first word of "autoconf", so it can be a program name with args. +set dummy autoconf; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AUTOCONF+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $AUTOCONF in + [\\/]* | ?:[\\/]*) + ac_cv_path_AUTOCONF="$AUTOCONF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_AUTOCONF="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_AUTOCONF" && ac_cv_path_AUTOCONF="@echo autoconf not available" + ;; +esac +fi +AUTOCONF=$ac_cv_path_AUTOCONF + +if test -n "$AUTOCONF"; then + echo "$as_me:$LINENO: result: $AUTOCONF" >&5 +echo "${ECHO_T}$AUTOCONF" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "autoheader", so it can be a program name with args. +set dummy autoheader; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AUTOHEADER+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $AUTOHEADER in + [\\/]* | ?:[\\/]*) + ac_cv_path_AUTOHEADER="$AUTOHEADER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_AUTOHEADER="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_AUTOHEADER" && ac_cv_path_AUTOHEADER="@echo autoheader not available" + ;; +esac +fi +AUTOHEADER=$ac_cv_path_AUTOHEADER + +if test -n "$AUTOHEADER"; then + echo "$as_me:$LINENO: result: $AUTOHEADER" >&5 +echo "${ECHO_T}$AUTOHEADER" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -z "$AUTOCONF"; then enable_autoconf=no ; fi +if test -z "$AUTOHEADER"; then enable_autoconf=no ; fi +if test x$enable_autoconf = xyes; then + CONFIGURE_DEPENDS="configure.in aclocal.m4" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # 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. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_YACC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + + +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$LEX" && break +done +test -n "$LEX" || LEX="${am_missing_run}flex" + +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + +if test -z "$LEXLIB" +then + echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 +echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 +if test "${ac_cv_lib_fl_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_fl_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_fl_yywrap=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 +if test $ac_cv_lib_fl_yywrap = yes; then + LEXLIB="-lfl" +else + echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 +echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 +if test "${ac_cv_lib_l_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ll $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_l_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_l_yywrap=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 +if test $ac_cv_lib_l_yywrap = yes; then + LEXLIB="-ll" +fi + +fi + +fi + +if test "x$LEX" != "x:"; then + echo "$as_me:$LINENO: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # The minimal lex program is just a single line: %%. But some broken lexes +# (Solaris, I think it was) want two %% lines, so accommodate them. +cat >conftest.l <<_ACEOF +%% +%% +_ACEOF +{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 + (eval $LEX conftest.l) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 +rm -f conftest.l +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c +ac_save_LIBS=$LIBS +LIBS="$LIBS $LEXLIB" +cat >conftest.$ac_ext <<_ACEOF +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_lex_yytext_pointer=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS +rm -f "${LEX_OUTPUT_ROOT}.c" + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +cat >>confdefs.h <<\_ACEOF +#define YYTEXT_POINTER 1 +_ACEOF + +fi + +fi +# Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $AR in + [\\/]* | ?:[\\/]*) + ac_cv_path_AR="$AR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/ucb:/usr/ccs/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_AR" && ac_cv_path_AR="ar" + ;; +esac +fi +AR=$ac_cv_path_AR + +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + +case "$build" in +*cygwin*) + case "$target" in + *mingw*) + CC="$CC -mno-cygwin" + esac ;; +esac + +# Check whether --enable-autoconf or --disable-autoconf was given. +if test "${enable_autoconf+set}" = set; then + enableval="$enable_autoconf" + ADD_CFLAGS="-Werror" +fi; + + +case "$GCC" in + yes) + CFLAGS="$CFLAGS -Wall" + CFLAGS="$CFLAGS -Wshadow" + CFLAGS="$CFLAGS -Wcast-qual" + CFLAGS="$CFLAGS -Wcast-align" + CFLAGS="$CFLAGS -Wmissing-prototypes" + CFLAGS="$CFLAGS -Wmissing-declarations" + CFLAGS="$CFLAGS -Wredundant-decls" + CFLAGS="$CFLAGS -Wnested-externs" + ;; +esac + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in errno.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_off_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_off_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define off_t long +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm *tp; tp->tm_sec; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_struct_tm=time.h +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_struct_tm=sys/time.h +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for intmax_t" >&5 +echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6 +if test "${ac_cv_type_intmax_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((intmax_t *) 0) + return 0; +if (sizeof (intmax_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_intmax_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_intmax_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_intmax_t" >&6 +if test $ac_cv_type_intmax_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define intmax_t int64_t +_ACEOF + +fi + + + + +for ac_func in strtoimax strtoll +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + ac_config_headers="$ac_config_headers config.h" + + + ac_config_files="$ac_config_files libasn1compiler/Makefile skeletons/tests/Makefile libasn1parser/Makefile libasn1print/Makefile asn1c/tests/Makefile libasn1fix/Makefile skeletons/Makefile examples/Makefile tests/Makefile asn1c/Makefile doc/Makefile 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, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be 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+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.57. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.57, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" +ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "libasn1compiler/Makefile" ) CONFIG_FILES="$CONFIG_FILES libasn1compiler/Makefile" ;; + "skeletons/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES skeletons/tests/Makefile" ;; + "libasn1parser/Makefile" ) CONFIG_FILES="$CONFIG_FILES libasn1parser/Makefile" ;; + "libasn1print/Makefile" ) CONFIG_FILES="$CONFIG_FILES libasn1print/Makefile" ;; + "asn1c/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES asn1c/tests/Makefile" ;; + "libasn1fix/Makefile" ) CONFIG_FILES="$CONFIG_FILES libasn1fix/Makefile" ;; + "skeletons/Makefile" ) CONFIG_FILES="$CONFIG_FILES skeletons/Makefile" ;; + "examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "asn1c/Makefile" ) CONFIG_FILES="$CONFIG_FILES asn1c/Makefile" ;; + "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@PATH@,$PATH,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@LN_S@,$LN_S,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@CONFIGURE_DEPENDS@,$CONFIGURE_DEPENDS,;t t +s,@CPP@,$CPP,;t t +s,@YACC@,$YACC,;t t +s,@LEX@,$LEX,;t t +s,@LEXLIB@,$LEXLIB,;t t +s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t +s,@AR@,$AR,;t t +s,@ADD_CFLAGS@,$ADD_CFLAGS,;t t +s,@EGREP@,$EGREP,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@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,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #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. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # 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. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi + # Run the commands associated with the file. + case $ac_file in + config.h ) # update the timestamp +echo timestamp >"./stamp-h1" + ;; + esac +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + default-1 ) +test x"$AMDEP_TRUE" != x"" || +for mf in $CONFIG_FILES; do + case "$mf" in + Makefile) dirpart=.;; + */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; + *) continue;; + esac + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # 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 -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //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=`echo "$file" | sed -e 's|/[^/]*$||'` + $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + + diff --git a/configure.in b/configure.in new file mode 100644 index 00000000..a4ad1b06 --- /dev/null +++ b/configure.in @@ -0,0 +1,95 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(libasn1parser/asn1p_y.y) +AC_CANONICAL_SYSTEM +AC_PREREQ(2.53) +AM_INIT_AUTOMAKE(asn1c, 0.8.10) + +AC_SUBST(PATH) + +AM_MAINTAINER_MODE + +AM_PROG_LIBTOOL + +dnl *** Autoconf support *** +AC_ARG_ENABLE(autoconf, + [ --disable-autoconf disable automatic generation of configure script ], + enable_autoconf=$enableval, enable_autoconf=yes +) +AC_PATH_PROG(AUTOCONF, autoconf, @echo autoconf not available) +AC_PATH_PROG(AUTOHEADER, autoheader, @echo autoheader not available) +if test -z "$AUTOCONF"; then enable_autoconf=no ; fi +if test -z "$AUTOHEADER"; then enable_autoconf=no ; fi +if test x$enable_autoconf = xyes; then + CONFIGURE_DEPENDS="configure.in aclocal.m4" +fi +AC_SUBST(CONFIGURE_DEPENDS) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_YACC +AM_PROG_LEX +AC_PATH_PROG(AR, ar, ar, $PATH:/usr/ucb:/usr/ccs/bin) + +dnl *** Building mingw32 with cygwin compiler *** +case "$build" in +*cygwin*) + case "$target" in + *mingw*) + CC="$CC -mno-cygwin" + esac ;; +esac + +AC_ARG_ENABLE(autoconf, + [ --enable-Werror abort compilation after any C compiler warning], + ADD_CFLAGS="-Werror") +AC_SUBST(ADD_CFLAGS) + +dnl Add these flags if we're using GCC. +case "$GCC" in + yes) + CFLAGS="$CFLAGS -Wall" + CFLAGS="$CFLAGS -Wshadow" + CFLAGS="$CFLAGS -Wcast-qual" + CFLAGS="$CFLAGS -Wcast-align" + CFLAGS="$CFLAGS -Wmissing-prototypes" + CFLAGS="$CFLAGS -Wmissing-declarations" + CFLAGS="$CFLAGS -Wredundant-decls" + CFLAGS="$CFLAGS -Wnested-externs" + ;; +esac + + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(errno.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_BIGENDIAN +AC_TYPE_OFF_T +AC_TYPE_SIZE_T +AC_STRUCT_TM +AC_CHECK_TYPE(intmax_t, int64_t) + +AC_CHECK_FUNCS(strtoimax strtoll) + +AM_CONFIG_HEADER(config.h) + +AC_OUTPUT( \ +libasn1compiler/Makefile \ +skeletons/tests/Makefile \ +libasn1parser/Makefile \ +libasn1print/Makefile \ +asn1c/tests/Makefile \ +libasn1fix/Makefile \ +skeletons/Makefile \ +examples/Makefile \ +tests/Makefile \ +asn1c/Makefile \ +doc/Makefile \ +Makefile \ +) + diff --git a/depcomp b/depcomp new file mode 100755 index 00000000..65899658 --- /dev/null +++ b/depcomp @@ -0,0 +1,411 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi +# `libtool' can also be set to `yes' or `no'. + +depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. This file always lives in the current directory. + # Also, the AIX compiler puts `$object:' at the start of each line; + # $object doesn't have directory information. + stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + outname="$stripped.o" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 AIX compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + + tmpdepfile1="$object.d" + tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` + if test "$libtool" = yes; then + "$@" -Wc,-MD + else + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a space and a tab in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + test -z "$dashmflag" && dashmflag=-M + ( IFS=" " + case " $* " in + *" --mode=compile "*) # this is libtool, let us make it quiet + for arg + do # cycle over the arguments + case "$arg" in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + # X makedepend + ( + shift + cleared=no + for arg in "$@"; do + case $cleared in no) + set ""; shift + cleared=yes + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift;; + -*) + ;; + *) + set fnord "$@" "$arg"; shift;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tail +3 "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 00000000..be8cd82c --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,3 @@ + +EXTRA_DIST = *.pdf +CLEANFILES = *.*~ diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 00000000..656e8774 --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,221 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +ADD_CFLAGS = @ADD_CFLAGS@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AWK = @AWK@ +CC = @CC@ +CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@ +CPP = @CPP@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LEX = @LEX@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PATH = @PATH@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +YACC = @YACC@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +EXTRA_DIST = *.pdf +CLEANFILES = *.*~ +subdir = doc +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = Makefile.am Makefile.in +all: all-am + +.SUFFIXES: + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: +tags: TAGS +TAGS: + + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/doc/asn1c-usage.pdf b/doc/asn1c-usage.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1d0d28def1788d62836475b5f98ca8e6718ef655 GIT binary patch literal 129406 zcma&tQ;@F9wl3;2{;DY3wq4cBwvAr4ZQHhO+qP}nw$7My?{(rtjEl3bzAy5!MMktI z-)u=LFDy#SNXHBy9leSz0I(4-5ZD@60Jyp7rHyS&oy-W>|5;I_7d5wXGIk)K7q!xN zG8Q&Av^6s3NLB$akU4r3_-#pq#9pHk)!#Wtk&JV<4KEUW95S0II5dmgOtL+%n*h~ zaOLVAB*l3PfbSyj8aa)0#ps8|e$$Wz97?*eif`)=1M^wh#C*pcly&R)AV&%Ql0DN> zrOoZu>A6)gtB+~Bab^ZhV`t2^PA}+9l&XA57%)!g^w`}+S~OZqt&!AD??n^!;#opw zTdHs;(Ojag2yNd!J7Z2`8>9bQi+}$9Q@{UI?LS{8Rt~`bU1IuoZJGX8#l6;=bioos z*nUK%$qwGwR{7SJG&_nr%!7*VB8QqB5*+hONc8fq@Z5nNDzvwP7YzkJMfpxU_xw~< zalJ2}O+Rz|mFO*v+$r5D?SX2!vg|m^9qwK=jPs70QYZen|NOfk@B~iO=xt1+G#88B ztrmDZD0h#~W1fDjsFeBE@@l~hBiaO8G%(fn(z0rJQgp z(2AU(VQ9SZYSoY10>3T$d^pqbadh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+} + +# Convert arguments into a hash for quicker search. +for(my $i; $i <= $#ARGV; $i++) { + $modules{$ARGV[$i]} = $ARGV[$i].".asn1"; +} + +# Process incoming stream in search for ASN.1 modules. +while() { + chop; + if($inmodule) { + next if(/^$/); + if(/^\\layout /) { + print O "\n"; + next; + } + if(/^\\begin_inset Quotes/) { + print O '"'; + next; + } + next if(/^\\/); + print O; + if(/^END$/) { + $inmodule = 0; + print O "\n"; + } + } else { + next unless $modules{$_}; + open(O, '> '.$modules{$_}); + print O; + $inmodule = 1; + delete $modules{$_}; + } +} + +# Make sure noone's missing. +die "Modules not found: " . join(", ", keys %modules) . "\n" if keys %modules; diff --git a/examples/crfc2asn1.pl b/examples/crfc2asn1.pl new file mode 100755 index 00000000..20e1f9f7 --- /dev/null +++ b/examples/crfc2asn1.pl @@ -0,0 +1,86 @@ +#!/usr/bin/perl + +# +# $Id$ +# $Author$ +# +# Simple tool that fetches the ASN.1 specifications from the +# given set of RFC files. +# + + +my $inasn = 0; # Are we inside ASN.1 grammar? +my $found = 0; + +if(-t STDIN && $#ARGV == -1) { + print STDERR "Rip ASN.1 specification from RFC file\n"; + print STDERR "Usage: $0 ...\n"; + print STDERR "Usage: | $0\n"; + exit(1); +} + +while(<>) { + # + # Strip RFC page delimiters. + # + next if /^[A-Z].*\[Page [0-9]+\]$/; + next if /^ $/; + next if /^RFC [0-9].*[0-9]+$/; + + if($inasn == 0) { + # + # The least correct way to find the start of ASN + # definition. + # + if(/^[ \t]*END[ \t]*$/) { + print STDERR + "Missed an ASN.1 grammar before line ". $. ."?\n"; + exit(1); + } + + my $rfcid = ''; + $rfcid = $1 . '-' if($ARGV =~ /([a-z0-9]+)/i); + + if(/^[ \t]+([A-Za-z0-9-]+).*DEFINITIONS.*::=/) { + my $fname = $rfcid . $1 . ".asn1"; + open(O, "> $fname") or die "Can't open $fname"; + select(O); + $inasn = 1; + } elsif(/^[ \t]*([A-Za-z0-9-]+).*{.*iso/) { + my $fname = $rfcid . $1 . ".asn1"; + my @a = ($_); + my $i; + for($i = 0; $i < 8; $i++) { + $_ = <>; + push(@a, $_); + if(/DEFINITIONS/) { + $_ = join('', @a); + $inasn = 1; + last; + } + } + next unless $inasn; + open(O, "> $fname") or die "Can't open $fname"; + select(O); + } else { + next; + } + + $found++; + print "\n"; + print "-- \n"; + print "-- Grammar found in $ARGV by $0 at " . $. . "\n"; + print "-- \n"; + print "\n"; + } + + print; + + if(/^[ \t]*END[ \t]*$/) { + select(STDOUT); + close(O); + $inasn = 0; + } +} + +die "No ASN.1 specifications found\n" unless $found; diff --git a/install-sh b/install-sh new file mode 100755 index 00000000..e9de2384 --- /dev/null +++ b/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/libasn1compiler/Makefile.am b/libasn1compiler/Makefile.am new file mode 100644 index 00000000..6b2babdf --- /dev/null +++ b/libasn1compiler/Makefile.am @@ -0,0 +1,28 @@ + +AM_CPPFLAGS = \ + -I${top_srcdir}/libasn1parser \ + -I${top_srcdir}/libasn1fix + +noinst_LTLIBRARIES = libasn1compiler.la + +libasn1compiler_la_LDFLAGS = -all-static +libasn1compiler_la_SOURCES = \ + asn1compiler.c asn1compiler.h \ + asn1c_misc.c asn1c_misc.h \ + asn1c_out.c asn1c_out.h \ + asn1c_lang.c asn1c_lang.h \ + asn1c_save.c asn1c_save.h \ + asn1c_C.c asn1c_C.h \ + asn1c_internal.h + +libasn1compiler_la_LIBADD = \ + ${top_builddir}/libasn1parser/libasn1parser.la \ + ${top_builddir}/libasn1fix/libasn1fix.la + +check_PROGRAMS = check_compiler + +TESTS = ${check_PROGRAMS} + +LDADD = ${noinst_LTLIBRARIES} ${libasn1compiler_la_LIBADD} +DEPENDENCIES = ${LDADD} + diff --git a/libasn1compiler/Makefile.in b/libasn1compiler/Makefile.in new file mode 100644 index 00000000..3869df39 --- /dev/null +++ b/libasn1compiler/Makefile.in @@ -0,0 +1,424 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +ADD_CFLAGS = @ADD_CFLAGS@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AWK = @AWK@ +CC = @CC@ +CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@ +CPP = @CPP@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LEX = @LEX@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PATH = @PATH@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +YACC = @YACC@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +AM_CPPFLAGS = \ + -I${top_srcdir}/libasn1parser \ + -I${top_srcdir}/libasn1fix + + +noinst_LTLIBRARIES = libasn1compiler.la + +libasn1compiler_la_LDFLAGS = -all-static +libasn1compiler_la_SOURCES = \ + asn1compiler.c asn1compiler.h \ + asn1c_misc.c asn1c_misc.h \ + asn1c_out.c asn1c_out.h \ + asn1c_lang.c asn1c_lang.h \ + asn1c_save.c asn1c_save.h \ + asn1c_C.c asn1c_C.h \ + asn1c_internal.h + + +libasn1compiler_la_LIBADD = \ + ${top_builddir}/libasn1parser/libasn1parser.la \ + ${top_builddir}/libasn1fix/libasn1fix.la + + +check_PROGRAMS = check_compiler + +TESTS = ${check_PROGRAMS} + +LDADD = ${noinst_LTLIBRARIES} ${libasn1compiler_la_LIBADD} +DEPENDENCIES = ${LDADD} +subdir = libasn1compiler +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + +libasn1compiler_la_DEPENDENCIES = \ + ${top_builddir}/libasn1parser/libasn1parser.la \ + ${top_builddir}/libasn1fix/libasn1fix.la +am_libasn1compiler_la_OBJECTS = asn1compiler.lo asn1c_misc.lo \ + asn1c_out.lo asn1c_lang.lo asn1c_save.lo asn1c_C.lo +libasn1compiler_la_OBJECTS = $(am_libasn1compiler_la_OBJECTS) +check_PROGRAMS = check_compiler$(EXEEXT) +check_compiler_SOURCES = check_compiler.c +check_compiler_OBJECTS = check_compiler.$(OBJEXT) +check_compiler_LDADD = $(LDADD) +check_compiler_DEPENDENCIES = libasn1compiler.la \ + ${top_builddir}/libasn1parser/libasn1parser.la \ + ${top_builddir}/libasn1fix/libasn1fix.la +check_compiler_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/asn1c_C.Plo $(DEPDIR)/asn1c_lang.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1c_misc.Plo $(DEPDIR)/asn1c_out.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1c_save.Plo $(DEPDIR)/asn1compiler.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/check_compiler.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(libasn1compiler_la_SOURCES) check_compiler.c +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(libasn1compiler_la_SOURCES) check_compiler.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu libasn1compiler/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) +libasn1compiler.la: $(libasn1compiler_la_OBJECTS) $(libasn1compiler_la_DEPENDENCIES) + $(LINK) $(libasn1compiler_la_LDFLAGS) $(libasn1compiler_la_OBJECTS) $(libasn1compiler_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +check_compiler$(EXEEXT): $(check_compiler_OBJECTS) $(check_compiler_DEPENDENCIES) + @rm -f check_compiler$(EXEEXT) + $(LINK) $(check_compiler_LDFLAGS) $(check_compiler_OBJECTS) $(check_compiler_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1c_C.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1c_lang.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1c_misc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1c_out.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1c_save.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1compiler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/check_compiler.Po@am__quote@ + +distclean-depend: + -rm -rf $(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` + +.c.lo: +@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< +CCDEPMODE = @CCDEPMODE@ +uninstall-info-am: + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + fi + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +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-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +uninstall-am: uninstall-info-am + +.PHONY: GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES distclean distclean-compile \ + distclean-depend distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + tags uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c new file mode 100644 index 00000000..8ec476c6 --- /dev/null +++ b/libasn1compiler/asn1c_C.c @@ -0,0 +1,2021 @@ +/* + * Don't look into this file. First, because it's a mess, and second, because + * it's a brain of the compiler, and you don't wanna mess with brains do you? ;) + */ +#include "asn1c_internal.h" +#include "asn1c_C.h" +#include /* exportable stuff from libasn1fix */ + +static int asn1c_lang_C_type_SEQUENCE_def(arg_t *arg); +static int asn1c_lang_C_type_SET_def(arg_t *arg); +static int asn1c_lang_C_type_CHOICE_def(arg_t *arg); +static int asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of); +static int _print_tag(arg_t *arg, asn1p_expr_t *expr, struct asn1p_type_tag_s *tag_p); +static int emit_constraint_checking_code(arg_t *arg); +static int emit_single_constraint_check(arg_t *arg, asn1p_constraint_t *ct, int mode); +static int emit_alphabet_tables(arg_t *arg, asn1p_constraint_t *ct, int *table); +static int emit_alphabet_check_cycle(arg_t *arg); +static int check_constraint_type_presence(asn1p_constraint_t *ct, enum asn1p_constraint_type_e type); +static asn1p_expr_type_e _find_terminal_type(arg_t *arg); +static int emit_value_determination_code(arg_t *arg); +static int emit_size_determination_code(arg_t *arg); +static long compute_min_size(arg_t *arg); +static long compute_max_size(arg_t *arg); +static long compute_xxx_size(arg_t *arg, int _max); + +typedef struct tag2el_s { + struct asn1p_type_tag_s el_tag; + int el_no; + asn1p_expr_t *from_expr; +} tag2el_t; + +static int _fill_tag2el_map(arg_t *arg, tag2el_t **tag2el, int *count, int el_no); +static int _add_tag2el_member(arg_t *arg, tag2el_t **tag2el, int *count, int el_no); + +#define C99_MODE (arg->flags & A1C_NO_C99) +#define UNNAMED_UNIONS (arg->flags & A1C_UNNAMED_UNIONS) + +#define PCTX_DEF INDENTED( \ + OUT("\n"); \ + OUT("/* Context for parsing across buffer boundaries */\n"); \ + OUT("ber_dec_ctx_t _ber_dec_ctx;\n")); + +#define DEPENDENCIES do { \ + int saved_target = arg->target->target; \ + int saved_indent = arg->indent_level; \ + int comment_printed = 0; \ + REDIR(OT_DEPS); \ + arg->indent_level = 0; \ + TQ_FOR(v, &(expr->members), next) { \ + if((!(v->expr_type & ASN_CONSTR_MASK) \ + && v->expr_type > ASN_CONSTR_MASK) \ + || v->meta_type == AMT_TYPEREF) { \ + if(!comment_printed++) \ + OUT("/* Dependencies for %s */\n", \ + asn1c_type_name(arg, expr, TNF_UNMODIFIED)); \ + OUT("#include <%s.h>\n", \ + asn1c_type_name(arg, v, TNF_INCLUDE)); \ + } \ + } \ + if(expr->expr_type == ASN_CONSTR_SET_OF) \ + OUT("#include \n"); \ + if(expr->expr_type == ASN_CONSTR_SEQUENCE_OF) \ + OUT("#include \n"); \ + OUT("\n"); \ + REDIR(saved_target); \ + INDENT(saved_indent); \ + } while(0) + +#define MKID(id) asn1c_make_identifier(0, (id), 0) + +int +asn1c_lang_C_type_ENUMERATED(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + + REDIR(OT_DEPS); + + OUT("typedef enum %s {\n", MKID(expr->Identifier)); + TQ_FOR(v, &(expr->members), next) { + switch(v->expr_type) { + case A1TC_UNIVERVAL: + OUT("\t%s\t= %lld,\n", + asn1c_make_identifier(0, + expr->Identifier, + v->Identifier, 0), + v->value->value.v_integer); + break; + case A1TC_EXTENSIBLE: + OUT("\t/*\n"); + OUT("\t * Enumeration is extensible\n"); + OUT("\t */\n"); + break; + default: + return -1; + } + } + OUT("} %s_e;\n", MKID(expr->Identifier)); + + return asn1c_lang_C_type_SIMPLE_TYPE(arg); +} + + +int +asn1c_lang_C_type_INTEGER(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + + REDIR(OT_DEPS); + + if(TQ_FIRST(&(expr->members))) { + OUT("typedef enum %s {\n", MKID(expr->Identifier)); + TQ_FOR(v, &(expr->members), next) { + switch(v->expr_type) { + case A1TC_UNIVERVAL: + OUT("\t%s\t= %lld,\n", + asn1c_make_identifier(0, + expr->Identifier, + v->Identifier, 0), + v->value->value.v_integer); + break; + default: + return -1; + } + } + OUT("} %s_e;\n", MKID(expr->Identifier)); + } + + return asn1c_lang_C_type_SIMPLE_TYPE(arg); +} + +int +asn1c_lang_C_type_SEQUENCE(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + int comp_mode = 0; /* {root,ext=1,root,root,...} */ + + DEPENDENCIES; + + if(arg->embed) { + OUT("struct %s {\n", + MKID(expr->Identifier)); + } else { + OUT("typedef struct %s {\n", + MKID(expr->Identifier)); + } + + TQ_FOR(v, &(expr->members), next) { + if(v->expr_type == A1TC_EXTENSIBLE) { + if(comp_mode < 3) comp_mode++; + } + if(comp_mode == 1 && !v->marker) + v->marker = EM_OPTIONAL; + EMBED(v); + } + + PCTX_DEF; + OUT("} %s%s", expr->marker?"*":"", + MKID(expr->Identifier)); + if(arg->embed) OUT(";\n"); else OUT("_t;\n"); + + return asn1c_lang_C_type_SEQUENCE_def(arg); +} + +static int +asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + int elements; /* Number of elements */ + int tags_impl_skip = 0; + int comp_mode = 0; /* {root,ext=1,root,root,...} */ + int ext_start = -1; + int ext_stop = -1; + char *p; + + REDIR(OT_STAT_DEFS); + + OUT("#include \n"); + OUT("\n"); + + /* + * Print out the table according to which the parsing is performed. + */ + p = MKID(expr->Identifier); + OUT("static asn1_SEQUENCE_element_t asn1_DEF_%s_elements[] = {\n", p); + + elements = 0; + INDENTED(TQ_FOR(v, &(expr->members), next) { + if(v->expr_type == A1TC_EXTENSIBLE) { + if((++comp_mode) == 1) + ext_start = elements - 1; + else + ext_stop = elements - 1; + continue; + } + OUT("{ "); + elements++; + OUT("offsetof(struct %s, ", MKID(expr->Identifier)); + OUT("%s), ", MKID(v->Identifier)); + if(v->marker) { + asn1p_expr_t *tv; + int opts = 0; + for(tv = v; tv && tv->marker; + tv = TQ_NEXT(tv, next), opts++) { + if(tv->expr_type == A1TC_EXTENSIBLE) + opts--; + } + OUT("%d,", opts); + } else { + OUT("0,"); + } + OUT("\n"); + INDENT(+1); + if(C99_MODE) OUT(".tag = "); + _print_tag(arg, v, NULL); + OUT(",\n"); + if(C99_MODE) OUT(".tag_mode = "); + if(v->tag.tag_class) { + if(v->tag.tag_mode == TM_IMPLICIT) + OUT("-1,\t/* IMPLICIT tag at current level */\n"); + else + OUT("+1,\t/* EXPLICIT tag at current level */\n"); + } else { + OUT("0,\n"); + } + if(C99_MODE) OUT(".type = "); + OUT("(void *)&asn1_DEF_%s,\n", + asn1c_type_name(arg, v, TNF_SAFE)); + if(C99_MODE) OUT(".name = "); + OUT("\"%s\"\n", v->Identifier); + OUT("},\n"); + INDENT(-1); + }); + OUT("};\n"); + + p = MKID(expr->Identifier); + OUT("static ber_tlv_tag_t asn1_DEF_%s_tags[] = {\n", p); + INDENTED( + if(expr->tag.tag_class) { + _print_tag(arg, expr, &expr->tag); + if(expr->tag.tag_mode != TM_EXPLICIT) + tags_impl_skip++; + } + if(!expr->tag.tag_class + || (expr->meta_type == AMT_TYPE + && expr->tag.tag_mode == TM_EXPLICIT)) { + struct asn1p_type_tag_s tag; + if(expr->tag.tag_class) + OUT(",\n"); + tag.tag_class = TC_UNIVERSAL; + tag.tag_mode = TM_IMPLICIT; + tag.tag_value = expr_type2uclass_value[expr->expr_type]; + _print_tag(arg, expr, &tag); + } + OUT("\n"); + ); + OUT("};\n"); + + OUT("static asn1_SEQUENCE_specifics_t asn1_DEF_%s_specs = {\n", p); + INDENTED( + OUT("sizeof(struct %s),\n", p); + OUT("offsetof(struct %s, _ber_dec_ctx),\n", p); + OUT("asn1_DEF_%s_elements,\n", p); + OUT("%d,\t/* Elements count */\n", elements); + OUT("%d,\t/* Start extensions */\n", + ext_start); + OUT("%d\t/* Stop extensions */\n", + (ext_stopIdentifier); + OUT("SEQUENCE_constraint,\n"); + OUT("SEQUENCE_decode_ber,\n"); + OUT("SEQUENCE_encode_der,\n"); + OUT("SEQUENCE_print,\n"); + OUT("SEQUENCE_free,\n"); + OUT("0,\t/* Use generic outmost tag fetcher */\n"); + OUT("asn1_DEF_%s_tags,\n", p); + OUT("sizeof(asn1_DEF_%s_tags)\n", p); + OUT("\t/sizeof(asn1_DEF_%s_tags[0]),\n", p); + OUT("%d,\t/* Tags to skip */\n", tags_impl_skip); + OUT("%d,\t/* Whether CONSTRUCTED */\n", 1); + OUT("&asn1_DEF_%s_specs\t/* Additional specs */\n", p); + ); + OUT("};\n"); + OUT("\n"); + + REDIR(OT_DEPS); + OUT("#include \n"); + OUT("\n"); + if(!arg->embed) + OUT("extern asn1_TYPE_descriptor_t asn1_DEF_%s;\n", p); + REDIR(OT_TYPE_DECLS); + + return 0; +} + +int +asn1c_lang_C_type_SEQUENCE_OF(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + + DEPENDENCIES; + + if(arg->embed) { + OUT("struct %s {\n", MKID(expr->Identifier)); + } else { + OUT("typedef struct %s {\n", MKID(expr->Identifier)); + } + + TQ_FOR(v, &(expr->members), next) { + INDENTED(OUT("A_SEQUENCE_OF(%s) list;\n", + asn1c_type_name(arg, v, TNF_RSAFE))); + } + + PCTX_DEF; + OUT("} %s%s", expr->marker?"*":"", MKID(expr->Identifier)); + if(arg->embed) OUT(";\n"); else OUT("_t;\n"); + + /* + * SET OF/SEQUENCE OF definition, SEQUENCE OF mode. + */ + return asn1c_lang_C_type_SEx_OF_def(arg, 1); +} + +int +asn1c_lang_C_type_SET(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + long mcount; + char *id; + int comp_mode = 0; /* {root,ext=1,root,root,...} */ + + DEPENDENCIES; + + REDIR(OT_DEPS); + + OUT("\n"); + OUT("/*\n"); + OUT(" * Method of determining the components presence\n"); + OUT(" */\n"); + mcount = 0; + OUT("enum %s_PR_e {\n", MKID(expr->Identifier)); + TQ_FOR(v, &(expr->members), next) { + if(v->expr_type == A1TC_EXTENSIBLE) continue; + INDENTED( + id = MKID(expr->Identifier); + OUT("%s_PR_", id); + id = MKID(v->Identifier); + OUT("%s,\t/* Member %s is present */\n", + id, id) + ); + mcount++; + } + OUT("};\n"); + + REDIR(OT_TYPE_DECLS); + + if(arg->embed) { + OUT("struct %s {\n", MKID(expr->Identifier)); + } else { + OUT("typedef struct %s {\n", MKID(expr->Identifier)); + } + + TQ_FOR(v, &(expr->members), next) { + if(v->expr_type == A1TC_EXTENSIBLE) { + if(comp_mode < 3) comp_mode++; + } + if(comp_mode == 1 && !v->marker) + v->marker = EM_OPTIONAL; + EMBED(v); + } + + INDENTED( + id = MKID(expr->Identifier); + OUT("\n"); + OUT("/* Presence bitmask: ASN_SET_ISPRESENT(p%s, %s_PR_x) */\n", + id, id); + OUT("unsigned int _presence_map\n"); + OUT("\t[((%ld+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];\n", mcount); + ); + + PCTX_DEF; + OUT("} %s%s", expr->marker?"*":"", MKID(expr->Identifier)); + if(arg->embed) OUT(";\n"); else OUT("_t;\n"); + + return asn1c_lang_C_type_SET_def(arg); +} + +/* + * Compare tags according to their canonical order. + * Canonical order: [UNIVERSAL] [APPLICATION] [] [PRIVATE] + * As you see, the class is encoded using the two lowest bits. + */ +static arg_t *_ctc_arg; +static int _canonical_tags_cmp(const void *ap, const void *bp) + __attribute__ ((unused)); +static int +_canonical_tags_cmp(const void *ap, const void *bp) { + asn1p_expr_t *a, *b; + struct asn1p_type_tag_s ta, tb; + + (const asn1p_expr_t *)a = *(const asn1p_expr_t * const *)ap; + (const asn1p_expr_t *)b = *(const asn1p_expr_t * const *)bp; + + if(asn1f_fetch_tag(_ctc_arg->asn, _ctc_arg->mod, a, &ta) + || asn1f_fetch_tag(_ctc_arg->asn, _ctc_arg->mod, b, &tb)) + return 0; + + if(ta.tag_class == tb.tag_class) { + if(ta.tag_value == tb.tag_value) + return 0; + else if(ta.tag_value < tb.tag_value) + return -1; + else + return 1; + } else if(ta.tag_class < tb.tag_class) { + return -1; + } else { + return 1; + } +} + +static int +_tag2el_cmp(const void *ap, const void *bp) { + const tag2el_t *a = ap; + const tag2el_t *b = bp; + const struct asn1p_type_tag_s *ta = &a->el_tag; + const struct asn1p_type_tag_s *tb = &b->el_tag; + + if(ta->tag_class == tb->tag_class) { + if(ta->tag_value == tb->tag_value) + return 0; + else if(ta->tag_value < tb->tag_value) + return -1; + else + return 1; + } else if(ta->tag_class < tb->tag_class) { + return -1; + } else { + return 1; + } +} + +static int +asn1c_lang_C_type_SET_def(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + int elements; + int tags_impl_skip = 0; + int comp_mode = 0; /* {root,ext=1,root,root,...} */ + int extensible = 0; + tag2el_t *tag2el = NULL; + int tag2el_count = 0; + char *p; + + /* + * Fetch every inner tag from the tag to elements map. + */ + if(_fill_tag2el_map(arg, &tag2el, &tag2el_count, -1)) { + if(tag2el) free(tag2el); + return -1; + } else { + /* + * Sort the map according to canonical order of their tags. + */ + _ctc_arg = arg; + qsort(tag2el, tag2el_count, sizeof(*tag2el), _tag2el_cmp); + } + + + REDIR(OT_STAT_DEFS); + + OUT("#include \n"); + OUT("\n"); + + /* + * Print out the table according to which the parsing is performed. + */ + p = MKID(expr->Identifier); + OUT("static asn1_SET_element_t asn1_DEF_%s_elements[] = {\n", p); + + elements = 0; + INDENTED(TQ_FOR(v, &(expr->members), next) { + if(v->expr_type != A1TC_EXTENSIBLE) { + if(comp_mode == 1) + v->marker = EM_OPTIONAL; + elements++; + } else { + if(comp_mode < 3) comp_mode++; + continue; + } + OUT("{ "); + p = MKID(expr->Identifier); + OUT("offsetof(struct %s, ", p); + p = MKID(v->Identifier); + OUT("%s), ", p); + if(v->marker) { + OUT("1, /* Optional element */\n"); + } else { + OUT("0,\n"); + } + INDENT(+1); + if(C99_MODE) OUT(".tag = "); + _print_tag(arg, v, NULL); + OUT(",\n"); + if(C99_MODE) OUT(".tag_mode = "); + if(v->tag.tag_class) { + if(v->tag.tag_mode == TM_IMPLICIT) + OUT("-1,\t/* IMPLICIT tag at current level */\n"); + else + OUT("+1,\t/* EXPLICIT tag at current level */\n"); + } else { + OUT("0,\n"); + } + if(C99_MODE) OUT(".type = "); + OUT("(void *)&asn1_DEF_%s,\n", + asn1c_type_name(arg, v, TNF_SAFE)); + if(C99_MODE) OUT(".name = "); + OUT("\"%s\"\n", v->Identifier); + OUT("},\n"); + INDENT(-1); + }); + OUT("};\n"); + + p = MKID(expr->Identifier); + OUT("static ber_tlv_tag_t asn1_DEF_%s_tags[] = {\n", p); + INDENTED( + if(expr->tag.tag_class) { + _print_tag(arg, expr, &expr->tag); + if(expr->tag.tag_mode != TM_EXPLICIT) + tags_impl_skip++; + } + if(!expr->tag.tag_class + || (expr->meta_type == AMT_TYPE + && expr->tag.tag_mode == TM_EXPLICIT)) { + struct asn1p_type_tag_s tag; + if(expr->tag.tag_class) + OUT(",\n"); + tag.tag_class = TC_UNIVERSAL; + tag.tag_mode = TM_IMPLICIT; + tag.tag_value = expr_type2uclass_value[expr->expr_type]; + _print_tag(arg, expr, &tag); + } + OUT("\n"); + ); + OUT("};\n"); + + /* + * Tags to elements map. + */ + p = MKID(expr->Identifier); + OUT("static asn1_SET_tag2member_t asn1_DEF_%s_tag2el[] = {\n", p); + if(tag2el_count) { + int i; + for(i = 0; i < tag2el_count; i++) { + OUT(" { "); + _print_tag(arg, expr, &tag2el[i].el_tag); + OUT(", "); + OUT("%d ", tag2el[i].el_no); + OUT("}, /* %s at %d */\n", + tag2el[i].from_expr->Identifier, + tag2el[i].from_expr->_lineno + ); + } + } + OUT("};\n"); + + /* + * Emit a map of mandatory elements. + */ + OUT("static uint8_t asn1_DEF_%s_mmap", p); + OUT("[(%d + (8 * sizeof(unsigned int)) - 1) / 8]", elements); + OUT(" = {\n", p); + INDENTED( + if(elements) { + int delimit = 0; + int el = 0; + TQ_FOR(v, &(expr->members), next) { + if(v->expr_type == A1TC_EXTENSIBLE) continue; + if(delimit) { + OUT(",\n"); + delimit = 0; + } else if(el) { + OUT(" | "); + } + OUT("(%d << %d)", v->marker?0:1, 7 - (el % 8)); + if(el && (el % 8) == 0) + delimit = 1; + el++; + } + } else { + OUT("0"); + } + ); + OUT("\n"); + OUT("};\n"); + + OUT("static asn1_SET_specifics_t asn1_DEF_%s_specs = {\n", p); + INDENTED( + OUT("sizeof(struct %s),\n", p); + OUT("offsetof(struct %s, _ber_dec_ctx),\n", p); + OUT("offsetof(struct %s, _presence_map),\n", p); + OUT("asn1_DEF_%s_elements,\n", p); + OUT("%d,\t/* Elements count */\n", elements); + OUT("asn1_DEF_%s_tag2el,\n", p); + OUT("%d,\t/* Count of tags in the map */\n", tag2el_count); + OUT("%d,\t/* Whether extensible */\n", extensible); + OUT("(unsigned int *)asn1_DEF_%s_mmap\t/* Mandatory elements map */\n", p); + ); + OUT("};\n"); + OUT("asn1_TYPE_descriptor_t asn1_DEF_%s = {\n", p); + INDENTED( + OUT("\"%s\",\n", expr->Identifier); + OUT("SET_constraint,\n"); + OUT("SET_decode_ber,\n"); + OUT("SET_encode_der,\n"); + OUT("SET_print,\n"); + OUT("SET_free,\n"); + OUT("0,\t/* Use generic outmost tag fetcher */\n"); + OUT("asn1_DEF_%s_tags,\n", p); + OUT("sizeof(asn1_DEF_%s_tags)\n", p); + OUT("\t/sizeof(asn1_DEF_%s_tags[0]),\n", p); + OUT("%d,\t/* Tags to skip */\n", tags_impl_skip); + OUT("%d,\t/* Whether CONSTRUCTED */\n", 1); + OUT("&asn1_DEF_%s_specs\t/* Additional specs */\n", p); + ); + OUT("};\n"); + OUT("\n"); + + REDIR(OT_DEPS); + OUT("#include \n"); + OUT("\n"); + if(!arg->embed) + OUT("extern asn1_TYPE_descriptor_t asn1_DEF_%s;\n", p); + REDIR(OT_TYPE_DECLS); + + return 0; +} + +int +asn1c_lang_C_type_SET_OF(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + + DEPENDENCIES; + + if(arg->embed) { + OUT("struct %s {\n", MKID(expr->Identifier)); + } else { + OUT("typedef struct %s {\n", + MKID(expr->Identifier)); + } + + TQ_FOR(v, &(expr->members), next) { + INDENTED(OUT("A_SET_OF(%s) list;\n", + asn1c_type_name(arg, v, TNF_RSAFE))); + } + + PCTX_DEF; + OUT("} %s%s", expr->marker?"*":"", MKID(expr->Identifier)); + if(arg->embed) OUT(";\n"); else OUT("_t;\n"); + + /* + * SET OF/SEQUENCE OF definition, SET OF mode. + */ + return asn1c_lang_C_type_SEx_OF_def(arg, 0); +} + +static int +asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + int tags_impl_skip = 0; + char *p; + + REDIR(OT_DEPS); + + if(seq_of) { + OUT("#include \n"); + } else { + OUT("#include \n"); + OUT("\n"); + } + + REDIR(OT_STAT_DEFS); + + /* + * Print out the table according to which the parsing is performed. + */ + p = MKID(expr->Identifier); + OUT("static asn1_SET_OF_element_t asn1_DEF_%s_elements[] = {\n", p); + + INDENTED(OUT("{ "); + v = TQ_FIRST(&(expr->members)); + INDENT(+1); + if(C99_MODE) OUT(".tag = "); + _print_tag(arg, v, NULL); + OUT(",\n"); + if(C99_MODE) OUT(".type = "); + OUT("(void *)&asn1_DEF_%s", + asn1c_type_name(arg, v, TNF_SAFE)); + OUT(" "); + OUT("},\n"); + INDENT(-1); + ); + OUT("};\n"); + + p = MKID(expr->Identifier); + OUT("static ber_tlv_tag_t asn1_DEF_%s_tags[] = {\n", p); + INDENTED( + if(expr->tag.tag_class) { + _print_tag(arg, expr, &expr->tag); + if(expr->tag.tag_mode != TM_EXPLICIT) + tags_impl_skip++; + } + if(!expr->tag.tag_class + || (expr->meta_type == AMT_TYPE + && expr->tag.tag_mode == TM_EXPLICIT)) { + struct asn1p_type_tag_s tag; + if(expr->tag.tag_class) + OUT(",\n"); + tag.tag_class = TC_UNIVERSAL; + tag.tag_mode = TM_IMPLICIT; + tag.tag_value = expr_type2uclass_value[expr->expr_type]; + _print_tag(arg, expr, &tag); + } + OUT("\n"); + ); + OUT("};\n"); + + OUT("static asn1_SET_OF_specifics_t asn1_DEF_%s_specs = {\n", p); + INDENTED( + OUT("sizeof(struct %s),\n", p); + OUT("offsetof(struct %s, _ber_dec_ctx),\n", p); + OUT("asn1_DEF_%s_elements\n", p); + ); + OUT("};\n"); + OUT("asn1_TYPE_descriptor_t asn1_DEF_%s = {\n", p); + INDENTED( + OUT("\"%s\",\n", expr->Identifier); + if(seq_of) { + OUT("SEQUENCE_OF_constraint,\n"); + OUT("SEQUENCE_OF_decode_ber,\n"); + OUT("SEQUENCE_OF_encode_der,\n"); + OUT("SEQUENCE_OF_print,\n"); + OUT("SEQUENCE_OF_free,\n"); + } else { + OUT("SET_OF_constraint,\n"); + OUT("SET_OF_decode_ber,\n"); + OUT("SET_OF_encode_der,\n"); + OUT("SET_OF_print,\n"); + OUT("SET_OF_free,\n"); + } + OUT("0,\t/* Use generic outmost tag fetcher */\n"); + OUT("asn1_DEF_%s_tags,\n", p); + OUT("sizeof(asn1_DEF_%s_tags)\n", p); + OUT("\t/sizeof(asn1_DEF_%s_tags[0]),\n", p); + OUT("%d,\t/* Tags to skip */\n", tags_impl_skip); + OUT("%d,\t/* Whether CONSTRUCTED */\n", 1); + OUT("&asn1_DEF_%s_specs\t/* Additional specs */\n", p); + ); + OUT("};\n"); + OUT("\n"); + + REDIR(OT_DEPS); + if(!arg->embed) + OUT("extern asn1_TYPE_descriptor_t asn1_DEF_%s;\n", p); + REDIR(OT_TYPE_DECLS); + + return 0; +} + +int +asn1c_lang_C_type_CHOICE(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + char *p; + + DEPENDENCIES; + + p = MKID(expr->Identifier); + + if(arg->embed) { + OUT("struct %s {\n", p); + } else { + OUT("typedef struct %s {\n", p); + } + + INDENTED( + OUT("enum {\n"); + INDENTED( + OUT("%s_PR_NOTHING,\t" + "/* No components present */\n", p); + TQ_FOR(v, &(expr->members), next) { + if(v->expr_type == A1TC_EXTENSIBLE) continue; + p = MKID(expr->Identifier); + OUT("%s_PR_", p); + p = MKID(v->Identifier); + OUT("%s,\n", p, p); + } + ); + OUT("} present;\n"); + + OUT("union {\n", p); + TQ_FOR(v, &(expr->members), next) { + EMBED(v); + } + if(UNNAMED_UNIONS) OUT("};\n"); + else OUT("} choice;\n"); + ); + + PCTX_DEF; + OUT("} %s%s", expr->marker?"*":"", MKID(expr->Identifier)); + if(arg->embed) OUT(";\n"); else OUT("_t;\n"); + + return asn1c_lang_C_type_CHOICE_def(arg); +} + +static int +asn1c_lang_C_type_CHOICE_def(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + int elements; /* Number of elements */ + int tags_impl_skip = 0; + int comp_mode = 0; /* {root,ext=1,root,root,...} */ + int extensible = 0; + tag2el_t *tag2el = NULL; + int tag2el_count = 0; + char *p; + + /* + * Fetch every inner tag from the tag to elements map. + */ + if(_fill_tag2el_map(arg, &tag2el, &tag2el_count, -1)) { + if(tag2el) free(tag2el); + return -1; + } else { + /* + * Sort the map according to canonical order of their tags. + */ + _ctc_arg = arg; + qsort(tag2el, tag2el_count, sizeof(*tag2el), _tag2el_cmp); + } + + REDIR(OT_STAT_DEFS); + + OUT("#include \n"); + OUT("\n"); + + /* + * Print out the table according to which the parsing is performed. + */ + p = MKID(expr->Identifier); + OUT("static asn1_CHOICE_element_t asn1_DEF_%s_elements[] = {\n", p); + + elements = 0; + INDENTED(TQ_FOR(v, &(expr->members), next) { + if(v->expr_type != A1TC_EXTENSIBLE) { + if(comp_mode == 1) + v->marker = EM_OPTIONAL; + elements++; + } else { + if(comp_mode < 3) comp_mode++; + continue; + } + OUT("{ "); + p = MKID(expr->Identifier); + OUT("offsetof(struct %s, ", p); + p = MKID(v->Identifier); + if(!UNNAMED_UNIONS) OUT("choice."); + OUT("%s), ", p); + if(v->marker) { + OUT("1, /* Optional element */\n"); + } else { + OUT("0,\n"); + } + INDENT(+1); + if(C99_MODE) OUT(".tag = "); + _print_tag(arg, v, NULL); + OUT(",\n"); + if(C99_MODE) OUT(".tag_mode = "); + if(v->tag.tag_class) { + if(v->tag.tag_mode == TM_IMPLICIT) + OUT("-1,\t/* IMPLICIT tag at current level */\n"); + else + OUT("+1,\t/* EXPLICIT tag at current level */\n"); + } else { + OUT("0,\n"); + } + if(C99_MODE) OUT(".type = "); + OUT("(void *)&asn1_DEF_%s,\n", + asn1c_type_name(arg, v, TNF_SAFE)); + if(C99_MODE) OUT(".name = "); + OUT("\"%s\"\n", v->Identifier); + OUT("},\n"); + INDENT(-1); + }); + OUT("};\n"); + + p = MKID(expr->Identifier); + OUT("static ber_tlv_tag_t asn1_DEF_%s_tags[] = {\n", p); + if(arg->embed) { + /* + * Our parent structure has already taken this into account. + */ + } else { + INDENTED( + if(expr->tag.tag_class) { + _print_tag(arg, expr, &expr->tag); + if(expr->tag.tag_mode != TM_EXPLICIT) + tags_impl_skip++; + } + OUT("\n"); + ); + } + OUT("};\n"); + + /* + * Tags to elements map. + */ + p = MKID(expr->Identifier); + OUT("static asn1_CHOICE_tag2member_t asn1_DEF_%s_tag2el[] = {\n", p); + if(tag2el_count) { + int i; + for(i = 0; i < tag2el_count; i++) { + OUT(" { "); + _print_tag(arg, expr, &tag2el[i].el_tag); + OUT(", "); + OUT("%d ", tag2el[i].el_no); + OUT("}, /* %s at %d */\n", + tag2el[i].from_expr->Identifier, + tag2el[i].from_expr->_lineno + ); + } + } + OUT("};\n"); + + OUT("static asn1_CHOICE_specifics_t asn1_DEF_%s_specs = {\n", p); + INDENTED( + OUT("sizeof(struct %s),\n", p); + OUT("offsetof(struct %s, _ber_dec_ctx),\n", p); + OUT("offsetof(struct %s, present),\n", p); + OUT("sizeof(((struct %s *)0)->present),\n", p); + OUT("asn1_DEF_%s_elements,\n", p); + OUT("%d,\t/* Elements count */\n", elements); + OUT("asn1_DEF_%s_tag2el,\n", p); + OUT("%d,\t/* Count of tags in the map */\n", tag2el_count); + OUT("%d\t/* Whether extensible */\n", extensible); + ); + OUT("};\n"); + OUT("asn1_TYPE_descriptor_t asn1_DEF_%s = {\n", p); + INDENTED( + OUT("\"%s\",\n", expr->Identifier); + OUT("CHOICE_constraint,\n"); + OUT("CHOICE_decode_ber,\n"); + OUT("CHOICE_encode_der,\n"); + OUT("CHOICE_print,\n"); + OUT("CHOICE_free,\n"); + OUT("CHOICE_outmost_tag,\n"); + OUT("asn1_DEF_%s_tags,\n", p); + OUT("sizeof(asn1_DEF_%s_tags)\n", p); + OUT("\t/sizeof(asn1_DEF_%s_tags[0]),\n", p); + OUT("%d,\t/* Tags to skip */\n", tags_impl_skip); + OUT("%d,\t/* Whether CONSTRUCTED */\n", 1); + OUT("&asn1_DEF_%s_specs\t/* Additional specs */\n", p); + ); + OUT("};\n"); + OUT("\n"); + + REDIR(OT_DEPS); + if(!arg->embed) + OUT("extern asn1_TYPE_descriptor_t asn1_DEF_%s;\n", p); + REDIR(OT_TYPE_DECLS); + + return 0; +} + +int +asn1c_lang_C_type_REFERENCE(arg_t *arg) { + asn1p_ref_t *ref; + + ref = arg->expr->reference; + if(ref->components[ref->comp_count-1].name[0] == '&') { + asn1p_module_t *mod; + asn1p_expr_t *extract; + arg_t tmp; + int ret; + + extract = asn1f_class_access_ex(arg->asn, arg->mod, arg->expr, + ref, &mod); + if(extract == NULL) + return -1; + + extract = asn1p_expr_clone(extract); + if(extract) { + if(extract->Identifier) + free(extract->Identifier); + extract->Identifier = strdup(arg->expr->Identifier); + if(extract->Identifier == NULL) { + asn1p_expr_free(extract); + return -1; + } + } else { + return -1; + } + + tmp = *arg; + tmp.asn = arg->asn; + tmp.mod = mod; + tmp.expr = extract; + + ret = arg->default_cb(&tmp); + + asn1p_expr_free(extract); + + return ret; + } + + + return asn1c_lang_C_type_SIMPLE_TYPE(arg); +} + +int +asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + int tags_impl_skip = 0; + char *p; + + if(arg->embed) { + REDIR(OT_TYPE_DECLS); + + OUT("%s\t", asn1c_type_name(arg, arg->expr, + expr->marker?TNF_RSAFE:TNF_CTYPE)); + OUT("%s", expr->marker?"*":" "); + OUT("%s;", MKID(expr->Identifier)); + if(expr->marker) OUT("\t/* %s */", + (expr->marker==EM_OPTIONAL)?"OPTIONAL":"DEFAULT"); + OUT("\n"); + return 0; + } + + REDIR(OT_DEPS); + + OUT("#include <%s.h>\n", asn1c_type_name(arg, expr, TNF_INCLUDE)); + + REDIR(OT_TYPE_DECLS); + + OUT("typedef %s\t", asn1c_type_name(arg, arg->expr, TNF_CTYPE)); + OUT("%s", expr->marker?"*":" "); + OUT("%s_t;\n", MKID(expr->Identifier)); + OUT("\n"); + + REDIR(OT_STAT_DEFS); + + p = MKID(expr->Identifier); + OUT("static ber_tlv_tag_t asn1_DEF_%s_tags[] = {\n", p); + INDENTED( + if(expr->tag.tag_class) { + _print_tag(arg, expr, &expr->tag); + if(expr->tag.tag_mode != TM_EXPLICIT) + tags_impl_skip++; + } + if(!expr->tag.tag_class + || (expr->meta_type == AMT_TYPE + && expr->tag.tag_mode == TM_EXPLICIT)) { + struct asn1p_type_tag_s tag; + if(expr->tag.tag_class) + OUT(",\n"); + tag.tag_class = TC_UNIVERSAL; + tag.tag_mode = TM_IMPLICIT; + tag.tag_value = expr_type2uclass_value[expr->expr_type]; + _print_tag(arg, expr, &tag); + } + OUT("\n"); + ); + OUT("};\n"); + + OUT("asn1_TYPE_descriptor_t asn1_DEF_%s = {\n", p); + INDENTED( + OUT("\"%s\",\n", expr->Identifier); + OUT("%s_constraint,\n", p); + OUT("%s_decode_ber,\n", p); + OUT("%s_encode_der,\n", p); + OUT("%s_print,\n", p); + OUT("%s_free,\n", p); + OUT("0,\t/* Use generic outmost tag fetcher */\n"); + OUT("asn1_DEF_%s_tags,\n", p); + OUT("sizeof(asn1_DEF_%s_tags)\n", p); + OUT("\t/sizeof(asn1_DEF_%s_tags[0]),\n", p); + OUT("%d,\t/* Tags to skip */\n", tags_impl_skip); + OUT("-0\t/* Unknown yet */\n"); + ); + OUT("};\n"); + OUT("\n"); + + /* + * Constraint checking. + */ + if(expr->constraints) /* Emit tables with FROM() constraints */ + emit_alphabet_tables(arg, expr->constraints, 0); + p = MKID(expr->Identifier); + OUT("int\n"); + OUT("%s_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,\n", p); + INDENTED( + OUT("\t\tasn_app_consume_bytes_f *app_errlog, void *app_key) {\n"); + OUT("\n"); + if(expr->constraints) { + + emit_constraint_checking_code(arg); + + OUT("/* Check the constraints of the underlying type */\n"); + OUT("return asn1_DEF_%s.check_constraints\n", + asn1c_type_name(arg, expr, TNF_SAFE)); + OUT("\t(td, sptr, app_errlog, app_key);\n"); + } else { + OUT("/* Make the underlying type checker permanent */\n"); + OUT("td->check_constraints = asn1_DEF_%s.check_constraints;\n", + asn1c_type_name(arg, expr, TNF_SAFE)); + OUT("return td->check_constraints\n"); + OUT("\t(td, sptr, app_errlog, app_key);\n"); + } + ); + OUT("}\n"); + OUT("\n"); + + /* + * Emit suicidal functions. + */ + + { + /* + * This function replaces certain fields from the definition + * of a type with the corresponding fields from the basic type + * (from which the current type is inherited). + */ + char *type_name = asn1c_type_name(arg, expr, TNF_SAFE); + OUT("/*\n"); + OUT(" * This type is implemented using %s,\n", type_name); + OUT(" * so adjust the DEF appropriately.\n"); + OUT(" */\n"); + OUT("static void\n"); + OUT("inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {\n"); + INDENT(+1); + OUT("td->ber_decoder = asn1_DEF_%s.ber_decoder;\n", type_name); + OUT("td->der_encoder = asn1_DEF_%s.der_encoder;\n", type_name); + OUT("td->free_struct = asn1_DEF_%s.free_struct;\n", type_name); + OUT("td->print_struct = asn1_DEF_%s.print_struct;\n", type_name); + OUT("td->last_tag_form = asn1_DEF_%s.last_tag_form;\n", type_name); + OUT("td->specifics = asn1_DEF_%s.specifics;\n", type_name); + INDENT(-1); + OUT("}\n"); + OUT("\n"); + } + + p = MKID(expr->Identifier); + OUT("ber_dec_rval_t\n"); + OUT("%s_decode_ber(asn1_TYPE_descriptor_t *td,\n", p); + INDENTED( + OUT("\tvoid **structure, void *bufptr, size_t size, int tag_mode) {\n"); + OUT("inherit_TYPE_descriptor(td);\n"); + OUT("return td->ber_decoder(td, structure,\n"); + OUT("\tbufptr, size, tag_mode);\n"); + ); + OUT("}\n"); + OUT("\n"); + + p = MKID(expr->Identifier); + OUT("der_enc_rval_t\n"); + OUT("%s_encode_der(asn1_TYPE_descriptor_t *td,\n", p); + INDENTED( + OUT("\tvoid *structure, int tag_mode, ber_tlv_tag_t tag,\n"); + OUT("\tasn_app_consume_bytes_f *cb, void *app_key) {\n"); + OUT("inherit_TYPE_descriptor(td);\n"); + OUT("return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);\n"); + ); + OUT("}\n"); + OUT("\n"); + + p = MKID(expr->Identifier); + OUT("int\n"); + OUT("%s_print(asn1_TYPE_descriptor_t *td, const void *struct_ptr,\n", p); + INDENTED( + OUT("\tint ilevel, asn_app_consume_bytes_f *cb, void *app_key) {\n"); + OUT("inherit_TYPE_descriptor(td);\n"); + OUT("return td->print_struct(td, struct_ptr, ilevel, cb, app_key);\n"); + ); + OUT("}\n"); + OUT("\n"); + + p = MKID(expr->Identifier); + OUT("void\n"); + OUT("%s_free(asn1_TYPE_descriptor_t *td,\n", p); + INDENTED( + OUT("\tvoid *struct_ptr, int contents_only) {\n"); + OUT("inherit_TYPE_descriptor(td);\n"); + OUT("td->free_struct(td, struct_ptr, contents_only);\n"); + ); + OUT("}\n"); + OUT("\n"); + + REDIR(OT_FUNC_DECLS); + + p = MKID(expr->Identifier); + OUT("extern asn1_TYPE_descriptor_t asn1_DEF_%s;\n", p); + OUT("asn_constr_check_f %s_constraint;\n", p); + OUT("ber_type_decoder_f %s_decode_ber;\n", p); + OUT("der_type_encoder_f %s_encode_der;\n", p); + OUT("asn_struct_print_f %s_print;\n", p); + OUT("asn_struct_free_f %s_free;\n", p); + + return 0; +} + +int +asn1c_lang_C_type_EXTENSIBLE(arg_t *arg) { + + OUT("/*\n"); + OUT(" * This type is extensible,\n"); + OUT(" * possible extensions are below.\n"); + OUT(" */\n"); + + return 0; +} + +static int +_print_tag(arg_t *arg, asn1p_expr_t *expr, struct asn1p_type_tag_s *tag_p) { + struct asn1p_type_tag_s tag; + + if(tag_p) { + tag = *tag_p; + } else { + if(asn1f_fetch_tag(arg->asn, arg->mod, expr, &tag)) { + OUT("-1 /* Ambiguous tag (CHOICE?) */"); + return 0; + } + } + + OUT("("); + switch(tag.tag_class) { + case TC_UNIVERSAL: OUT("ASN_TAG_CLASS_UNIVERSAL"); break; + case TC_APPLICATION: OUT("ASN_TAG_CLASS_APPLICATION"); break; + case TC_CONTEXT_SPECIFIC: OUT("ASN_TAG_CLASS_CONTEXT"); break; + case TC_PRIVATE: OUT("ASN_TAG_CLASS_PRIVATE"); break; + case TC_NOCLASS: + break; + } + OUT(" | (%lld << 2))", tag.tag_value); + + return 0; +} + +/* + * For constructed types, number of external tags may be greater than + * number of elements in the type because of CHOICE type. + * T ::= SET { -- Three possible tags: + * a INTEGER, -- One tag is here... + * b Choice1 -- ... and two more tags are there. + * } + * Choice1 ::= CHOICE { + * s1 IA5String, + * s2 ObjectDescriptor + * } + */ +static int +_fill_tag2el_map(arg_t *arg, tag2el_t **tag2el, int *count, int el_no) { + asn1p_expr_t *expr = arg->expr; + arg_t tmparg = *arg; + asn1p_expr_t *v; + int element = 0; + + TQ_FOR(v, &(expr->members), next) { + if(v->expr_type == A1TC_EXTENSIBLE) + continue; + + tmparg.expr = v; + + if(_add_tag2el_member(&tmparg, tag2el, count, + (el_no==-1)?element:el_no)) { + return -1; + } + + element++; + } + + return 0; +} + +static int +_add_tag2el_member(arg_t *arg, tag2el_t **tag2el, int *count, int el_no) { + struct asn1p_type_tag_s tag; + int ret; + + assert(el_no >= 0); + + ret = asn1f_fetch_tag(arg->asn, arg->mod, arg->expr, &tag); + if(ret == 0) { + void *p; + p = realloc(*tag2el, sizeof(tag2el_t) * ((*count) + 1)); + if(p) *tag2el = p; + else return -1; + + DEBUG("Found tag for %s: %ld", + arg->expr->Identifier, + (long)tag.tag_value); + + (*tag2el)[*count].el_tag = tag; + (*tag2el)[*count].el_no = el_no; + (*tag2el)[*count].from_expr = arg->expr; + (*count)++; + return 0; + } + + DEBUG("Searching tag in complex expression %s:%x at line %d", + arg->expr->Identifier, + arg->expr->expr_type, + arg->expr->_lineno); + + /* + * Iterate over members of CHOICE type. + */ + if(arg->expr->expr_type == ASN_CONSTR_CHOICE) { + return _fill_tag2el_map(arg, tag2el, count, el_no); + } + + if(arg->expr->expr_type == A1TC_REFERENCE) { + arg_t tmp = *arg; + asn1p_expr_t *expr; + expr = asn1f_lookup_symbol_ex(tmp.asn, &tmp.mod, tmp.expr, + arg->expr->reference); + if(expr) { + tmp.expr = expr; + return _add_tag2el_member(&tmp, tag2el, count, el_no); + } else { + FATAL("Cannot dereference %s at line %d", + arg->expr->Identifier, + arg->expr->_lineno); + return -1; + } + } + + DEBUG("No tag for %s at line %d", + arg->expr->Identifier, + arg->expr->_lineno); + + return -1; +} + +static int +emit_constraint_checking_code(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_type_e etype; + int size_present, value_present; + + if(expr->constraints == NULL) + return 0; /* No constraints defined */ + + etype = _find_terminal_type(arg); + + size_present = check_constraint_type_presence(expr->constraints, + ACT_CT_SIZE); + value_present = check_constraint_type_presence(expr->constraints, + ACT_EL_VALUE); + + if(size_present || value_present) { + OUT("%s_t *st = sptr;\n", MKID(arg->expr->Identifier)); + if(size_present) { + OUT("size_t size;\n"); + OUT("size_t min_size __attribute__ ((unused)) = %ld;\n", + compute_min_size(arg)); + OUT("size_t max_size __attribute__ ((unused)) = %ld;\n", + compute_max_size(arg)); + } + if(value_present) + switch(etype) { + case ASN_BASIC_INTEGER: + case ASN_BASIC_ENUMERATED: + OUT("long value;\n"); + break; + case ASN_BASIC_BOOLEAN: + OUT("int value;\n"); + break; + default: + break; + } + OUT("\n"); + } + + OUT("if(!sptr) {\n"); + INDENT(+1); + OUT("_ASN_ERRLOG(\"%%s: value not given\", td->name);\n"); + OUT("return -1;\n"); + INDENT(-1); + OUT("}\n"); + OUT("\n"); + + if(size_present) + emit_size_determination_code(arg); + if(value_present) + emit_value_determination_code(arg); + + OUT("\n"); + OUT("if(\n"); + emit_single_constraint_check(arg, expr->constraints, 0); + OUT(") {\n"); + INDENTED(OUT("/* Constraint check succeeded */\n")); + OUT("} else {\n"); + INDENT(+1); + OUT("_ASN_ERRLOG(\"%%s: constraint failed\", td->name);\n"); + OUT("return -1;\n"); + INDENT(-1); + OUT("}\n"); + + return 0; +} + +static int +emit_single_constraint_check(arg_t *arg, asn1p_constraint_t *ct, int mode) { + char *s_v; + int el; + + assert(arg && ct); + + switch(ct->type) { + case ACT_INVALID: + assert(ct->type != ACT_INVALID); + OUT("-1 /* Invalid constraint at line %d */\n", ct->_lineno); + break; + case ACT_EL_VALUE: + OUT("("); + if(mode == ACT_CT_SIZE) s_v = "size"; + else s_v = "value"; + OUT("%s", s_v); + if(ct->value->type != ATV_TRUE) + OUT(" == "); + switch(ct->value->type) { + case ATV_INTEGER: OUT("%lld", + (long long)ct->value->value.v_integer); break; + case ATV_MIN: OUT("min_%s", s_v); break; + case ATV_MAX: OUT("max_%s", s_v); break; + case ATV_FALSE: OUT("0"); break; + case ATV_TRUE: break; + default: + break; + } + OUT(")\n"); + break; + case ACT_EL_RANGE: + case ACT_EL_LLRANGE: + case ACT_EL_RLRANGE: + case ACT_EL_ULRANGE: + if(mode == ACT_CT_SIZE) { + s_v = "size"; + } else { + s_v = "value"; + } + OUT("((%s", s_v); + switch(ct->type) { + case ACT_EL_RANGE: + case ACT_EL_RLRANGE: + OUT(" >= "); break; + case ACT_EL_LLRANGE: + case ACT_EL_ULRANGE: + OUT(" > "); break; + default: break; + } + switch(ct->range_start->type) { + case ATV_INTEGER: OUT("%lld", + (long long)ct->range_start->value.v_integer); break; + case ATV_MIN: OUT("min_%s", s_v); break; + case ATV_MAX: OUT("max_%s", s_v); break; + case ATV_FALSE: OUT("0"); break; + case ATV_TRUE: break; + default: + break; + } + OUT(") && (%s", s_v); + switch(ct->type) { + case ACT_EL_RANGE: + case ACT_EL_LLRANGE: + OUT(" <= "); break; + case ACT_EL_RLRANGE: + case ACT_EL_ULRANGE: + OUT(" < "); break; + default: break; + } + switch(ct->range_stop->type) { + case ATV_INTEGER: OUT("%lld", + (long long)ct->range_stop->value.v_integer); break; + case ATV_MIN: OUT("min_%s", s_v); break; + case ATV_MAX: OUT("max_%s", s_v); break; + case ATV_FALSE: OUT("0"); break; + case ATV_TRUE: break; + default: + break; + } + OUT("))\n"); + break; + case ACT_EL_EXT: + OUT("0 /* Extensible (...), but not defined herein */\n"); + break; + case ACT_CT_SIZE: + if(mode) { + OUT("0 /* Invalid constraint at line %d */\n", + ct->_lineno); + return -1; + } + assert(ct->el_count == 1); + return emit_single_constraint_check(arg, + ct->elements[0], ACT_CT_SIZE); + case ACT_CT_FROM: + if(mode) { + OUT("0 /* Invalid constraint at line %d */\n", + ct->_lineno); + return -1; + } + OUT("check_alphabet_%x(sptr)\n", ct); + break; + case ACT_CT_WCOMP: + case ACT_CT_WCOMPS: + OUT("%d /* Unsupported constraint at line %d */\n", + ct->type, ct->_lineno); + return -1; + break; + case ACT_CA_SET: + OUT("(\n"); + INDENT(+1); + for(el = 0; el < ct->el_count; el++) { + if(el) OUT("&& "); + emit_single_constraint_check(arg, + ct->elements[el], mode); + } + INDENT(-1); + OUT(")\n"); + break; + case ACT_CA_CSV: + OUT("(\n"); + INDENT(+1); + for(el = 0; el < ct->el_count; el++) { + if(el) OUT("|| "); + emit_single_constraint_check(arg, + ct->elements[el], mode); + } + INDENT(-1); + OUT(")\n"); + break; + case ACT_CA_UNI: + OUT("(\n"); + INDENT(+1); + for(el = 0; el < ct->el_count; el++) { + if(el) OUT("|| "); + emit_single_constraint_check(arg, + ct->elements[el], mode); + } + INDENT(-1); + OUT(")\n"); + break; + case ACT_CA_INT: + OUT("(\n"); + INDENT(+1); + for(el = 0; el < ct->el_count; el++) { + if(el) OUT("&& "); + emit_single_constraint_check(arg, + ct->elements[el], mode); + } + INDENT(-1); + OUT(")\n"); + break; + case ACT_CA_CRC: + WARNING("Unsupported component relation constraint at line %d", + ct->_lineno); + OUT("%d /* Unsupported component relation constraint " + "at line %d */\n", + ct->type, ct->_lineno); + return -1; + case ACT_CA_EXC: + WARNING("Unsupported EXCEPT constraint at line %d", + ct->_lineno); + OUT("%d /* Unsupported EXCEPT constraint at line %d */\n", + ct->type, ct->_lineno); + return -1; + } + + return 0; +} + +static int +check_constraint_type_presence(asn1p_constraint_t *ct, enum asn1p_constraint_type_e type) { + int el; + + if(ct == NULL) return 0; + + if(ct->type == type) return 1; + + if(type == ACT_EL_VALUE) { + if(ct->type >= ACT_CT_SIZE + && ct->type <= ACT_CT_WCOMPS) + /* Values defined further + * are not really value's values */ + return 0; + if(ct->type > ACT_EL_VALUE && ct->type < ACT_CT_SIZE) + return 1; /* Also values */ + } + + for(el = 0; el < ct->el_count; el++) { + if(check_constraint_type_presence(ct->elements[el], type)) + return 1; + } + + return 0; +} + +static int +emit_alphabet_tables(arg_t *arg, asn1p_constraint_t *ct, int *table) { + int ch = 0; + int ch_start = 0; + int ch_stop = 0; + int el = 0; + + assert(arg && ct); + + switch(ct->type) { + case ACT_INVALID: + break; + case ACT_EL_VALUE: + if(!table) break; + + switch(ct->value->type) { + case ATV_INTEGER: + if(ct->value->value.v_integer < 0 + || ct->value->value.v_integer > 255) { + OUT("\n"); + OUT("#error Value %lld out of range " + "for alphabet character at line %d\n", + (long long)ct->value->value.v_integer, + ct->_lineno); + break; + } else { + ch = ct->value->value.v_integer; + table[ch] = 1; + } + break; + case ATV_STRING: + for(ch = 0; ch < ct->value->value.string.size; ch++) + table[ct->value->value.string.buf[ch]] = 1; + break; + default: + OUT("\n"); + WARNING("Invalid alphabet character specification " + "at line %d", ct->_lineno); + OUT("#error Invalid alphabet character specification " + "at line %d\n", ct->_lineno); + break; + } + break; + case ACT_EL_RANGE: + case ACT_EL_LLRANGE: + case ACT_EL_RLRANGE: + case ACT_EL_ULRANGE: + if(!table) break; + + ch_start = 0; + ch_stop = 255; + + switch(ct->range_start->type) { + case ATV_INTEGER: + ch_start = ct->range_start->value.v_integer; break; + case ATV_MIN: ch_start = 0; break; + case ATV_MAX: ch_start = 255; break; + case ATV_STRING: + if(ct->range_start->value.string.size == 1) { + ch_start = ct->range_start->value.string.buf[0]; + break; + } + /* Fall through */ + default: + OUT("\n"); + FATAL("Invalid alphabet range constraint " + "at line %d\n", ct->_lineno); + OUT("#error Invalid alphabet range constraint " + "at line %d\n", ct->_lineno); + return -1; + } + + switch(ct->range_stop->type) { + case ATV_INTEGER: + ch_stop = ct->range_stop->value.v_integer; break; + case ATV_MIN: ch_stop = 0; break; + case ATV_MAX: ch_stop = 255; break; + case ATV_STRING: + if(ct->range_stop->value.string.size == 1) { + ch_stop = ct->range_stop->value.string.buf[0]; + break; + } + /* Fall through */ + default: + OUT("\n"); + FATAL("Invalid alphabet range constraint " + "at line %d\n", ct->_lineno); + OUT("#error Invalid alphabet range constraint " + "at line %d\n", ct->_lineno); + break; + } + + switch(ct->type) { + case ACT_EL_RANGE: break; + case ACT_EL_RLRANGE: ch_stop--; break; + case ACT_EL_LLRANGE: ch_start++; break; + case ACT_EL_ULRANGE: ch_start++; ch_stop--; break; + default: break; + } + + if(ch_start > ch_stop) { + WARNING("Empty character range " + "alphabet constraint at line %d", ct->_lineno); + OUT("#warning Empty character range " + "alphabet constraint at line %d\n", ct->_lineno); + break; + } + + for(ch = ch_start; ch <= ch_stop; ch++) { + if(ch < 0 || ch > 255) continue; + table[ch] = 1; + } + + break; + case ACT_EL_EXT: + break; + case ACT_CT_SIZE: + break; + case ACT_CT_FROM: + if(table) { + OUT("#error Nested FROM in subtype constraints\n"); + return -1; + } else { + table = alloca(256 * sizeof(table[0])); + memset(table, 0, 256 * sizeof(table[0])); + + for(el = 0; el < ct->el_count; el++) { + emit_alphabet_tables(arg, ct->elements[el], + table); + } + OUT("static int alphabet_table_%x[256] = {\n", ct); + for(ch = 0; ch < 256; ch++) { + OUT("%d,", table[ch]?1:0); + if(!((ch+1) % 16)) { + if(ch) { + int c; + OUT("\t/* "); + for(c = ch - 16; c < ch; c++) { + if(table[c]) { + if(c > 0x20 + && c < 0x80) + OUT("%c", c); + else + OUT(".", c); + } else { + OUT(" "); + } + } + OUT(" */"); + } + OUT("\n"); + } + } + OUT("};\n"); + OUT("static int check_alphabet_%x(void *sptr) {\n", ct); + INDENT(+1); + OUT("int *table = alphabet_table_%x;\n", ct); + emit_alphabet_check_cycle(arg); + OUT("return 1;\n"); + INDENT(-1); + OUT("};\n"); + } + break; + case ACT_CT_WCOMP: + case ACT_CT_WCOMPS: + break; + case ACT_CA_CRC: + break; + case ACT_CA_SET: + case ACT_CA_CSV: + case ACT_CA_UNI: + for(el = 0; el < ct->el_count; el++) + emit_alphabet_tables(arg, ct->elements[el], table); + break; + case ACT_CA_INT: + if(table) { + int table2[256]; + + assert(ct->el_count >= 1); + emit_alphabet_tables(arg, ct->elements[0], table); + for(el = 1; el < ct->el_count; el++) { + memset(table2, 0, sizeof(table2)); + emit_alphabet_tables(arg, + ct->elements[el], table2); + /* Intersection */ + for(ch = 0; ch < 256; ch++) { + if(table2[ch] == 0) + table[ch] = 0; + } + } + } else { + for(el = 0; el < ct->el_count; el++) + emit_alphabet_tables(arg, ct->elements[el], 0); + } + + break; + case ACT_CA_EXC: + OUT("EXC\n"); + if(table) { + int table2[256]; + + assert(ct->el_count >= 1); + emit_alphabet_tables(arg, ct->elements[0], table); + for(el = 1; el < ct->el_count; el++) { + memset(table2, 0, sizeof(table2)); + emit_alphabet_tables(arg, + ct->elements[el], table2); + /* Exclusion */ + for(ch = 0; ch < 256; ch++) { + if(table2[ch]) + table[ch] = 0; + } + } + } else { + for(el = 0; el < ct->el_count; el++) + emit_alphabet_tables(arg, ct->elements[el], 0); + } + break; + } + + return 0; +} + +static int +emit_alphabet_check_cycle(arg_t *arg) { + asn1p_expr_type_e etype; + + etype = _find_terminal_type(arg); + if(!(etype & ASN_STRING_MASK) + && !(etype == ASN_BASIC_OCTET_STRING)) { + OUT("#error Cannot apply FROM constraint to ASN.1 type %s\n", + ASN_EXPR_TYPE2STR(etype)); + return -1; + } + + OUT("/* The underlying type is %s */\n", + ASN_EXPR_TYPE2STR(etype)); + OUT("%s_t *st = sptr;\n", MKID(arg->expr->Identifier)); + + switch(etype) { + case ASN_STRING_UTF8String: + OUT("uint8_t *ch = st->buf;\n"); + OUT("uint8_t *end = ch + st->size;\n"); + OUT("\n"); + OUT("for(; ch < end; ch++) {\n"); + INDENT(+1); + OUT("if(*ch >= 0x80 || !table[*ch]) return 0;\n"); + INDENT(-1); + OUT("}\n"); + break; + case ASN_STRING_UniversalString: + OUT("uint32_t *ch = st->buf;\n"); + OUT("uint32_t *end = ch + st->size;\n"); + OUT("\n"); + OUT("for(; ch < end; ch++) {\n"); + INDENT(+1); + OUT("uint32_t wc = (((uint8_t *)ch)[0] << 24)\n"); + OUT("\t\t| (((uint8_t *)ch)[1] << 16)\n"); + OUT("\t\t| (((uint8_t *)ch)[2] << 8)\n"); + OUT("\t\t| ((uint8_t *)ch)[3]\n"); + OUT("if(wc > 255 || !table[wc]) return 0;\n"); + INDENT(-1); + OUT("}\n"); + OUT("if(ch != end) return 0; /* (size%4)! */\n"); + break; + case ASN_STRING_BMPString: + OUT("uint16_t *ch = st->buf;\n"); + OUT("uint16_t *end = ch + st->size;\n"); + OUT("\n"); + OUT("for(; ch < end; ch++) {\n"); + INDENT(+1); + OUT("uint16_t wc = (((uint8_t *)ch)[0] << 8)\n"); + OUT("\t\t| ((uint8_t *)ch)[1];\n"); + OUT("if(wc > 255 || !table[wc]) return 0;\n"); + INDENT(-1); + OUT("}\n"); + OUT("if(ch != end) return 0; /* (size%2)! */\n"); + break; + case ASN_BASIC_OCTET_STRING: + default: + OUT("uint8_t *ch = st->buf;\n"); + OUT("uint8_t *end = ch + st->size;\n"); + OUT("\n"); + OUT("for(; ch < end; ch++) {\n"); + INDENT(+1); + OUT("if(!table[*ch]) return 0;\n"); + INDENT(-1); + OUT("}\n"); + break; + } + + return 0; +} + +static int +emit_size_determination_code(arg_t *arg) { + asn1p_expr_type_e etype = _find_terminal_type(arg); + + switch(etype) { + case ASN_BASIC_BIT_STRING: + OUT("if(st->size > 0) {\n"); + OUT("\t/* Size in bits */\n"); + OUT("\tsize = (st->size - 1) - (st->buf[0] & 0x7);\n"); + OUT("} else {\n"); + OUT("\tsize = 0;\n"); + OUT("}\n"); + break; + case ASN_STRING_UniversalString: + OUT("size = st->size >> 2;\t/* 4 byte per character */\n"); + break; + case ASN_STRING_BMPString: + OUT("size = st->size >> 1;\t/* 2 byte per character */\n"); + break; + case ASN_STRING_UTF8String: + OUT("size = UTF8String_length(st, td->name, app_errlog, app_key);\n"); + OUT("if(size == (size_t)-1) return -1;\n"); + break; + default: + if((etype & ASN_STRING_MASK) + || etype == ASN_BASIC_OCTET_STRING) { + OUT("size = st->size;\n"); + break; + } else { + WARNING("Size operation is not defined for %s", + ASN_EXPR_TYPE2STR(etype)); + OUT("#warning Size operation not defined!\n"); + OUT("size = st->size;\n"); + } + return -1; + } + + return 0; +} + +static int +emit_value_determination_code(arg_t *arg) { + asn1p_expr_type_e etype = _find_terminal_type(arg); + + switch(etype) { + case ASN_BASIC_INTEGER: + case ASN_BASIC_ENUMERATED: + OUT("if(asn1_INTEGER2long(st, &value)) {\n"); + INDENT(+1); + OUT("_ASN_ERRLOG(\"%%s: value too large\", td->name);\n"); + OUT("return -1;\n"); + INDENT(-1); + OUT("}\n"); + break; + case ASN_BASIC_BOOLEAN: + OUT("value = st->value;\n"); + break; + default: + WARNING("Value cannot be determined " + "for constraint check for %s at line %d\n", + arg->expr->Identifier, arg->expr->_lineno); + OUT("#error Value cannot be determined for %s at %d\n", + arg->expr->Identifier, arg->expr->_lineno); + break; + } + + return 0; +} + +static long compute_min_size(arg_t *arg) { return compute_xxx_size(arg, 0); } +static long compute_max_size(arg_t *arg) { return compute_xxx_size(arg, 1); } + +static long compute_xxx_size(arg_t *arg, int _max) { + asn1p_expr_type_e etype; + long basic_max = 0x7fffffff; + long basic_min = 0x80000000; + long svalue = 0; + + etype = _find_terminal_type(arg); + switch(etype) { + case ASN_BASIC_BIT_STRING: + svalue = _max?basic_max/8:0; + break; + case ASN_STRING_UTF8String: + svalue = _max?basic_max/6:0; + break; + case ASN_STRING_UniversalString: + svalue = _max?basic_max/4:0; + break; + case ASN_STRING_BMPString: + svalue = _max?basic_max/2:0; + break; + case ASN_BASIC_OCTET_STRING: + svalue = _max?basic_max:0; + break; + default: + if((etype & ASN_STRING_MASK)) { + svalue = _max?basic_max:0; + break; + } + svalue = _max?basic_max:basic_min; + break; + } + + return svalue; +} + +static asn1p_expr_type_e +_find_terminal_type(arg_t *arg) { + asn1p_expr_t *expr; + expr = asn1f_find_terminal_type_ex(arg->asn, arg->mod, arg->expr, NULL); + assert(expr); + return expr->expr_type; +} diff --git a/libasn1compiler/asn1c_C.h b/libasn1compiler/asn1c_C.h new file mode 100644 index 00000000..643d6293 --- /dev/null +++ b/libasn1compiler/asn1c_C.h @@ -0,0 +1,69 @@ +#ifndef ASN1_COMPILER_LANGUAGE_C_H +#define ASN1_COMPILER_LANGUAGE_C_H + +#include "asn1c_lang.h" + +int asn1c_lang_C_type_REFERENCE(arg_t *); +int asn1c_lang_C_type_EXTENSIBLE(arg_t *); + +int asn1c_lang_C_type_SEQUENCE(arg_t *); +int asn1c_lang_C_type_SEQUENCE_OF(arg_t *); +int asn1c_lang_C_type_SET(arg_t *); +int asn1c_lang_C_type_SET_OF(arg_t *); +int asn1c_lang_C_type_CHOICE(arg_t *); + +int asn1c_lang_C_type_INTEGER(arg_t *); +int asn1c_lang_C_type_ENUMERATED(arg_t *); +int asn1c_lang_C_type_SIMPLE_TYPE(arg_t *); + +static asn1_language_map_t asn1_lang_C[] __attribute__ ((unused)) = { + { AMT_TYPE, A1TC_REFERENCE, asn1c_lang_C_type_REFERENCE }, + { AMT_TYPEREF, A1TC_REFERENCE, asn1c_lang_C_type_REFERENCE }, + { AMT_TYPE, A1TC_EXTENSIBLE, asn1c_lang_C_type_EXTENSIBLE }, + /* + * Constructed types + */ + { AMT_TYPE, ASN_CONSTR_SEQUENCE, asn1c_lang_C_type_SEQUENCE }, + { AMT_TYPE, ASN_CONSTR_SEQUENCE_OF, asn1c_lang_C_type_SEQUENCE_OF }, + { AMT_TYPEREF, ASN_CONSTR_SEQUENCE_OF, asn1c_lang_C_type_SEQUENCE_OF }, + { AMT_TYPE, ASN_CONSTR_SET, asn1c_lang_C_type_SET }, + { AMT_TYPE, ASN_CONSTR_SET_OF, asn1c_lang_C_type_SET_OF }, + { AMT_TYPEREF, ASN_CONSTR_SET_OF, asn1c_lang_C_type_SET_OF }, + { AMT_TYPE, ASN_CONSTR_CHOICE, asn1c_lang_C_type_CHOICE }, + /* + * Basic types + */ + { AMT_TYPE, ASN_BASIC_BOOLEAN, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_BASIC_NULL, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_BASIC_INTEGER, asn1c_lang_C_type_INTEGER }, + /* [Skipped REAL] */ + { AMT_TYPE, ASN_BASIC_ENUMERATED, asn1c_lang_C_type_ENUMERATED }, + { AMT_TYPE, ASN_BASIC_BIT_STRING, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_BASIC_OCTET_STRING, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_BASIC_OBJECT_IDENTIFIER,asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_BASIC_RELATIVE_OID, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_BASIC_CHARACTER_STRING, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_BASIC_UTCTime, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_BASIC_GeneralizedTime, asn1c_lang_C_type_SIMPLE_TYPE }, + /* + * String types + */ + { AMT_TYPE, ASN_STRING_BMPString, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_GeneralString, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_GraphicString, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_IA5String, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_ISO646String, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_NumericString, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_PrintableString,asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_TeletexString, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_T61String, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_UniversalString,asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_UTF8String, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_VideotexString,asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_VisibleString, asn1c_lang_C_type_SIMPLE_TYPE }, + { AMT_TYPE, ASN_STRING_ObjectDescriptor,asn1c_lang_C_type_SIMPLE_TYPE }, + { 0, 0, 0 } +}; + + +#endif /* ASN1_COMPILER_LANGUAGE_C_H */ diff --git a/libasn1compiler/asn1c_internal.h b/libasn1compiler/asn1c_internal.h new file mode 100644 index 00000000..91772cdc --- /dev/null +++ b/libasn1compiler/asn1c_internal.h @@ -0,0 +1,81 @@ +#ifndef _ASN1_COMPILER_INTERNAL_H_ +#define _ASN1_COMPILER_INTERNAL_H_ + +#include +#include +#include /* for fstat(2) */ +#include /* for unlink(2) */ +#include /* for open(2) */ +#include /* for glob(3) */ +#include /* for basename(3) */ +#include +#include /* for isalnum(3) */ +#include +#include +#include + +#include "asn1compiler.h" + +typedef struct arg_s { + + enum asn1c_flags flags; + + void (*logger_cb)(int _severity, const char *fmt, ...); + + int (*default_cb)(struct arg_s *); + + struct compiler_streams *target; + + asn1p_t *asn; + asn1p_module_t *mod; + asn1p_expr_t *expr; + + int indent_level; + int indented; + int embed; +} arg_t; + +#include "asn1c_lang.h" /* Target language initialization */ +#include "asn1c_misc.h" /* Miscellaneous functions */ +#include "asn1c_out.h" /* Handle output during compilation */ +#include "asn1c_save.h" /* Save compiled output */ + +#define INDENT(val) arg->indent_level += (val) +#define INDENTED(code) do { \ + INDENT(+1); \ + do { code; } while(0); \ + INDENT(-1); \ + } while(0) +#define FLAT(code) do { \ + int _il = arg->indent_level; \ + arg->indent_level = 0; \ + do { code; } while(0); \ + arg->indent_level = _il; \ + } while(0) +#define EMBED(ev) do { \ + REDIR(OT_TYPE_DECLS); \ + arg->embed++; \ + INDENTED(arg_t _tmp = *arg; \ + _tmp.expr = ev; \ + _tmp.default_cb(&_tmp); \ + ); \ + arg->embed--; \ + } while(0) +#define OUT(fmt, args...) asn1c_compiled_output(arg, fmt, ##args) + +#define REDIR(foo) do { arg->target->target = foo; } while(0) + +/* + * Logging. + */ +#define LOG(ll, fmt, args...) do { \ + arg->logger_cb(ll, fmt, ##args); \ + } while(0) +#define DEBUG(fmt, args...) do { \ + if(arg->flags & A1C_DEBUG) \ + LOG(-1, fmt, ##args); \ + } while(0) +#define WARNING(fmt, args...) LOG(0, fmt, ##args); +#define FATAL(fmt, args...) LOG(1, fmt, ##args); + +#endif /* _ASN1_COMPILER_INTERNAL_H_ */ diff --git a/libasn1compiler/asn1c_lang.c b/libasn1compiler/asn1c_lang.c new file mode 100644 index 00000000..fa07540a --- /dev/null +++ b/libasn1compiler/asn1c_lang.c @@ -0,0 +1,32 @@ +#include "asn1c_internal.h" +#include "asn1c_C.h" + +asn1_language_map_t asn1_lang_map[AMT_EXPR_META_MAX][ASN_EXPR_TYPE_MAX]; + +int +asn1c_with_language(asn1c_target_language_e lang) { + asn1_language_map_t *lptr; + int lsize; + if(lang != ASN1C_LANGUAGE_C) { + errno = EINVAL; + return -1; + } + + lptr = asn1_lang_C; + lsize = sizeof(asn1_lang_C)/sizeof(asn1_lang_C[0]); + + memset(asn1_lang_map, 0, sizeof(asn1_lang_map)); + + for(; lsize && lptr->expr_match; lsize--, lptr++) { + assert(lptr->meta_match > 0); + assert(lptr->meta_match < AMT_EXPR_META_MAX); + assert(lptr->expr_match > 0); + assert(lptr->expr_match < ASN_EXPR_TYPE_MAX); + + asn1_lang_map[lptr->meta_match][lptr->expr_match] + = *lptr; + } + + return 0; +} + diff --git a/libasn1compiler/asn1c_lang.h b/libasn1compiler/asn1c_lang.h new file mode 100644 index 00000000..8c9a6ea7 --- /dev/null +++ b/libasn1compiler/asn1c_lang.h @@ -0,0 +1,28 @@ +#ifndef ASN1_COMPILER_LANGUAGE_H +#define ASN1_COMPILER_LANGUAGE_H + +struct arg_s; + +typedef struct asn1_language_map_s { + asn1p_expr_meta_e meta_match; /* meta_type */ + asn1p_expr_type_e expr_match; /* expr_type */ + /* + * A callback that would create a language-specific type declaration. + */ + int (*type_cb)(struct arg_s *arg); +} asn1_language_map_t; + + +extern asn1_language_map_t asn1_lang_map[AMT_EXPR_META_MAX][ASN_EXPR_TYPE_MAX]; + + +typedef enum asn1c_target_language { + ASN1C_LANGUAGE_C, +} asn1c_target_language_e; + +/* + * Initialize the compiler to generate specified target language. + */ +int asn1c_with_language(asn1c_target_language_e lang); + +#endif /* ASN1_COMPILER_LANGUAGE_H */ diff --git a/libasn1compiler/asn1c_misc.c b/libasn1compiler/asn1c_misc.c new file mode 100644 index 00000000..b464b64c --- /dev/null +++ b/libasn1compiler/asn1c_misc.c @@ -0,0 +1,232 @@ +#include "asn1c_internal.h" +#include + +#ifndef DEFFILEMODE /* Normally in */ +#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) +#endif + +/* + * Construct identifier from multiple parts. + * Convert unsafe characters to underscores. + */ +char * +asn1c_make_identifier(int unsafe_only_spaces, char *arg1, ...) { + static char *storage; + static int storage_size; + int nodelimiter = 0; + va_list ap; + char *str; + int size; + char *p; + + if(arg1 == NULL) + return NULL; + + /* + * Estimate the necessary storage size + */ + size = strlen(arg1); + va_start(ap, arg1); + while((str = va_arg(ap, char *))) + size += 1 + strlen(str); + va_end(ap); + + /* + * Make sure we have this amount of storage. + */ + if(storage_size <= size) { + if(storage) free(storage); + storage = malloc(size + 1); + if(storage) { + storage_size = size; + } else { + storage_size = 0; + return NULL; + } + } + + /* + * Fill-in the storage. + */ + va_start(ap, arg1); + str = arg1; + p = storage; + for(str = arg1; str; str = va_arg(ap, char *)) { + int subst_made = 0; + + if(str[0] == ' ' && str[1] == '\0') { + *p++ = ' '; + nodelimiter = 1; /* No delimiter */ + continue; + } + + if(str != arg1 && !nodelimiter) + *p++ = '_'; /* Delimiter between tokens */ + nodelimiter = 0; + + for(; *str; str++) { + if(isalnum(*str)) { + *p++ = *str; + subst_made = 0; + } else if(!subst_made++) { + if(unsafe_only_spaces && !isspace(*str)) { + *p ++ = *str; + } else { + *p++ = '_'; + } + } + } + } + va_end(ap); + *p = '\0'; + + assert((p - storage) <= storage_size); + + return storage; +} + +FILE * +asn1c_open_file(arg_t *arg, const char *name, const char *ext) { + int created = 1; + struct stat sb; + char *fname; + int len; + FILE *fp; + int fd; + + /* + * Compute filenames. + */ + len = strlen(name) + strlen(ext) + 1; + fname = alloca(len); + snprintf(fname, len, "%s%s", name, ext); + + /* + * Create files. + */ + fd = open(fname, O_CREAT | O_EXCL | O_WRONLY, DEFFILEMODE); + if(fd == -1 && errno == EEXIST) { + fd = open(fname, O_WRONLY, DEFFILEMODE); + created = 0; + } + if(fd == -1) { + perror(fname); + return NULL; + } + + /* + * Check sanity. + */ + if(fstat(fd, &sb) || !S_ISREG(sb.st_mode)) { + fprintf(stderr, "%s: Not a regular file\n", fname); + if(created) unlink(fname); + close(fd); + return NULL; + } + + (void)ftruncate(fd, 0); + + /* + * Convert file descriptor into file pointer. + */ + fp = fdopen(fd, "w"); + if(fp == NULL) { + if(created) unlink(fname); + close(fd); + } + return fp; +} + +char * +asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format) { + char *typename; + + switch(expr->expr_type) { + case A1TC_REFERENCE: + typename = expr->reference->components[ + expr->reference->comp_count-1].name; + if(typename[0] == '&') { + arg_t tmp = *arg; + + /* + * This is a reference to a type defined in a class. + * Resolve it and use instead. + */ + tmp.expr = asn1f_class_access_ex(arg->asn, arg->mod, + arg->expr, expr->reference, &tmp.mod); + if(tmp.expr) return NULL; + + return asn1c_type_name(&tmp, tmp.expr, _format); + } else if(_format == TNF_RSAFE) { + /* + * The recursion-safe format is requested. + * The problem here is that only constructed types + * might be referenced with "struct". + * Change RSAFE to CTYPE if the terminal type + * is primitive. + */ + asn1p_expr_t *terminal; + terminal = asn1f_find_terminal_type_ex( + arg->asn, arg->mod, arg->expr, NULL); + if(terminal + && (terminal->expr_type + & (ASN_BASIC_MASK | ASN_STRING_MASK))) + _format = TNF_CTYPE; + } + break; + case ASN_CONSTR_SEQUENCE_OF: + case ASN_CONSTR_SET_OF: + if(expr->Identifier) { + typename = expr->Identifier; + } else { + asn1p_expr_t *child; + child = TQ_FIRST(&(expr->members)); + typename = asn1c_type_name(arg, child, _format); + if(typename) + return typename; + _format = TNF_SAFE; + typename = child->Identifier; + } + break; + case ASN_BASIC_INTEGER: + case ASN_BASIC_ENUMERATED: + if((arg->flags & A1C_USE_NATIVE_INTEGERS)) { + switch(_format) { + case TNF_CTYPE: + case TNF_RSAFE: + return "int"; + default: + if(expr->expr_type == ASN_BASIC_INTEGER) + return "NativeInteger"; + else + return "NativeEnumerated"; + } + } + /* Fall through */ + default: + if(expr->expr_type & (ASN_BASIC_MASK | ASN_STRING_MASK)) { + if(_format == TNF_RSAFE) + _format = TNF_CTYPE; + typename = ASN_EXPR_TYPE2STR(expr->expr_type); + } else { + _format = TNF_SAFE; + typename = expr->Identifier; + } + } + + switch(_format) { + case TNF_UNMODIFIED: + case TNF_INCLUDE: + return asn1c_make_identifier(1, typename, 0); + case TNF_SAFE: + return asn1c_make_identifier(0, typename, 0); + case TNF_CTYPE: + return asn1c_make_identifier(0, typename, "t", 0); + case TNF_RSAFE: + return asn1c_make_identifier(0, "struct", " ", typename, 0); + } + + assert("!unreachable"); + return typename; +} + diff --git a/libasn1compiler/asn1c_misc.h b/libasn1compiler/asn1c_misc.h new file mode 100644 index 00000000..2f82b0b6 --- /dev/null +++ b/libasn1compiler/asn1c_misc.h @@ -0,0 +1,28 @@ +#ifndef _ASN1_COMPILER_MISC_H_ +#define _ASN1_COMPILER_MISC_H_ + +/* + * Make the target language identifier out of one or more names. + * The function will concatenate the names and replace unsafe characters + * with safe ones. + */ +char *asn1c_make_identifier(int unsafe_only_spaces, char *arg1, ...); + +/* + * Return the type name of the specified expression. + */ +enum tnfmt { + TNF_UNMODIFIED, /* Return unmodified type name */ + TNF_INCLUDE, /* Format for #include <> */ + TNF_CTYPE, /* Format as normal C-ish type (append "_t") */ + TNF_SAFE, /* Replace unsafe characters with _ */ + TNF_RSAFE, /* Recursion-safe C type format */ +}; +char *asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format); + +/* + * Open the arbitrary file by its base name and extension. + */ +FILE *asn1c_open_file(arg_t *arg, const char *base_part, const char *extension); + +#endif /* _ASN1_COMPILER_MISC_H_ */ diff --git a/libasn1compiler/asn1c_out.c b/libasn1compiler/asn1c_out.c new file mode 100644 index 00000000..a6432418 --- /dev/null +++ b/libasn1compiler/asn1c_out.c @@ -0,0 +1,75 @@ +#include "asn1c_internal.h" + +/* + * Add an elementary chunk of target language text + * into appropriate output stream. + */ +int +asn1c_compiled_output(arg_t *arg, const char *fmt, ...) { + const char *p; + int lf_found; + va_list ap; + out_chunk_t *m; + char *buf; + int ret; + + /* + * Make sure the output has a single LF and only at the end. + */ + for(lf_found = 0, p = fmt; *p; p++) { + if(*p == '\n') { + lf_found++; + assert(p[1] == '\0'); + } + } + assert(lf_found <= 1); + + /* + * Print out the indentation. + */ + if(arg->indented == 0) { + int i = arg->indent_level; + arg->indented = 1; + while(i--) { + ret = asn1c_compiled_output(arg, "\t"); + if(ret == -1) return -1; + } + } + + /* + * Estimate necessary size. + */ + buf = ""; + va_start(ap, fmt); + ret = vsnprintf(buf, 0, fmt, ap); + va_end(ap); + assert(ret >= 0); + + /* + * Allocate buffer. + */ + m = calloc(1, sizeof(out_chunk_t)); + if(m == NULL) return -1; + m->len = ret + 1; + m->buf = malloc(ret + 1); + if(m->buf == NULL) { + free(m); + return -1; + } + + /* + * Fill the buffer. + */ + va_start(ap, fmt); + ret = vsnprintf(m->buf, m->len, fmt, ap); + assert(ret < m->len); + m->len = ret; + va_end(ap); + + TQ_ADD(&(arg->target->targets[arg->target->target]), m, next); + + if(lf_found) + arg->indented = 0; + + return 0; +} diff --git a/libasn1compiler/asn1c_out.h b/libasn1compiler/asn1c_out.h new file mode 100644 index 00000000..2267d5db --- /dev/null +++ b/libasn1compiler/asn1c_out.h @@ -0,0 +1,31 @@ +#ifndef _ASN1_COMPILED_OUTPUT_H_ +#define _ASN1_COMPILED_OUTPUT_H_ + +/* + * An elementary chunk of target language text. + */ +typedef struct out_chunk { + char *buf; + int len; + + TQ_ENTRY(struct out_chunk) next; +} out_chunk_t; + +typedef struct compiler_streams { + enum { + OT_DEPS, /* Dependencies */ + OT_TYPE_DECLS, /* Type declarations */ + OT_FUNC_DECLS, /* Function declarations */ + OT_STAT_DEFS, /* Static definitions */ + OT_CODE, /* Some code */ + OT_MAX + } target; + TQ_HEAD(out_chunk_t) targets[OT_MAX]; +} compiler_streams_t; + +static char *_compiler_stream2str[] __attribute__ ((unused)) + = { "DEPS", "TYPE-DECLS", "FUNC-DECLS", "STAT-DEFS", "CODE" }; + +int asn1c_compiled_output(arg_t *arg, const char *fmt, ...); + +#endif /* _ASN1_COMPILED_OUTPUT_H_ */ diff --git a/libasn1compiler/asn1c_save.c b/libasn1compiler/asn1c_save.c new file mode 100644 index 00000000..0e5b0fbc --- /dev/null +++ b/libasn1compiler/asn1c_save.c @@ -0,0 +1,225 @@ +#include "asn1c_internal.h" + +static int asn1c_dump_streams(arg_t *arg); +static int asn1c_print_streams(arg_t *arg); +static int asn1c_save_streams(arg_t *arg); +static int asn1c_copy_over(arg_t *arg, char *path); + +int +asn1c_save_compiled_output(arg_t *arg, const char *datadir) { + + (void)datadir; + + TQ_FOR(arg->mod, &(arg->asn->modules), mod_next) { + TQ_FOR(arg->expr, &(arg->mod->members), next) { + if(asn1_lang_map[arg->expr->meta_type] + [arg->expr->expr_type].type_cb) { + if(asn1c_dump_streams(arg)) + return -1; + } + } + } + + /* + * Dump out the Makefile template and the rest of the support code. + */ + if((arg->flags & A1C_PRINT_COMPILED) == 0 + && (arg->flags & A1C_OMIT_SUPPORT_CODE) == 0) { + glob_t pg; + FILE *mkf; + char *p; + int i; + + i = strlen(datadir) + sizeof("/*.[ch]"); + p = alloca(i); + snprintf(p, i, "%s/*.[ch]", datadir); + + memset(&pg, 0, sizeof(pg)); + if(glob(p, GLOB_ERR +#ifdef GLOB_TILDE + | GLOB_TILDE +#endif /* GLOB_TILDE */ + , NULL, &pg)) { + fprintf(stderr, + "Bad skeletons directory (-S) %s: %s\n", + datadir, strerror(errno)); + return -1; + } + + mkf = asn1c_open_file(arg, "Makefile.am", ".sample"); + if(mkf == NULL) { + globfree(&pg); + perror("Makefile.am.sample"); + return -1; + } + + fprintf(mkf, "ASN_SRCS="); + TQ_FOR(arg->mod, &(arg->asn->modules), mod_next) { + TQ_FOR(arg->expr, &(arg->mod->members), next) { + if(asn1_lang_map[arg->expr->meta_type] + [arg->expr->expr_type].type_cb) { + fprintf(mkf, "\t\\\n\t%s.c %s.h", + arg->expr->Identifier, + arg->expr->Identifier); + } + } + } + + for(i = 0; i < pg.gl_pathc; i++) { + if(asn1c_copy_over(arg, pg.gl_pathv[i])) { + fprintf(mkf, ">>>ABORTED<<<"); + fclose(mkf); + globfree(&pg); + return -1; + } else { + fprintf(mkf, "\t\\\n\t%s", + basename(pg.gl_pathv[i])); + } + } + + fprintf(mkf, "\n\n"); + fprintf(mkf, "lib_LTLIBRARIES=libsomething.la\n"); + fprintf(mkf, "libsomething_la_SOURCES=${ASN_SRCS}\n"); + fclose(mkf); + fprintf(stderr, "Generated Makefile.am.sample\n"); + globfree(&pg); + } + + return 0; +} + +/* + * Dump the streams. + */ +static int +asn1c_dump_streams(arg_t *arg) { + if(arg->flags & A1C_PRINT_COMPILED) { + return asn1c_print_streams(arg); + } else { + return asn1c_save_streams(arg); + } +} + +static int +asn1c_print_streams(arg_t *arg) { + compiler_streams_t *cs = arg->expr->data; + asn1p_expr_t *expr = arg->expr; + int i; + + for(i = 0; i < OT_MAX; i++) { + out_chunk_t *ot; + if(TQ_FIRST(&cs->targets[i]) == NULL) + continue; + + printf("\n/*** <<< %s [%s] >>> ***/\n\n", + _compiler_stream2str[i], + expr->Identifier); + + TQ_FOR(ot, &(cs->targets[i]), next) { + fwrite(ot->buf, ot->len, 1, stdout); + } + } + + return 0; +} + +static int +asn1c_save_streams(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + compiler_streams_t *cs = expr->data; + out_chunk_t *ot; + FILE *fp_c, *fp_h; + char *header_id; + + if(cs == NULL) { + fprintf(stderr, "Cannot compile %s at line %d\n", + expr->Identifier, expr->_lineno); + return -1; + } + + fp_c = asn1c_open_file(arg, expr->Identifier, ".c"); + fp_h = asn1c_open_file(arg, expr->Identifier, ".h"); + if(fp_c == NULL || fp_h == NULL) { + if(fp_c) fclose(fp_c); /* lacks unlink() */ + if(fp_h) fclose(fp_h); /* lacks unlink() */ + return -1; + } + + header_id = alloca(strlen(expr->Identifier) + 1); + if(1) { + char *src, *dst; + for(src = expr->Identifier, dst = header_id; + (*dst=*src); src++, dst++) + if(!isalnum(*src)) *dst = '_'; + *dst = '\0'; + } + + fprintf(fp_h, + "#ifndef\t_%s_H_\n" + "#define\t_%s_H_\n" + "\n", header_id, header_id); + + fprintf(fp_h, "#include \n\n"); + + TQ_FOR(ot, &(cs->targets[OT_DEPS]), next) + fwrite(ot->buf, ot->len, 1, fp_h); + fprintf(fp_h, "\n"); + TQ_FOR(ot, &(cs->targets[OT_TYPE_DECLS]), next) + fwrite(ot->buf, ot->len, 1, fp_h); + fprintf(fp_h, "\n"); + TQ_FOR(ot, &(cs->targets[OT_FUNC_DECLS]), next) + fwrite(ot->buf, ot->len, 1, fp_h); + + fprintf(fp_c, "#include <%s.h>\n\n", expr->Identifier); + TQ_FOR(ot, &(cs->targets[OT_STAT_DEFS]), next) + fwrite(ot->buf, ot->len, 1, fp_c); + TQ_FOR(ot, &(cs->targets[OT_CODE]), next) + fwrite(ot->buf, ot->len, 1, fp_c); + + assert(OT_MAX == 5); + + fprintf(fp_h, "\n#endif\t/* _%s_H_ */\n", header_id); + + fclose(fp_c); + fclose(fp_h); + fprintf(stderr, "Compiled %s.c\n", expr->Identifier); + fprintf(stderr, "Compiled %s.h\n", expr->Identifier); + return 0; +} + +static int +asn1c_copy_over(arg_t *arg, char *path) { + char *fname = basename(path); + + if(symlink(path, fname)) { + if(errno == EEXIST) { + struct stat sb1, sb2; + if(stat(path, &sb1) == 0 + && stat(fname, &sb2) == 0 + && sb1.st_dev == sb2.st_dev + && sb1.st_ino == sb2.st_ino) { + /* + * Nothing to do. + */ + fprintf(stderr, + "File %s is already here as %s\n", + path, fname); + return 0; + } else { + fprintf(stderr, + "Retaining local %s (%s suggested)\n", + fname, path); + return 0; + } + } else { + fprintf(stderr, "Symlink %s -> %s failed: %s\n", + path, fname, strerror(errno)); + return -1; + } + } + + fprintf(stderr, "Symlinked %s\t-> %s\n", path, fname); + + return 0; +} + diff --git a/libasn1compiler/asn1c_save.h b/libasn1compiler/asn1c_save.h new file mode 100644 index 00000000..487e625b --- /dev/null +++ b/libasn1compiler/asn1c_save.h @@ -0,0 +1,6 @@ +#ifndef _ASN1_SAVE_H_ +#define _ASN1_SAVE_H_ + +int asn1c_save_compiled_output(arg_t *arg, const char *datadir); + +#endif /* _ASN1_SAVE_H_ */ diff --git a/libasn1compiler/asn1compiler.c b/libasn1compiler/asn1compiler.c new file mode 100644 index 00000000..d647c05b --- /dev/null +++ b/libasn1compiler/asn1compiler.c @@ -0,0 +1,160 @@ +#include "asn1c_internal.h" + +static void default_logger_cb(int, const char *fmt, ...); +static int asn1c_compile_expr(arg_t *arg); +static int asn1c_attach_streams(asn1p_expr_t *expr); + +int +asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags flags) { + arg_t arg_s; + arg_t *arg = &arg_s; + int ret; + + /* + * Initialize target language. + */ + ret = asn1c_with_language(ASN1C_LANGUAGE_C); + assert(ret == 0); + + memset(arg, 0, sizeof(*arg)); + arg->default_cb = asn1c_compile_expr; + arg->logger_cb = default_logger_cb; + arg->flags = flags; + arg->asn = asn; + + /* + * Compile each individual top level structure. + */ + TQ_FOR(arg->mod, &(asn->modules), mod_next) { + TQ_FOR(arg->expr, &(arg->mod->members), next) { + compiler_streams_t *cs = NULL; + + if(asn1c_attach_streams(arg->expr)) + return -1; + + cs = arg->expr->data; + cs->target = OT_TYPE_DECLS; + arg->target = cs; + + ret = asn1c_compile_expr(arg); + if(ret) { + FATAL("Cannot compile %s (%x:%x) at line %d", + arg->expr->Identifier, + arg->expr->expr_type, + arg->expr->meta_type, + arg->expr->_lineno); + return ret; + } + } + } + + DEBUG("Saving compiled data"); + + /* + * Save or print out the compiled result. + */ + if(asn1c_save_compiled_output(arg, datadir)) + return -1; + + return 0; +} + +static int +asn1c_compile_expr(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + int (*type_cb)(arg_t *); + int ret; + + assert(expr->meta_type >= AMT_INVALID); + assert(expr->meta_type < AMT_EXPR_META_MAX); + assert(expr->expr_type >= A1TC_INVALID); + assert(expr->expr_type < ASN_EXPR_TYPE_MAX); + + type_cb = asn1_lang_map[expr->meta_type][expr->expr_type].type_cb; + if(type_cb) { + + if(arg->indent_level == 0) + OUT("\n"); + + DEBUG("Compiling %s at line %d", + expr->Identifier, + expr->_lineno); + + ret = type_cb(arg); + } else { + ret = -1; + /* + * Even if the target language compiler does not know + * how to compile the given expression, we know that + * certain expressions need not to be compiled at all. + */ + switch(expr->meta_type) { + case AMT_PARAMTYPE: + case AMT_OBJECT: + case AMT_OBJECTSET: + case AMT_VALUE: + case AMT_VALUESET: + ret = 0; + break; + default: + break; + } + + switch(expr->expr_type) { + case A1TC_TYPEID: + ret = 0; /* TYPE-IDENTIFIER is a CLASS */ + default: + break; + } + } + + if(ret == -1) { + OUT("#error Cannot compile \"%s\" (%x/%x) at line %d\n", + arg->expr->Identifier, + arg->expr->meta_type, + arg->expr->expr_type, + arg->expr->_lineno + ); + } + + return ret; +} + +static int +asn1c_attach_streams(asn1p_expr_t *expr) { + compiler_streams_t *cs; + int i; + + if(expr->data) + return 0; /* Already attached? */ + + expr->data = calloc(1, sizeof(compiler_streams_t)); + if(expr->data == NULL) + return -1; + + cs = expr->data; + for(i = 0; i < OT_MAX; i++) { + TQ_INIT(&(cs->targets[i])); + } + + return 0; +} + +static void +default_logger_cb(int _severity, const char *fmt, ...) { + va_list ap; + char *pfx = ""; + + switch(_severity) { + case -1: pfx = "DEBUG: "; break; + case 0: pfx = "WARNING: "; break; + case 1: pfx = "FATAL: "; break; + } + + fprintf(stderr, "%s", pfx); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fprintf(stderr, "\n"); +} + diff --git a/libasn1compiler/asn1compiler.h b/libasn1compiler/asn1compiler.h new file mode 100644 index 00000000..d104dc9a --- /dev/null +++ b/libasn1compiler/asn1compiler.h @@ -0,0 +1,41 @@ +#ifndef ASN1_COMPILER_H +#define ASN1_COMPILER_H + +#include + +enum asn1c_flags { + A1C_NOFLAGS, + /* + * Debug the compiler. + */ + A1C_DEBUG = 0x0001, + /* + * Do not split the target output in several files, just print it. + * (Note: the output is not likely to be compilable in this case). + */ + A1C_PRINT_COMPILED = 0x0002, + /* + * Generate only the tables for ASN.1 types, + * do not emit ASN.1 parsing support code. + */ + A1C_OMIT_SUPPORT_CODE = 0x0004, + /* + * Use native integers instead of INTEGER_t and ENUMERATED_t types. + */ + A1C_USE_NATIVE_INTEGERS = 0x0008, + /* + * Do not use C99 extensions. + */ + A1C_NO_C99 = 0x0010, + /* + * Enable use of unnamed unions (non-portable feature). + */ + A1C_UNNAMED_UNIONS = 0x0020, +}; + +/* + * Compile the ASN.1 specification. + */ +int asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags); + +#endif /* ASN1_COMPILER_H */ diff --git a/libasn1compiler/check_compiler.c b/libasn1compiler/check_compiler.c new file mode 100644 index 00000000..1da6902f --- /dev/null +++ b/libasn1compiler/check_compiler.c @@ -0,0 +1,7 @@ +#include "asn1compiler.h" + +int +main(int ac, char **av) { + return 0; +} + diff --git a/libasn1fix/Makefile.am b/libasn1fix/Makefile.am new file mode 100644 index 00000000..0e52b4f3 --- /dev/null +++ b/libasn1fix/Makefile.am @@ -0,0 +1,36 @@ + + +AM_CFLAGS = @ADD_CFLAGS@ +AM_CPPFLAGS = -I${top_srcdir}/libasn1parser + +noinst_LTLIBRARIES = libasn1fix.la + +libasn1fix_la_LDFLAGS = -all-static +libasn1fix_la_SOURCES = \ + asn1fix.c asn1fix.h \ + asn1fix_internal.h \ + asn1fix_misc.c asn1fix_misc.h \ + asn1fix_value.c asn1fix_value.h \ + asn1fix_compat.c asn1fix_compat.h \ + asn1fix_constr.c asn1fix_constr.h \ + asn1fix_cstring.c asn1fix_cstring.h \ + asn1fix_retrieve.c asn1fix_retrieve.h \ + asn1fix_bitstring.c asn1fix_bitstring.h \ + asn1fix_integer.c asn1fix_integer.h \ + asn1fix_dereft.c asn1fix_dereft.h \ + asn1fix_derefv.c asn1fix_derefv.h \ + asn1fix_export.c asn1fix_export.h \ + asn1fix_param.c asn1fix_param.h \ + asn1fix_class.c asn1fix_class.h \ + asn1fix_tags.c asn1fix_tags.h \ + asn1fix_enum.c asn1fix_enum.h +libasn1fix_la_LIBADD = ${top_builddir}/libasn1parser/libasn1parser.la + +check_PROGRAMS = check_fixer + +LDADD = ${noinst_LTLIBRARIES} ${libasn1fix_la_LIBADD} +DEPENDENCIES = ${LDADD} + +TESTS_ENVIRONMENT= ./check_fixer +TESTS = ${top_srcdir}/tests/*.asn1 +## TESTS = ${check_PROGRAMS} # This is an alternate form of testing diff --git a/libasn1fix/Makefile.in b/libasn1fix/Makefile.in new file mode 100644 index 00000000..8d919c20 --- /dev/null +++ b/libasn1fix/Makefile.in @@ -0,0 +1,454 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +ADD_CFLAGS = @ADD_CFLAGS@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AWK = @AWK@ +CC = @CC@ +CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@ +CPP = @CPP@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LEX = @LEX@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PATH = @PATH@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +YACC = @YACC@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +AM_CFLAGS = @ADD_CFLAGS@ +AM_CPPFLAGS = -I${top_srcdir}/libasn1parser + +noinst_LTLIBRARIES = libasn1fix.la + +libasn1fix_la_LDFLAGS = -all-static +libasn1fix_la_SOURCES = \ + asn1fix.c asn1fix.h \ + asn1fix_internal.h \ + asn1fix_misc.c asn1fix_misc.h \ + asn1fix_value.c asn1fix_value.h \ + asn1fix_compat.c asn1fix_compat.h \ + asn1fix_constr.c asn1fix_constr.h \ + asn1fix_cstring.c asn1fix_cstring.h \ + asn1fix_retrieve.c asn1fix_retrieve.h \ + asn1fix_bitstring.c asn1fix_bitstring.h \ + asn1fix_integer.c asn1fix_integer.h \ + asn1fix_dereft.c asn1fix_dereft.h \ + asn1fix_derefv.c asn1fix_derefv.h \ + asn1fix_export.c asn1fix_export.h \ + asn1fix_param.c asn1fix_param.h \ + asn1fix_class.c asn1fix_class.h \ + asn1fix_tags.c asn1fix_tags.h \ + asn1fix_enum.c asn1fix_enum.h + +libasn1fix_la_LIBADD = ${top_builddir}/libasn1parser/libasn1parser.la + +check_PROGRAMS = check_fixer + +LDADD = ${noinst_LTLIBRARIES} ${libasn1fix_la_LIBADD} +DEPENDENCIES = ${LDADD} + +TESTS_ENVIRONMENT = ./check_fixer +TESTS = ${top_srcdir}/tests/*.asn1 +subdir = libasn1fix +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + +libasn1fix_la_DEPENDENCIES = \ + ${top_builddir}/libasn1parser/libasn1parser.la +am_libasn1fix_la_OBJECTS = asn1fix.lo asn1fix_misc.lo asn1fix_value.lo \ + asn1fix_compat.lo asn1fix_constr.lo asn1fix_cstring.lo \ + asn1fix_retrieve.lo asn1fix_bitstring.lo asn1fix_integer.lo \ + asn1fix_dereft.lo asn1fix_derefv.lo asn1fix_export.lo \ + asn1fix_param.lo asn1fix_class.lo asn1fix_tags.lo \ + asn1fix_enum.lo +libasn1fix_la_OBJECTS = $(am_libasn1fix_la_OBJECTS) +check_PROGRAMS = check_fixer$(EXEEXT) +check_fixer_SOURCES = check_fixer.c +check_fixer_OBJECTS = check_fixer.$(OBJEXT) +check_fixer_LDADD = $(LDADD) +check_fixer_DEPENDENCIES = libasn1fix.la \ + ${top_builddir}/libasn1parser/libasn1parser.la +check_fixer_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/asn1fix.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_bitstring.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_class.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_compat.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_constr.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_cstring.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_dereft.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_derefv.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_enum.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_export.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_integer.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_misc.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_param.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_retrieve.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_tags.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1fix_value.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/check_fixer.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(libasn1fix_la_SOURCES) check_fixer.c +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(libasn1fix_la_SOURCES) check_fixer.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu libasn1fix/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) +libasn1fix.la: $(libasn1fix_la_OBJECTS) $(libasn1fix_la_DEPENDENCIES) + $(LINK) $(libasn1fix_la_LDFLAGS) $(libasn1fix_la_OBJECTS) $(libasn1fix_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +check_fixer$(EXEEXT): $(check_fixer_OBJECTS) $(check_fixer_DEPENDENCIES) + @rm -f check_fixer$(EXEEXT) + $(LINK) $(check_fixer_LDFLAGS) $(check_fixer_OBJECTS) $(check_fixer_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_bitstring.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_class.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_compat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_constr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_cstring.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_dereft.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_derefv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_enum.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_export.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_integer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_misc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_param.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_retrieve.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_tags.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1fix_value.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/check_fixer.Po@am__quote@ + +distclean-depend: + -rm -rf $(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` + +.c.lo: +@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< +CCDEPMODE = @CCDEPMODE@ +uninstall-info-am: + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + fi + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +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-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +uninstall-am: uninstall-info-am + +.PHONY: GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES distclean distclean-compile \ + distclean-depend distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + tags uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libasn1fix/asn1fix.c b/libasn1fix/asn1fix.c new file mode 100644 index 00000000..af110999 --- /dev/null +++ b/libasn1fix/asn1fix.c @@ -0,0 +1,354 @@ +#include +#include +#include +#include + +#include "asn1fix.h" +#include "asn1fix_internal.h" + +/* Print everything to stderr */ +static void _default_error_logger(int _severity, const char *fmt, ...); + +/* + * Internal check functions. + */ +static int asn1f_fix_module(arg_t *arg); +static int asn1f_fix_simple(arg_t *arg); /* For INTEGER/ENUMERATED */ +static int asn1f_fix_constructed(arg_t *arg); /* For SEQUENCE/SET/CHOICE */ +static int asn1f_fix_constraints(arg_t *arg); /* For subtype constraints */ + + +/* + * Scan every module defined here in search for inconsistences. + */ +int +asn1f_process(asn1p_t *asn, enum asn1f_flags flags, + error_logger_f error_logger) { + arg_t arg; + int fatals = 0; + int warnings = 0; + + /* + * Check validity of arguments. + */ + if(asn == NULL) { + errno = EINVAL; + return -1; + } + + /* + * If errors handler is not specified, default to internal one. + */ + if(error_logger == 0) { + error_logger = _default_error_logger; + } + + memset(&arg, 0, sizeof(arg)); + arg.asn = asn; + arg.eh = error_logger; + + if(flags & A1F_DEBUG) { + arg.debug = arg.eh; + arg.debug(-1, "Called %s() with flags %d", __func__, flags); + flags &= ~A1F_DEBUG; + } + + /* + * Check that we haven't missed an unknown flag. + */ + if(flags) { + errno = EINVAL; + return -1; + } + + /* + * Process each module in the list. + */ + TQ_FOR(arg.mod, &(asn->modules), mod_next) { + int ret = asn1f_fix_module(&arg); + /* + * These lines are used for illustration purposes. + * RET2RVAL() is used everywhere else. + */ + if(ret == -1) fatals++; + if(ret == 1) warnings++; + } + + /* + * Compute a return value. + */ + return fatals?-1:warnings?1:0; +} + +/* + * Check the internals of a single module. + */ +static int +asn1f_fix_module(arg_t *arg) { + asn1p_expr_t *expr; + int rvalue = 0; + + switch((arg->mod->module_flags + & (MSF_EXPLICIT_TAGS | MSF_IMPLICIT_TAGS | MSF_AUTOMATIC_TAGS))) { + case MSF_NOFLAGS: + case MSF_EXPLICIT_TAGS: + case MSF_IMPLICIT_TAGS: + case MSF_AUTOMATIC_TAGS: + break; + default: + FATAL("Module %s defined with ambiguous global tagging mode", + arg->mod->Identifier); + RET2RVAL(-1, rvalue); + } + + /* + * Do various non-recursive transformations. + * Order is not important. + */ + TQ_FOR(expr, &(arg->mod->members), next) { + int ret; + arg->expr = expr; + + if(expr->meta_type == AMT_PARAMTYPE) + /* Do not process the parametrized type just yet */ + continue; + + DEBUG("=== Now processing \"%s\" at line %d ===", + expr->Identifier, expr->_lineno); + assert(expr->meta_type != AMT_INVALID); + + /* + * 2.1 Pre-process simple types (ENUMERATED, INTEGER, etc). + */ + ret = asn1f_recurse_expr(arg, asn1f_fix_simple); + RET2RVAL(ret, rvalue); + + /* + * 2.[234] Process SEQUENCE/SET/CHOICE types. + */ + ret = asn1f_recurse_expr(arg, asn1f_fix_constructed); + RET2RVAL(ret, rvalue); + + /* + * 2.5.4 + */ + ret = asn1f_recurse_expr(arg, asn1f_fix_dereference_types); + RET2RVAL(ret, rvalue); + + /* + * 2.5.5 + */ + ret = asn1f_recurse_expr(arg, asn1f_fix_dereference_values); + RET2RVAL(ret, rvalue); + + /* + * Resolve references in constraints. + */ + ret = asn1f_recurse_expr(arg, asn1f_fix_constraints); + RET2RVAL(ret, rvalue); + + /* + * 6. INTEGER value processed at 2.5.4. + */ + + /* + * Make sure everybody's behaving well. + */ + assert(arg->expr == expr); + } + + /* + * 5. Automatic tagging + */ + TQ_FOR(expr, &(arg->mod->members), next) { + int ret; + + arg->expr = expr; + + ret = asn1f_recurse_expr(arg, asn1f_fix_constr_autotag); + RET2RVAL(ret, rvalue); + + assert(arg->expr == expr); + } + + /* + * 8. fix BIT STRING + * 9. fix spaces in cstrings + */ + TQ_FOR(expr, &(arg->mod->members), next) { + int ret; + arg->expr = expr; + + ret = asn1f_recurse_expr(arg, asn1f_fix_bit_string); + RET2RVAL(ret, rvalue); + + ret = asn1f_recurse_expr(arg, asn1f_fix_cstring); + RET2RVAL(ret, rvalue); + + assert(arg->expr == expr); + } + + /* + * ... Check for tags distinctness. + */ + TQ_FOR(expr, &(arg->mod->members), next) { + int ret; + arg->expr = expr; + + ret = asn1f_recurse_expr(arg, asn1f_check_constr_tags_distinct); + RET2RVAL(ret, rvalue); + + assert(arg->expr == expr); + } + + return rvalue; +} + + +static int +asn1f_fix_simple(arg_t *arg) { + int rvalue = 0; + int ret; + + ret = asn1f_fix_enum(arg); + RET2RVAL(ret, rvalue); + + ret = asn1f_fix_integer(arg); + RET2RVAL(ret, rvalue); + + return rvalue; +} + +static int +asn1f_fix_constructed(arg_t *arg) { + int rvalue = 0; + int ret; + + switch(arg->expr->expr_type) { + case ASN_CONSTR_SEQUENCE: + case ASN_CONSTR_SET: + case ASN_CONSTR_CHOICE: + break; + default: + return 0; + } + + /* Check identifier distinctness */ + ret = asn1f_check_unique_expr(arg, NULL); + RET2RVAL(ret, rvalue); + + /* Fix extensibility */ + ret = asn1f_fix_constr_ext(arg); + RET2RVAL(ret, rvalue); + + /* Fix tagging */ + ret = asn1f_fix_constr_tag(arg); + RET2RVAL(ret, rvalue); + + return rvalue; +} + +static int +_constraint_value_resolve(arg_t *arg, asn1p_value_t **value) { + asn1p_expr_t expr; + asn1p_expr_t *tmp_expr; + asn1p_module_t *tmp_mod; + asn1p_module_t *mod_r = NULL; + int rvalue = 0; + int ret; + + tmp_expr = asn1f_lookup_symbol(arg, (*value)->value.reference, &mod_r); + if(tmp_expr == NULL) { + FATAL("Cannot find symbol %s " + "used in %s subtype constraint at line %d", + asn1f_printable_reference((*value)->value.reference), + arg->expr->Identifier, arg->expr->_lineno); + assert((*value)->type == ATV_REFERENCED); + return -1; + } + + memset(&expr, 0, sizeof(expr)); + expr.meta_type = tmp_expr->meta_type; + expr.expr_type = tmp_expr->expr_type; + expr.Identifier = tmp_expr->Identifier; + expr.value = *value; + tmp_expr = arg->expr; + tmp_mod = arg->mod; + arg->expr = &expr; + arg->mod = mod_r; + ret = asn1f_fix_dereference_values(arg); + RET2RVAL(ret, rvalue); + arg->expr = tmp_expr; + arg->mod = tmp_mod; + assert(expr.value); + *value = expr.value; + + return rvalue; +} + +static int +_resolve_constraints(arg_t *arg, asn1p_constraint_t *ct) { + int rvalue = 0; + int ret; + int el; + + /* Don't touch information object classes */ + if(ct->type == ACT_CT_WCOMP + || ct->type == ACT_CT_WCOMPS + || ct->type == ACT_CA_CRC) + return 0; + + if(ct->value && ct->value->type == ATV_REFERENCED) { + ret = _constraint_value_resolve(arg, &ct->value); + RET2RVAL(ret, rvalue); + } + if(ct->range_start && ct->range_start->type == ATV_REFERENCED) { + ret = _constraint_value_resolve(arg, &ct->range_start); + RET2RVAL(ret, rvalue); + } + if(ct->range_stop && ct->range_stop->type == ATV_REFERENCED) { + ret = _constraint_value_resolve(arg, &ct->range_stop); + RET2RVAL(ret, rvalue); + } + + for(el = 0; el < ct->el_count; el++) { + ret = _resolve_constraints(arg, ct->elements[el]); + RET2RVAL(ret, rvalue); + } + + return rvalue; +} + +static int +asn1f_fix_constraints(arg_t *arg) { + int rvalue = 0; + int ret; + + if(arg->expr->constraints) { + ret = _resolve_constraints(arg, arg->expr->constraints); + RET2RVAL(ret, rvalue); + } + + return rvalue; +} + +/* + * Print everything to stderr + */ +static void +_default_error_logger(int _severity, const char *fmt, ...) { + va_list ap; + char *pfx = ""; + + switch(_severity) { + case -1: pfx = "DEBUG: "; break; + case 0: pfx = "WARNING: "; break; + case 1: pfx = "FATAL: "; break; + } + + fprintf(stderr, "%s", pfx); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fprintf(stderr, "\n"); +} diff --git a/libasn1fix/asn1fix.h b/libasn1fix/asn1fix.h new file mode 100644 index 00000000..4847330a --- /dev/null +++ b/libasn1fix/asn1fix.h @@ -0,0 +1,30 @@ +/* + * This is the public interface for the processor (fixer) of the ASN.1 tree + * produced by the libasn1parser. + */ +#ifndef ASN1FIX_H +#define ASN1FIX_H + +#include + +/* + * Operation flags for the function below. + */ +enum asn1f_flags { + A1F_NOFLAGS, + A1F_DEBUG, /* Print debugging output using (_is_fatal = -1) */ +}; + +/* + * Perform a set of semantics checks, transformations and small fixes + * on the given tree. + * RETURN VALUES: + * -1: Some fatal problems were encountered. + * 0: No inconsistencies were found. + * 1: Some warnings were issued, but no fatal problems encountered. + */ +int asn1f_process(asn1p_t *_asn, + enum asn1f_flags, + void (*error_log_callback)(int _severity, const char *fmt, ...)); + +#endif /* ASN1FIX_H */ diff --git a/libasn1fix/asn1fix_bitstring.c b/libasn1fix/asn1fix_bitstring.c new file mode 100644 index 00000000..0d3961d4 --- /dev/null +++ b/libasn1fix/asn1fix_bitstring.c @@ -0,0 +1,230 @@ +#include "asn1fix_internal.h" + +int asn1f_fix_bit_string_value(arg_t *arg, asn1p_expr_t *ttype); +static void asn1f_BS_remove_trailing_zero_bits(asn1p_value_t *value); +static int asn1f_BS_unparsed_convert(arg_t *arg, asn1p_value_t *value, asn1p_expr_t *ttype); + +int +asn1f_fix_bit_string(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + int r_value = 0; + int ret; + + if(expr->meta_type == AMT_VALUE) { + asn1p_expr_t *ttype; + + DEBUG("%s(%s) for line %d", __func__, + expr->Identifier, expr->_lineno); + + ttype = asn1f_find_terminal_type(arg, expr, 0); + if(ttype && ttype->expr_type == ASN_BASIC_BIT_STRING) { + ret = asn1f_fix_bit_string_value(arg, ttype); + RET2RVAL(ret, r_value); + } + } + + return r_value; +} + +int +asn1f_fix_bit_string_value(arg_t *arg, asn1p_expr_t *ttype) { + asn1p_expr_t *expr = arg->expr; + int r_value = 0; + + DEBUG("%s(%s) for line %d", __func__, + expr->Identifier, expr->_lineno); + + switch(expr->value->type) { + case ATV_UNPARSED: + /* + * Most definitely we have something like + * value BitStringType1 ::= { a, b, c } + * which could not be parsed by the LALR parser, mostly + * because it requires knowledge about BitStringType1 + * during the parsing. So, here's a little hack: we create + * a buffer containing the full specification of a module, + * which contains some pre-defined INTEGER type with the + * opaque definition "{ a, b, c }" from the bit string. + */ + if(asn1f_BS_unparsed_convert(arg, expr->value, ttype)) { + r_value = -1; + break; + } + /* Fall through: remove trailing zero bits */ + case ATV_BITVECTOR: + asn1f_BS_remove_trailing_zero_bits(expr->value); + break; + default: + break; + } + + return r_value; +} + +static void +asn1f_BS_remove_trailing_zero_bits(asn1p_value_t *value) { + int lmfb = -1; /* Last meaningful byte position */ + int bits; /* Number of bits in the BIT STRING value */ + int b; + + assert(value->type == ATV_BITVECTOR); + + bits = value->value.binary_vector.size_in_bits; + /* + * Figure out the rightmost meaningful byte. + */ + for(b = 0; b < ((bits + 7) >> 3); b++) { + uint8_t uc = value->value.binary_vector.bits[b]; + if(uc && b > lmfb) + lmfb = b; + } + if(lmfb == -1) { + bits = 0; + } else { + uint8_t uc; + uc = value->value.binary_vector.bits[lmfb]; + bits = (lmfb+1) * 8; + /* + * Squeeze the bit string width until the rightmost + * bit is set. + */ + for(; uc && (uc & 1) == 0; uc >>= 1) + bits--; + if(uc == 0) { + bits = lmfb * 8; + } + } + value->value.binary_vector.size_in_bits = bits; +} + +static int +asn1f_BS_unparsed_convert(arg_t *arg, asn1p_value_t *value, asn1p_expr_t *ttype) { + asn1p_t *asn; + asn1p_module_t *mod; + asn1p_expr_t *V; + asn1p_expr_t *bit; + asn1_integer_t aI; + uint8_t *bitbuf; + int bits; + int psize; + char *p; + int ret; + int r_value = 0; + + assert(value->type == ATV_UNPARSED); + + psize = value->value.string.size + 64; + p = malloc(psize); + if(p == NULL) + return -1; + + ret = snprintf(p, psize, + "M DEFINITIONS ::=\nBEGIN\n" + "V ::= INTEGER %s\n" + "END\n", + value->value.string.buf + ); + assert(ret < psize); + psize = ret; + + asn = asn1p_parse_buffer(p, psize, A1P_NOFLAGS); + free(p); + if(asn == NULL) { + FATAL("Cannot parse BIT STRING value %s " + "defined as %s at line %d", + arg->expr->Identifier, + value->value.string.buf, + arg->expr->_lineno + ); + return -1; + } + + mod = TQ_FIRST(&(asn->modules)); + assert(mod); + V = TQ_FIRST(&(mod->members)); + assert(V); + assert(strcmp(V->Identifier, "V") == 0); + assert(TQ_FIRST(&(V->members))); + + /* + * Simple loop just to fetch the maximal bit position + * out of the BIT STRING value defined as NamedBitList. + */ + aI = -1; + TQ_FOR(bit, &(V->members), next) { + asn1p_expr_t *bitdef; + bitdef = asn1f_lookup_child(ttype, bit->Identifier); + if(bitdef && bitdef->value + && bitdef->value->type == ATV_INTEGER) { + if(bitdef->value->value.v_integer > aI) + aI = bitdef->value->value.v_integer; + } + } + + if(aI > 1024 * 1024 * 8) { /* One megabyte */ + FATAL("Unsupportedly large BIT STRING value \"%s\" " + "defined at line %d " + "(larger than 1MByte)", + arg->expr->Identifier, + arg->expr->_lineno + ); + asn1p_free(asn); + return -1; + } + + bits = aI + 1; /* Number of bits is more than a last bit position */ + bitbuf = calloc(1, 1 + ((bits + 7) / 8)); + if(bitbuf == NULL) { + asn1p_free(asn); + return -1; + } + + TQ_FOR(bit, &(V->members), next) { + asn1p_expr_t *bitdef; + int set_bit_pos; + + if(bit->value) { + WARNING("Identifier \"%s\" at line %d " + "must not have a value", + bit->Identifier, bit->_lineno); + RET2RVAL(1, r_value); + } + bitdef = asn1f_lookup_child(ttype, bit->Identifier); + if(bitdef == NULL) { + FATAL("Identifier \"%s\" at line %d is not defined " + "in the \"%s\" type definition at line %d", + bit->Identifier, + bit->_lineno, + ttype->Identifier, + ttype->_lineno + ); + RET2RVAL(-1, r_value); + continue; + } + if(bitdef->value == NULL + || bitdef->value->type != ATV_INTEGER) { + FATAL("Broken identifier " + "\"%s\" at line %d " + "referenced by \"%s\" at line %d", + bitdef->Identifier, + bitdef->_lineno, + arg->expr->Identifier, + arg->expr->_lineno + ); + RET2RVAL(-1, r_value); + continue; + } + + assert(bitdef->value->value.v_integer < bits); + set_bit_pos = bitdef->value->value.v_integer; + bitbuf[set_bit_pos>>3] |= 1 << (7-(set_bit_pos % 8)); + } + + asn1p_free(asn); + free(value->value.string.buf); + value->type = ATV_BITVECTOR; + value->value.binary_vector.bits = bitbuf; + value->value.binary_vector.size_in_bits = bits; + + return r_value; +} diff --git a/libasn1fix/asn1fix_bitstring.h b/libasn1fix/asn1fix_bitstring.h new file mode 100644 index 00000000..1230856f --- /dev/null +++ b/libasn1fix/asn1fix_bitstring.h @@ -0,0 +1,6 @@ +#ifndef _ASN1FIX_BIT_STRING_H_ +#define _ASN1FIX_BIT_STRING_H_ + +int asn1f_fix_bit_string(arg_t *); + +#endif /* _ASN1FIX_BIT_STRING_H_ */ diff --git a/libasn1fix/asn1fix_class.c b/libasn1fix/asn1fix_class.c new file mode 100644 index 00000000..c541fd62 --- /dev/null +++ b/libasn1fix/asn1fix_class.c @@ -0,0 +1,237 @@ +#include "asn1fix_internal.h" + +typedef enum field_category { + OFC_INVALID, /* Invalid object field category */ + OFC_TYPE, + OFC_FIXED_TYPE_VALUE, + OFC_VARIABLE_TYPE_VALUE, + OFC_FIXED_TYPE_VALUE_SET, + OFC_VARIABLE_TYPE_VALUE_SET, + OFC_INFORMATION_OBJECT, + OFC_INFORMATION_OBJECT_SET, +} field_category_e; + +typedef enum object_category { + OC_INVALID, + OC_OBJECT, + OC_OBJECTSET, +} object_category_e; + +static field_category_e asn1f_class_field_category(asn1p_expr_t *ofield); +static object_category_e asn1f_class_object_category(asn1p_expr_t *expr); +static asn1p_expr_t * +asn1f_class_dot_lookup(arg_t *arg, asn1p_expr_t *obj, asn1p_ref_t *ref); + +asn1p_expr_t * +asn1f_class_access(arg_t *arg, asn1p_ref_t *ref, asn1p_module_t **mod_r) { + asn1p_expr_t *obj; /* Information Object or Object Set */ + object_category_e obj_cat; /* Object category */ + //field_category_e field_cat; /* Field category */ + asn1p_expr_t *result; + asn1p_ref_t tmpref; + + assert(ref->comp_count > 1); + + DEBUG("%s(%s) for line %d", __func__, + asn1f_printable_reference(ref), + ref->_lineno); + + /* + * Fetch the first part of the reference (OBJECT or ObjectSet). + * OBJECT.&... + * ObjectSet.&... + */ + assert(isupper(ref->components[0].name[0])); + + tmpref = *ref; + tmpref.comp_count = 1; + obj = asn1f_lookup_symbol(arg, &tmpref, 0); + if(obj == NULL) { + errno = ESRCH; + return NULL; + } + + /* + * Make sure the symbol lexical property (upper-case, lower-case) + * corresponds to the type of the expression returned by + * lookup_symbol(). + */ + obj_cat = asn1f_class_object_category(obj); + switch(obj_cat) { + case OC_OBJECT: + case OC_OBJECTSET: + if(ref->components[0].lex_type + == (obj_cat==OC_OBJECT) + ? RLT_CAPITALS + : RLT_Uppercase) + break; + /* Fall through */ + case OC_INVALID: + WARNING("Symbol \"%s\" is not compatible " + "with referenced expression \"%s\" at line %d", + ref->components[0].name, + obj->Identifier, obj->_lineno); + errno = EPERM; + return NULL; + } + + /* + * Find the specified field within the object. + */ + result = asn1f_class_dot_lookup(arg, obj, ref); + if(result == NULL) { + return NULL; + } + + //field_cat = asn1f_class_field_category(result); + + DEBUG("FILLME: %s", result->Identifier); + + return result; +} + +static object_category_e +asn1f_class_object_category(asn1p_expr_t *expr) { + + switch(expr->meta_type) { + case AMT_OBJECT: + return OC_OBJECT; + case AMT_OBJECTSET: + return OC_OBJECTSET; + case AMT_VALUESET: + if(expr->expr_type == A1TC_REFERENCE + && expr->reference + && expr->reference->comp_count == 1 + && expr->reference->components[0].lex_type == RLT_CAPITALS) + { + /* FIXME: use find_terminal_type instead! */ + return OC_OBJECTSET; + } + break; + default: + break; + } + + return OC_INVALID; +} + +static field_category_e +asn1f_class_field_category(asn1p_expr_t *ofield) { + if(ofield->Identifier[0] != '&') { + assert(ofield->Identifier[0] == '&'); + return OFC_INVALID; + } + + if(isupper(ofield->Identifier[1])) { + if(ofield->reference) { + enum asn1p_ref_lex_type_e lex_type + = ofield->reference->components[0].lex_type; + + switch(lex_type) { + case RLT_CAPITALS: + return OFC_INFORMATION_OBJECT_SET; + case RLT_Uppercase: + return OFC_FIXED_TYPE_VALUE_SET; + case RLT_AmpUppercase: + return OFC_VARIABLE_TYPE_VALUE_SET; + default: + break; + } + } else { + if(ofield->expr_type == A1TC_CLASSFIELD) + return OFC_TYPE; + + switch(ofield->meta_type) { + case AMT_TYPE: + case AMT_TYPEREF: + return OFC_FIXED_TYPE_VALUE_SET; + default: + break; + } + + } + } else { + if(ofield->reference) { + enum asn1p_ref_lex_type_e lex_type + = ofield->reference->components[0].lex_type; + + switch(lex_type) { + case RLT_CAPITALS: + return OFC_INFORMATION_OBJECT; + case RLT_Uppercase: + return OFC_FIXED_TYPE_VALUE; + case RLT_AmpUppercase: + return OFC_VARIABLE_TYPE_VALUE; + default: + break; + } + } else { + switch(ofield->meta_type) { + case AMT_TYPE: + case AMT_TYPEREF: + return OFC_FIXED_TYPE_VALUE; + default: + break; + } + } + } + + return OFC_INVALID; +} + + +static asn1p_expr_t * +asn1f_class_dot_lookup(arg_t *arg, asn1p_expr_t *obj, asn1p_ref_t *ref) { + asn1p_expr_t *ofield = NULL; /* Information Object's Field */ + field_category_e field_cat; /* Field category */ + int comp; + + assert(ref->comp_count >= 2); + + for(comp = 1 /* sic! */; comp < ref->comp_count; comp++) { + int is_last_component = (comp + 1 == ref->comp_count); + char *comp_name = ref->components[comp].name; + + ofield = asn1f_lookup_child(obj, comp_name); + if(ofield == NULL) { + DEBUG("Cannot find field \"%s\" in \"%s\" at line %d", + ref->components[1].name, + obj->Identifier, + obj->_lineno); + } + + /* + * Compute the category of the field of + * the information object class. + */ + field_cat = asn1f_class_field_category(ofield); + + switch(field_cat) { + case OFC_INVALID: + WARNING("Invalid field category of \"%s\" at line %d", + ofield->Identifier, ofield->_lineno); + errno = EPERM; + return NULL; + case OFC_TYPE: + case OFC_FIXED_TYPE_VALUE: + case OFC_VARIABLE_TYPE_VALUE: + case OFC_FIXED_TYPE_VALUE_SET: + case OFC_VARIABLE_TYPE_VALUE_SET: + if(!is_last_component) { + FATAL("Field name component \"%s\" at line %d " + "specifies non-dereferenceable thing", + comp_name, ref->_lineno); + errno = EPERM; + return NULL; + } + break; + case OFC_INFORMATION_OBJECT: + case OFC_INFORMATION_OBJECT_SET: + obj = ofield; + break; + } + } + + assert(ofield); + return ofield; +} diff --git a/libasn1fix/asn1fix_class.h b/libasn1fix/asn1fix_class.h new file mode 100644 index 00000000..c849b2b3 --- /dev/null +++ b/libasn1fix/asn1fix_class.h @@ -0,0 +1,16 @@ +#ifndef _ASN1FIX_CLASS_H_ +#define _ASN1FIX_CLASS_H_ + +/* + * Fetch the element from the class-related stuff (thing) by its reference. + */ +asn1p_expr_t * +asn1f_class_access(arg_t *, asn1p_ref_t *, asn1p_module_t **mod_r); + +/* + * Externally accessible version of above function. + */ +asn1p_expr_t *asn1f_class_access2(asn1p_t *asn, asn1p_module_t *mod, + asn1p_expr_t *expr, asn1p_ref_t *, asn1p_module_t **mod_r); + +#endif /* _ASN1FIX_CLASS_H_ */ diff --git a/libasn1fix/asn1fix_compat.c b/libasn1fix/asn1fix_compat.c new file mode 100644 index 00000000..aef26c0b --- /dev/null +++ b/libasn1fix/asn1fix_compat.c @@ -0,0 +1,132 @@ +#include "asn1fix_internal.h" + +static int asn1f_check_same_children(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b); + +/* + * Check that the expressions given are compatible in their type. + * ORDER DOES MATTER! (See .h). + */ +int +asn1f_check_type_compatibility(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) { + asn1p_expr_type_e atype, btype; + + atype = a->expr_type; + btype = b->expr_type; + + DEBUG("%s(%s:%x@%d, %s:%x@%d)", __func__, + a->Identifier, atype, a->_lineno, + b->Identifier, btype, b->_lineno); + + /* + * Expected terminal type! + */ + assert(atype != A1TC_REFERENCE); + assert(btype != A1TC_REFERENCE); + + if(atype != btype) { + /* + * Limited compatibility. + */ + if((atype == A1TC_UNIVERVAL && btype == ASN_BASIC_INTEGER) + || (atype == A1TC_UNIVERVAL && btype == ASN_BASIC_ENUMERATED) + ) + return 0; + DEBUG("\t%s and %s are not compatible", + a->Identifier, b->Identifier); + return -1; /* Fairly obviously */ + } + + if(a == b) + return 0; /* Fairly obviously */ + + switch(atype) { + case ASN_BASIC_INTEGER: + /* All integers are compatible */ + return 0; + case ASN_BASIC_ENUMERATED: + /* + * Enumerations are not compatible + * unless their definitions are the same. + */ + if(asn1f_check_same_children(arg, a, b)) { + DEBUG("\tEnumerations are different %s and %s", + a->Identifier, b->Identifier); + return -1; + } + return 0; + default: + /* Compatibility is not defined yet */ + DEBUG("\tCompatibility rule is not defined for %s and %s", + a->Identifier, b->Identifier); + return -1; + } + + return 0; +} + +/* + * Check that the children are exactly same. + */ +static int +asn1f_check_same_children(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) { + asn1p_expr_t *achild; + asn1p_expr_t *bchild; + + achild = TQ_FIRST(&(a->members)); + bchild = TQ_FIRST(&(b->members)); + + while(1) { + if(achild->expr_type != bchild->expr_type) + return -1; + + if(achild->Identifier && bchild->Identifier) { + if(strcmp(achild->Identifier, bchild->Identifier)) + return -1; + } else if(!(!achild->Identifier && !bchild->Identifier)) { + return -1; + } + + if(achild->value && bchild->value) { + if(achild->value->type != bchild->value->type) + return -1; + switch(achild->value->type) { + case ATV_INTEGER: + if(achild->value->value.v_integer + != bchild->value->value.v_integer) + return -1; + break; + case ATV_REFERENCED: + default: + DEBUG("Value %s at lines %d and " + "%d cannot be used in " + "semantical equality check", + asn1f_printable_value(achild->value), + achild->value->value.reference->_lineno, + bchild->value->value.reference->_lineno + ); + return -1; + } + } else if(!(!achild->value && !bchild->value)) { + /* One of values is defined, and another is not */ + return -1; + } + + achild = TQ_NEXT(achild, next); + bchild = TQ_NEXT(bchild, next); + + if(achild && bchild) + continue; + else if(!achild && !bchild) + break; + else + return -1; + } + + DEBUG("\t%s:%x@%d and %s:%x@%d are semantically equivalent", + a->Identifier, a->expr_type, a->_lineno, + b->Identifier, b->expr_type, b->_lineno); + + return 0; +} + + diff --git a/libasn1fix/asn1fix_compat.h b/libasn1fix/asn1fix_compat.h new file mode 100644 index 00000000..429e7dd8 --- /dev/null +++ b/libasn1fix/asn1fix_compat.h @@ -0,0 +1,14 @@ +#ifndef _ASN1FIX_COMPAT_H_ +#define _ASN1FIX_COMPAT_H_ + +/* + * Check that the expressions given are compatible in their type. + * ORDER DOES MATTER! + * The compatibility is being checked as if the value of b were used + * to assign it to type a. + */ +int asn1f_check_type_compatibility(arg_t *arg, + asn1p_expr_t *a, + asn1p_expr_t *b); + +#endif /* _ASN1FIX_COMPAT_H_ */ diff --git a/libasn1fix/asn1fix_constr.c b/libasn1fix/asn1fix_constr.c new file mode 100644 index 00000000..2aa79827 --- /dev/null +++ b/libasn1fix/asn1fix_constr.c @@ -0,0 +1,364 @@ +#include "asn1fix_internal.h" + +static int _asn1f_check_if_tag_must_be_explicit(arg_t *arg, asn1p_expr_t *v); +static int _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b); + + +int +asn1f_fix_constr_ext(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + TQ_HEAD(asn1p_expr_t) root_list; + TQ_HEAD(asn1p_expr_t) ext_list; + TQ_HEAD(asn1p_expr_t) *cur_list; + int r_value = 0; + int ext_count = 0; + + switch(expr->expr_type) { + case ASN_CONSTR_SEQUENCE: + case ASN_CONSTR_SET: + case ASN_CONSTR_CHOICE: + break; + default: + return 0; + } + + DEBUG("%s(%s) for line %d", __func__, + expr->Identifier, expr->_lineno); + + TQ_INIT(&root_list); + TQ_INIT(&ext_list); + cur_list = (void *)&root_list; + + while((v = TQ_REMOVE(&(expr->members), next))) { + if(v->expr_type == A1TC_EXTENSIBLE) { + ext_count++; + switch(ext_count) { + case 1: cur_list = (void *)&ext_list; break; + case 2: + cur_list = (void *)&root_list; + if(v->value) { + FATAL("Optional extension marker " + "must not contain " + "an exception mark " + "at line %d", v->_lineno); + r_value = -1; + } + asn1p_expr_free(v); + continue; + case 3: + FATAL("Third extension marker " + "is not allowed at line %d", v->_lineno); + default: + r_value = -1; + } + } + + TQ_ADD(cur_list, v, next); + } + + /* + * Copy the root list and extension list back into the main list. + */ + TQ_HEAD_COPY(&(expr->members), &root_list); + while((v = TQ_REMOVE(&ext_list, next))) + TQ_ADD(&(expr->members), v, next); + + if(arg->mod->module_flags & MSF_EXTENSIBILITY_IMPLIED + && ext_count < 1) { + v = asn1p_expr_new(0); + if(v) { + v->Identifier = strdup("..."); + v->expr_type = A1TC_EXTENSIBLE; + v->meta_type = AMT_TYPE; + if(v->Identifier == NULL) { + asn1p_expr_free(v); + r_value = -1; + } else { + TQ_ADD(&(expr->members), v, next); + } + } else { + r_value = -1; + } + } + + return r_value; +} + + +int +asn1f_fix_constr_tag(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + int fl_impl_tags = 0; + int fl_auto_tags = 0; + int root_tagged = 0; /* The root component is manually tagged */ + int ext_tagged = 0; /* The extensions are manually tagged */ + int component_number = 0; + int r_value = 0; + + switch(expr->expr_type) { + case ASN_CONSTR_SEQUENCE: + case ASN_CONSTR_SET: + case ASN_CONSTR_CHOICE: + break; + default: + return 0; + } + + fl_impl_tags = (arg->mod->module_flags & MSF_IMPLICIT_TAGS); + fl_auto_tags = (arg->mod->module_flags & MSF_AUTOMATIC_TAGS); + + DEBUG("%s(%s) {%d, %d} for line %d", __func__, + expr->Identifier, fl_impl_tags, fl_auto_tags, expr->_lineno); + + TQ_FOR(v, &(expr->members), next) { + int must_explicit = 0; + + if(v->expr_type == A1TC_EXTENSIBLE) { + component_number++; + continue; + } + + if(v->tag.tag_class == TC_NOCLASS) { + continue; + } else { + switch(component_number) { + case 0: case 2: + root_tagged = 1; break; + default: + ext_tagged = 1; break; + } + } + + must_explicit = _asn1f_check_if_tag_must_be_explicit(arg, v); + + if(fl_impl_tags) { + if(v->tag.tag_mode != TM_EXPLICIT) { + if(must_explicit) + v->tag.tag_mode = TM_EXPLICIT; + else + v->tag.tag_mode = TM_IMPLICIT; + } + } else { + if(v->tag.tag_mode == TM_DEFAULT) { + v->tag.tag_mode = TM_EXPLICIT; + } + } + + /* + * Perform a final sanity check. + */ + if(must_explicit) { + if(v->tag.tag_mode == TM_IMPLICIT) { + FATAL("%s tagged in IMPLICIT mode " + "but must be EXPLICIT at line %d", + v->Identifier, v->_lineno); + r_value = -1; + } else { + v->tag.tag_mode = TM_EXPLICIT; + } + } + } + + if(ext_tagged && !root_tagged) { + FATAL("In %s at line %d: " + "extensions are tagged " + "but root components are not", + expr->Identifier, expr->_lineno); + r_value = -1; + } else if(!root_tagged && !ext_tagged && fl_auto_tags) { + expr->auto_tags_OK = 1; + } + + return r_value; +} + +int +asn1f_fix_constr_autotag(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + asn1_integer_t tag_value = 0; + int r_value = 0; + + switch(expr->expr_type) { + case ASN_CONSTR_SEQUENCE: + case ASN_CONSTR_SET: + case ASN_CONSTR_CHOICE: + if(expr->auto_tags_OK) + break; + /* Automatic tagging is not applicable */ + /* Fall through */ + default: + return 0; + } + + DEBUG("%s(%s) for line %d", __func__, + expr->Identifier, expr->_lineno); + + TQ_FOR(v, &(expr->members), next) { + int must_explicit; + + if(v->expr_type == A1TC_EXTENSIBLE) + break; + + assert(v->tag.tag_class == TC_NOCLASS); + + must_explicit = _asn1f_check_if_tag_must_be_explicit(arg, v); + + v->tag.tag_class = TC_CONTEXT_SPECIFIC; + v->tag.tag_mode = must_explicit ? TM_EXPLICIT : TM_IMPLICIT; + v->tag.tag_value = tag_value++; + } + + return r_value; +} + +/* + * Check that tags are distinct. + */ +int +asn1f_check_constr_tags_distinct(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *v; + int r_value = 0; + + switch(expr->expr_type) { + case ASN_CONSTR_SEQUENCE: + case ASN_CONSTR_SET: + case ASN_CONSTR_CHOICE: + break; + default: + return 0; + } + + TQ_FOR(v, &(expr->members), next) { + /* + * In every series of non-mandatory components, + * the tags must be distinct from each other AND the + * tag of the following mandatory component. + * For SET and CHOICE treat everything as a big set of + * non-mandatory components. + */ + if(expr->expr_type != ASN_CONSTR_SEQUENCE || v->marker) { + asn1p_expr_t *nv; + for(nv = v; (nv = TQ_NEXT(nv, next));) { + if(_asn1f_compare_tags(arg, v, nv)) + r_value = -1; + if(expr->expr_type == ASN_CONSTR_SEQUENCE + && !nv->marker) break; + } + } + } + + return r_value; +} + +static int +_asn1f_check_if_tag_must_be_explicit(arg_t *arg, asn1p_expr_t *v) { + asn1p_expr_t *reft; + + reft = asn1f_find_terminal_type(arg, v, 0); + if(reft) { + switch(reft->expr_type) { + case ASN_CONSTR_CHOICE: + return 1; + default: + return 0; + } + } + + return 0; +} + +/* + * Check that the tags are distinct. + */ +static int +_asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) { + struct asn1p_type_tag_s ta, tb; + int ra, rb; + int ret; + + ra = asn1f_fetch_tag(arg->asn, arg->mod, a, &ta); + rb = asn1f_fetch_tag(arg->asn, arg->mod, b, &tb); + + /* + * If both tags are explicitly or implicitly given, use them. + */ + if(ra == 0 && rb == 0) { + /* + * Simple case: fetched both tags. + */ + if(ta.tag_value == tb.tag_value + && ta.tag_class == tb.tag_class) { + char *p = (a->expr_type == A1TC_EXTENSIBLE) + ?"potentially ":""; + FATAL("Component \"%s\" at line %d %shas the same tag " + "with component \"%s\" at line %d", + a->Identifier, + a->_lineno, + p, + b->Identifier, + b->_lineno + ); + return -1; + } else { + /* Tags are distinct */ + return 0; + } + } + + /********************************************************** + * Now we must perform some very funny recursion to check + * multiple components of CHOICE type, etc. + */ + + DEBUG("Comparing tags %s:%x <-> %s:%x", + a->Identifier, a->expr_type, + b->Identifier, b->expr_type); + + if(a->meta_type == AMT_TYPEREF) { + asn1p_module_t *mod; + + DEBUG(" %s is a type reference", a->Identifier); + + a = asn1f_lookup_symbol(arg, a->reference, &mod); + if(!a) return 0; /* Already FATAL()'ed somewhere else */ + WITH_MODULE(mod, ret = _asn1f_compare_tags(arg, a, b)); + return ret; + } + + if(a->expr_type == ASN_CONSTR_CHOICE) { + asn1p_expr_t *v; + + DEBUG(" %s is a choice type (%d)", a->Identifier, a->_mark); + + /* + * Iterate over members of CHOICE. + */ + //if(a->_mark & TM_RECURSION) return 0; + TQ_FOR(v, &(a->members), next) { + //a->_mark |= TM_RECURSION; + ret = _asn1f_compare_tags(arg, v, b); + //a->_mark &= ~TM_RECURSION; + if(ret) return ret; + } + return 0; + } + + if(b->expr_type == ASN_CONSTR_CHOICE) { + return _asn1f_compare_tags(arg, b, a); + } + + if(a->_mark & TM_RECURSION) return 0; + if(b->_mark & TM_RECURSION) return 0; + a->_mark |= TM_RECURSION; + b->_mark |= TM_RECURSION; + ret = _asn1f_compare_tags(arg, b, a); + a->_mark &= ~TM_RECURSION; + b->_mark &= ~TM_RECURSION; + + return ret; +} + diff --git a/libasn1fix/asn1fix_constr.h b/libasn1fix/asn1fix_constr.h new file mode 100644 index 00000000..aeb05c0a --- /dev/null +++ b/libasn1fix/asn1fix_constr.h @@ -0,0 +1,24 @@ +#ifndef _ASN1FIX_CONSTRUCTED_H_ +#define _ASN1FIX_CONSTRUCTED_H_ + +/* + * Fix extensions in constructed types. + */ +int asn1f_fix_constr_ext(arg_t *); + +/* + * Fix tagging in constructed types. + */ +int asn1f_fix_constr_tag(arg_t *); + +/* + * Check distinctive tagging in constructed types. + */ +int asn1f_check_constr_tags_distinct(arg_t *); + +/* + * Perform automatic tagging. + */ +int asn1f_fix_constr_autotag(arg_t *); + +#endif /* _ASN1FIX_CONSTRUCTED_H_ */ diff --git a/libasn1fix/asn1fix_cstring.c b/libasn1fix/asn1fix_cstring.c new file mode 100644 index 00000000..b8a38833 --- /dev/null +++ b/libasn1fix/asn1fix_cstring.c @@ -0,0 +1,73 @@ +#include "asn1fix_internal.h" + +struct _cstring_pattern { + char *start; + int length; +}; +static int _asn1f_cstring_find_line_pattern(char *s, struct _cstring_pattern *); + +int +asn1f_fix_cstring(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + int r_value = 0; + + if(expr->value && expr->value->type == ATV_STRING) { + struct _cstring_pattern cp; + char *buf = expr->value->value.string.buf; + int buflen = expr->value->value.string.size; + int start = 0; + + DEBUG("%s(%s) for line %d", __func__, + expr->Identifier, expr->_lineno); + + while(_asn1f_cstring_find_line_pattern(buf + start, &cp)) { + assert(cp.length); + memmove(cp.start, cp.start + cp.length, + buflen - ((cp.start + cp.length) - buf)); + buflen -= cp.length; + start = cp.start - buf; + buf[buflen] = '\0'; + } + } + + return r_value; +} + +/* + * If a string has a newline, the tabulation and spaces before and + * after it must be eliminated. + */ +static int +_asn1f_cstring_find_line_pattern(char *s, struct _cstring_pattern *cp) { + int newline_found = 0; + + cp->start = NULL; + + for(;;s++) { + switch(*s) { + case '\r': case '\n': + newline_found = 1; + /* Fall through */ + case ' ': case '\t': + if(cp->start == NULL) + cp->start = s; + continue; + case '\0': + default: + if(newline_found) { + cp->length = s - cp->start; + return 1; + } + + cp->start = NULL; + if(*s == '\0') + break; + continue; + } + break; + } + + return 0; +} + + diff --git a/libasn1fix/asn1fix_cstring.h b/libasn1fix/asn1fix_cstring.h new file mode 100644 index 00000000..bd647abe --- /dev/null +++ b/libasn1fix/asn1fix_cstring.h @@ -0,0 +1,6 @@ +#ifndef _ASN1FIX_CSTRING_H_ +#define _ASN1FIX_CSTRING_H_ + +int asn1f_fix_cstring(arg_t *); + +#endif /* _ASN1FIX_CSTRING_H_ */ diff --git a/libasn1fix/asn1fix_dereft.c b/libasn1fix/asn1fix_dereft.c new file mode 100644 index 00000000..f0ec9a6c --- /dev/null +++ b/libasn1fix/asn1fix_dereft.c @@ -0,0 +1,68 @@ +#include "asn1fix_internal.h" + +int +asn1f_fix_dereference_types(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *type_expr; + int r_value = 0; + + if(expr->expr_type == A1TC_PARAMETRIZED) + return asn1f_fix_parametrized_assignment(arg); + + if(expr->expr_type != A1TC_REFERENCE + || expr->meta_type != AMT_TYPEREF) { + //assert(expr->reference == 0); + return 0; /* Just ignore it */ + } + + DEBUG("%s(\"%s\":%x ::= \"%s\") for line %d", + __func__, expr->Identifier, expr->expr_type, + asn1f_printable_value(expr->value), + expr->_lineno); + + assert(TQ_FIRST(&(expr->members)) == 0); + assert(expr->reference); + + /* + * Follow the reference. + */ + type_expr = asn1f_find_terminal_type(arg, expr, 0); + if(type_expr == NULL) { + FATAL("Unknown type \"%s\" referenced by \"%s\" at line %d", + asn1f_printable_reference(expr->reference), + expr->Identifier, expr->_lineno); + return -1; + } + + /* + * Copying members of the source expression + * into the current expression. + */ + if(0) { + asn1p_expr_t *tmp_clone; + + tmp_clone = asn1p_expr_clone(type_expr); + if(tmp_clone == NULL) { + FATAL("Could not clone \"%s\" at line %d", + type_expr->Identifier, type_expr->_lineno); + return -1; + } + + /* + * Replace the referenced type with its definition. + */ + DEBUG("\tChanging type of \"%s\":%x to %x for line %d", + expr->Identifier, + expr->expr_type, + type_expr->expr_type, + expr->_lineno + ); + expr->expr_type = type_expr->expr_type; + expr->members = tmp_clone->members; + memset(&tmp_clone->members, 0, sizeof(tmp_clone->members)); + asn1p_expr_free(tmp_clone); + } + + return r_value; +} + diff --git a/libasn1fix/asn1fix_dereft.h b/libasn1fix/asn1fix_dereft.h new file mode 100644 index 00000000..bee8151a --- /dev/null +++ b/libasn1fix/asn1fix_dereft.h @@ -0,0 +1,6 @@ +#ifndef _ASN1FIX_DEREFT_H_ +#define _ASN1FIX_DEREFT_H_ + +int asn1f_fix_dereference_types(arg_t *); + +#endif /* _ASN1FIX_DEREFT_H_ */ diff --git a/libasn1fix/asn1fix_derefv.c b/libasn1fix/asn1fix_derefv.c new file mode 100644 index 00000000..7be9d6d2 --- /dev/null +++ b/libasn1fix/asn1fix_derefv.c @@ -0,0 +1,56 @@ +#include "asn1fix_internal.h" + +/* + * Dereference DefinedValues: + */ +int +asn1f_fix_dereference_values(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + int r_value = 0; + + if(expr->meta_type != AMT_VALUE) + return 0; /* Just ignore it */ + + if(expr->value == NULL) + return 0; /* Just ignore it */ + + if(expr->value && expr->value->type != ATV_REFERENCED) + return 0; /* Not a reference */ + + DEBUG("%s(%s %x ::= %s) for line %d", __func__, + expr->Identifier, expr->expr_type, + asn1f_printable_value(expr->value), expr->_lineno); + + /* + * If this integer has a value, check that this value + * is an integer. If it is a reference, resolve it. + */ + if(expr->value) { + + if(asn1f_value_resolve(arg, expr)) { + /* This function will emit messages */ + r_value = -1; + } + + if(expr->value->type != ATV_INTEGER) { + FATAL( + "INTEGER value %s at line %d: " + "Incompatible value specified: %s", + expr->Identifier, + expr->_lineno, + asn1f_printable_value(expr->value) + ); + r_value = -1; + } + } else { + FATAL("Value of \"%s\" at line %d: " + "Incompatible value specified", + expr->Identifier, + expr->_lineno + ); + r_value = -1; + } + + return r_value; +} + diff --git a/libasn1fix/asn1fix_derefv.h b/libasn1fix/asn1fix_derefv.h new file mode 100644 index 00000000..93153851 --- /dev/null +++ b/libasn1fix/asn1fix_derefv.h @@ -0,0 +1,6 @@ +#ifndef _ASN1FIX_DEREFV_H_ +#define _ASN1FIX_DEREFV_H_ + +int asn1f_fix_dereference_values(arg_t *); + +#endif /* _ASN1FIX_DEREFV_H_ */ diff --git a/libasn1fix/asn1fix_enum.c b/libasn1fix/asn1fix_enum.c new file mode 100644 index 00000000..8a90a435 --- /dev/null +++ b/libasn1fix/asn1fix_enum.c @@ -0,0 +1,136 @@ +#include "asn1fix_internal.h" + +/* + * Check the validity of an enumeration. + */ +int +asn1f_fix_enum(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *ev; + asn1_integer_t max_value = -1; + int rvalue = 0; + asn1p_expr_t *ext_marker = NULL; /* "..." position */ + int ret; + + if(expr->expr_type != ASN_BASIC_ENUMERATED) + return 0; /* Just ignore it */ + + DEBUG("%s(%s)", __func__, expr->Identifier); + + /* + * 1. Scan the enumeration values in search for inconsistencies. + */ + TQ_FOR(ev, &(expr->members), next) { + asn1_integer_t eval; + + if(ev->value) + DEBUG("\tItem %s(%s)", ev->Identifier, + asn1f_printable_value(ev->value)); + else + DEBUG("\tItem %s", ev->Identifier); + + /* + * 1.1 Found an extension mark "...", check correctness. + */ + if(ev->expr_type == A1TC_EXTENSIBLE) { + if(ext_marker) { + arg->eh(1, + "Enumeration %s at line %d: " + "Second extension marker is not allowed", + expr->Identifier, + ev->_lineno); + rvalue = -1; + } else { + /* + * Remember the marker's position. + */ + ext_marker = ev; + } + continue; + } else if(ev->Identifier == NULL + || ev->expr_type != A1TC_UNIVERVAL) { + FATAL( + "Enumeration %s at line %d: " + "Unsupported enumeration element %s", + expr->Identifier, + ev->_lineno, + ev->Identifier?ev->Identifier:""); + rvalue = -1; + continue; + } + + /* + * 1.2 Compute the value of the enumeration element. + */ + if(ev->value) { + switch(ev->value->type) { + case ATV_INTEGER: + eval = ev->value->value.v_integer; + break; + case ATV_REFERENCED: + FATAL("HERE HERE HERE", 1); + rvalue = -1; + continue; + break; + default: + FATAL("ENUMERATED type %s at line %d " + "contain element %s(%s) at line %d", + expr->Identifier, expr->_lineno, + ev->Identifier, + asn1f_printable_value(ev->value), + ev->_lineno); + rvalue = -1; + continue; + } + } else { + eval = max_value + 1; + ev->value = asn1p_value_fromint(eval); + if(ev->value == NULL) { + rvalue = -1; + continue; + } + } + + /* + * 1.3 Check the applicability of this value. + */ + if(eval <= max_value) { + if(ext_marker) { + /* + * Enumeration is allowed to be unordered + * before the first marker. + */ + FATAL( + "Enumeration %s at line %d: " + "Explicit value \"%s(%lld)\" " + "is not greater " + "than previous values (max %lld)", + expr->Identifier, + ev->_lineno, + ev->Identifier, + eval, + max_value); + rvalue = -1; + } + } else if(eval > max_value) { + max_value = eval; + } + + /* + * 1.4 Check that all identifiers before the current one + * differs from it. + */ + ret = asn1f_check_unique_expr_child(arg, ev, NULL); + RET2RVAL(ret, rvalue); + } + + + /* + * 2. Reorder the first half (before optional "...") of the + * identifiers alphabetically. + */ + // TODO + + return rvalue; +} + diff --git a/libasn1fix/asn1fix_enum.h b/libasn1fix/asn1fix_enum.h new file mode 100644 index 00000000..14c6fb52 --- /dev/null +++ b/libasn1fix/asn1fix_enum.h @@ -0,0 +1,6 @@ +#ifndef _ASN1FIX_ENUM_H_ +#define _ASN1FIX_ENUM_H_ + +int asn1f_fix_enum(arg_t *); /* Enumeration ::= ENUMERATED { a(1), b(2) } */ + +#endif /* _ASN1FIX_ENUM_H_ */ diff --git a/libasn1fix/asn1fix_export.c b/libasn1fix/asn1fix_export.c new file mode 100644 index 00000000..d6bb37b4 --- /dev/null +++ b/libasn1fix/asn1fix_export.c @@ -0,0 +1,48 @@ +#include "asn1fix_internal.h" +#include "asn1fix_export.h" + +asn1p_expr_t * +asn1f_lookup_symbol_ex( + asn1p_t *asn, + asn1p_module_t **module_rw, + asn1p_expr_t *expr, + asn1p_ref_t *ref) { + arg_t arg; + + memset(&arg, 0, sizeof(arg)); + + arg.asn = asn; + arg.mod = *module_rw; + arg.expr = expr; + + return asn1f_lookup_symbol(&arg, ref, module_rw); +} + +asn1p_expr_t * +asn1f_class_access_ex(asn1p_t *asn, + asn1p_module_t *mod, + asn1p_expr_t *expr, + asn1p_ref_t *ref, + asn1p_module_t **mod_r) { + static arg_t arg; + + arg.asn = asn; + arg.mod = mod; + arg.expr = expr; + + return asn1f_class_access(&arg, ref, mod_r); +} + +asn1p_expr_t * +asn1f_find_terminal_type_ex(asn1p_t *asn, + asn1p_module_t *mod, + asn1p_expr_t *expr, + asn1p_module_t **mod_r) { + static arg_t arg; + + arg.asn = asn; + arg.mod = mod; + arg.expr = expr; + + return asn1f_find_terminal_type(&arg, expr, mod_r); +} diff --git a/libasn1fix/asn1fix_export.h b/libasn1fix/asn1fix_export.h new file mode 100644 index 00000000..2ade0c9a --- /dev/null +++ b/libasn1fix/asn1fix_export.h @@ -0,0 +1,32 @@ +/* + * This header exports fixer procedures that are common enough to be used + * in other modules. + */ +#ifndef _ASN1FIX_EXPORT_H_ +#define _ASN1FIX_EXPORT_H_ + +#include + +/* + * Exportable version of an asn1f_lookup_symbol(). + */ +asn1p_expr_t *asn1f_lookup_symbol_ex( + asn1p_t *asn, + asn1p_module_t **module_rw, + asn1p_expr_t *expr, + asn1p_ref_t *ref); + +/* + * Exportable version of an asn1f_class_access(). + */ +asn1p_expr_t *asn1f_class_access_ex(asn1p_t *asn, asn1p_module_t *mod, + asn1p_expr_t *expr, asn1p_ref_t *, asn1p_module_t **mod_r); + +/* + * Exportable version of asn1f_find_terminal_type(). + */ +asn1p_expr_t *asn1f_find_terminal_type_ex(asn1p_t *asn, asn1p_module_t *mod, + asn1p_expr_t *tc, asn1p_module_t **opt_module_r); + +#endif /* _ASN1FIX_EXPORT_H_ */ + diff --git a/libasn1fix/asn1fix_integer.c b/libasn1fix/asn1fix_integer.c new file mode 100644 index 00000000..514ab70e --- /dev/null +++ b/libasn1fix/asn1fix_integer.c @@ -0,0 +1,161 @@ +#include "asn1fix_internal.h" + +static int _compare_value(asn1p_expr_t *expr1, asn1p_expr_t *expr2) { + if(expr2->value->type == ATV_INTEGER + && expr1->value->type == ATV_INTEGER) { + return expr2->value->value.v_integer + - expr1->value->value.v_integer; + } else { + return -1; + } +} + +/* + * Check the validity of an INTEGER type. + */ +int +asn1f_fix_integer(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *iv; + int rvalue = 0; + int ret; + + if(expr->expr_type != ASN_BASIC_INTEGER) + return 0; /* Just ignore it */ + + DEBUG("%s(\"%s\", %x) for line %d", __func__, + expr->Identifier, expr->expr_type, expr->_lineno); + + /* + * Scan the integer values in search for inconsistencies. + */ + TQ_FOR(iv, &(expr->members), next) { + + DEBUG("\tItem %s(%s)", iv->Identifier, + asn1f_printable_value(iv->value)); + + /* + * Found "...", check correctness. + */ + if(iv->expr_type == A1TC_EXTENSIBLE) { + arg->eh(1, + "INTEGER %s at line %d: " + "Extension marker is not allowed", + expr->Identifier, + iv->_lineno + ); + rvalue = -1; + continue; + } + + if(iv->Identifier == NULL + || iv->expr_type != A1TC_UNIVERVAL) { + arg->eh(1, + "INTEGER %s at line %d: " + "Unsupported enumeration element %s", + expr->Identifier, + iv->_lineno, + iv->Identifier?iv->Identifier:"" + ); + rvalue = -1; + continue; + } + + if(iv->value == NULL) { + arg->eh(1, + "INTEGER %s at line %d: " + "Value for the identifier %s " + "must be set explicitly", + expr->Identifier, + iv->_lineno, + iv->Identifier + ); + rvalue = -1; + continue; + } else if(iv->value->type == ATV_REFERENCED) { + /* + * Resolve the value, once and for all. + */ + if(asn1f_value_resolve(arg, iv)) { + /* This function will emit messages */ + rvalue = -1; + continue; + } + } + + if(iv->value->type != ATV_INTEGER) { + arg->eh(1, + "INTEGER %s at line %d: " + "Value for the identifier %s " + "is not compatible with INTEGER type", + expr->Identifier, + iv->_lineno); + rvalue = -1; + continue; + } + + /* + * Check that all identifiers are distinct. + */ + ret = asn1f_check_unique_expr_child(arg, iv, NULL); + RET2RVAL(ret, rvalue); + /* + * Check that all values are distinct. + */ + ret = asn1f_check_unique_expr_child(arg, iv, _compare_value); + RET2RVAL(ret, rvalue); + } + + + return rvalue; +} + +static int +_asn1f_make_sure_type_is(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_type_e type) { + asn1p_module_t *mod = NULL; + asn1p_expr_t *next_expr; + int expr_type; + int ret; + + expr_type = expr->expr_type; + + /* + * Here we're trying to make sure that the type of the given + * expression is really what is expected. + * This is ensured in two ways. + * First, if the immediate type matches the provided one, + * this is a clear hit. + */ + if(expr_type == type) + return 0; + + /* + * Otherwise, it must be either a reference or a different type. + */ + if(expr_type != A1TC_REFERENCE) { + errno = EPERM; + return -1; + } + + assert(expr_type == A1TC_REFERENCE); + assert(expr->reference); + + /* + * Then, it is a reference. For a reference, try to resolve type + * and try again. + */ + next_expr = asn1f_lookup_symbol(arg, expr->reference, &mod); + if(next_expr == NULL) { + errno = ESRCH; + return -1; + } + + /* + * If symbol is here, recursively check that it conforms to the type. + */ + WITH_MODULE(mod, ret = _asn1f_make_sure_type_is(arg, next_expr, type)); + + return ret; +} + + diff --git a/libasn1fix/asn1fix_integer.h b/libasn1fix/asn1fix_integer.h new file mode 100644 index 00000000..d306fc03 --- /dev/null +++ b/libasn1fix/asn1fix_integer.h @@ -0,0 +1,6 @@ +#ifndef _ASN1FIX_INTEGER_H_ +#define _ASN1FIX_INTEGER_H_ + +int asn1f_fix_integer(arg_t *); /* Type1 ::= INTEGER { a(1), b(2) } */ + +#endif /* _ASN1FIX_INTEGER_H_ */ diff --git a/libasn1fix/asn1fix_internal.h b/libasn1fix/asn1fix_internal.h new file mode 100644 index 00000000..ff3b4e96 --- /dev/null +++ b/libasn1fix/asn1fix_internal.h @@ -0,0 +1,106 @@ +#ifndef _ASN1FIX_INTERNAL_H_ +#define _ASN1FIX_INTERNAL_H_ + +/* + * System headers required in various modules. + */ +#include +#include +#include +#include /* isupper() */ +#include +#include + +#include /* Our lovely ASN.1 parser module */ + +/* + * A definition of a function that will log error messages. + */ +typedef void (*error_logger_f)(int _is_fatal, const char *fmt, ...); + +/* + * Universal argument. + */ +typedef struct arg_s { + asn1p_t *asn; + asn1p_module_t *mod; + asn1p_expr_t *expr; + error_logger_f eh; + error_logger_f debug; + void *key; /* The next level key */ +} arg_t; + +/* + * Functions performing normalization of various types. + */ +#include "asn1fix_misc.h" /* Support functions */ +#include "asn1fix_value.h" /* Value processing */ +#include "asn1fix_cstring.h" /* Fix cstring values */ +#include "asn1fix_compat.h" /* Data compatibility */ +#include "asn1fix_constr.h" /* Constructed types */ +#include "asn1fix_class.h" /* CLASS support */ +#include "asn1fix_param.h" /* Parametrization */ +#include "asn1fix_retrieve.h" /* Data retrieval */ +#include "asn1fix_enum.h" /* Process ENUMERATED */ +#include "asn1fix_integer.h" /* Process INTEGER */ +#include "asn1fix_bitstring.h" /* Process BIT STRING */ +#include "asn1fix_dereft.h" /* Dereference types */ +#include "asn1fix_derefv.h" /* Dereference values */ +#include "asn1fix_tags.h" /* Tags-related stuff */ + + +/* + * Merge the return value of the called function with the already + * partially computed return value of the current function. + */ +#define RET2RVAL(ret,rv) do { \ + int __ret = ret; \ + switch(__ret) { \ + case 0: break; \ + case 1: if(rv) break; \ + case -1: rv = __ret; break; \ + default: \ + assert(__ret >= -1 && __ret <= 1); \ + rv = -1; \ + } \ + } while(0) + +/* + * Temporary substitute module for the purposes of evaluating expression. + */ +#define WITH_MODULE(tmp_mod, expr) do { \ + void *_saved_mod = arg->mod; \ + arg->mod = tmp_mod; \ + do { expr; } while(0); \ + arg->mod = _saved_mod; \ + } while(0) + +#define LOG(code, fmt, args...) do { \ + int _save_errno = errno; \ + if(code < 0) { \ + if(arg->debug) \ + arg->debug(code, fmt, ##args); \ + } else { \ + arg->eh(code, fmt " in %s", ##args, \ + arg->mod->source_file_name); \ + } \ + errno = _save_errno; \ + } while(0) + +#define DEBUG(fmt, args...) LOG(-1, fmt, ##args) +#define FATAL(fmt, args...) LOG( 1, fmt, ##args) +#define WARNING(fmt, args...) LOG( 0, fmt, ##args) + + +/* + * Define the symbol corresponding to the name of the current function. + */ +#if __STDC_VERSION__ < 199901 +#if !(__GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3) +#define __func__ (char *)0 /* Name of the current function */ +#endif /* GNUC */ +/* __func__ is supposed to be defined */ +#endif + + +#endif /* _ASN1FIX_INTERNAL_H_ */ diff --git a/libasn1fix/asn1fix_misc.c b/libasn1fix/asn1fix_misc.c new file mode 100644 index 00000000..5fe69034 --- /dev/null +++ b/libasn1fix/asn1fix_misc.c @@ -0,0 +1,276 @@ +#include "asn1fix_internal.h" + + +char const * +asn1f_printable_reference(asn1p_ref_t *ref) { + if(ref) { + asn1p_value_t v; + + v.type = ATV_REFERENCED; + v.value.reference = ref; + + return asn1f_printable_value(&v); + } else { + return ""; + } +} + +char const * +asn1f_printable_value(asn1p_value_t *v) { + static char buf[128]; + static char *managedptr; + static int managedptr_len; + int ret; + +#define ENSURE(len) do { \ + if(len >= managedptr_len) { \ + if(managedptr) \ + free(managedptr); \ + managedptr = malloc(len + 1); \ + if(managedptr) { \ + managedptr_len = len; \ + } else { \ + managedptr_len = 0; \ + return ""; \ + } \ + } \ + } while(0) + + if(v == NULL) + return ""; + + switch(v->type) { + case ATV_NOVALUE: + return ""; + case ATV_REFERENCED: + { + asn1p_ref_t *ref; + char reflen; + char *ptr; + int i; + + assert(v->value.reference); + ref = v->value.reference; + reflen = ref->comp_count; /* Number of dots */ + for(i = 0; i < ref->comp_count; i++) + reflen += strlen(ref->components[i].name); + /* + * Make sure we have a buffer of this size. + */ + ENSURE(reflen); + + /* + * Fill-up the buffer. + */ + ptr = managedptr; + for(i = 0; i < ref->comp_count; i++) { + char *nc; + if(i) *ptr++ = '.'; + for(nc = ref->components[i].name; *nc; nc++) + *ptr++ = *nc; + } + *ptr++ = '\0'; + assert(reflen == (ptr - managedptr)); + return managedptr; + } + case ATV_REAL: + ret = snprintf(buf, sizeof(buf), "%f", v->value.v_double); + if(ret >= sizeof(buf)) + memcpy(buf + sizeof(buf) - 4, "...", 4); + return buf; + case ATV_INTEGER: + ret = snprintf(buf, sizeof(buf), "%lld", + (long long)v->value.v_integer); + if(ret >= sizeof(buf)) + memcpy(buf + sizeof(buf) - 4, "...", 4); + return buf; + case ATV_MIN: return "MIN"; + case ATV_MAX: return "MAX"; + case ATV_FALSE: return "FALSE"; + case ATV_TRUE: return "TRUE"; + case ATV_STRING: + case ATV_UNPARSED: + /* Buffer is guaranteed to be null-terminated */ + assert(v->value.string.buf[v->value.string.size] == '\0'); + return v->value.string.buf; + case ATV_BITVECTOR: + { + uint8_t *bitvector; + char *ptr; + int len; + int i; + /* + * Compute number of bytes necessary + * to represend the binary value. + */ + int bits = v->value.binary_vector.size_in_bits; + len = ((bits%8)?bits:(bits >> 2)) + sizeof("''H"); + /* + * Reallocate managed buffer + */ + ENSURE(len); + + /* + * Fill the buffer. + */ + ptr = managedptr; + bitvector = v->value.binary_vector.bits; + *ptr++ = '\''; + if(bits%8) { + /* + * Dump bit by bit. + */ + for(i = 0; i < bits; i++) { + uint8_t uc; + uc = bitvector[i>>3]; + *ptr++ = ((uc >> (7-(i%8)))&1)?'1':'0'; + } + } else { + char hextable[16] = "0123456789ABCDEF"; + /* + * Dump byte by byte. + */ + for(i = 0; i < (bits >> 3); i++) { + *ptr++ = hextable[bitvector[i] >> 4]; + *ptr++ = hextable[bitvector[i] & 0x0f]; + } + } + *ptr++ = '\''; + *ptr++ = (bits%8)?'B':'H'; + *ptr++ = 'H'; + assert((ptr - managedptr) == len); + return managedptr; + } + } + + return ""; +} + + +/* + * Recursively invoke a given function over the given expr and all its + * children. + */ +int +asn1f_recurse_expr(arg_t *arg, int (*callback)(arg_t *arg)) { + asn1p_expr_t *expr = arg->expr; + int rvalue = 0; + int ret; + + assert(expr); + + /* + * Invoke the callback at this very level. + */ + ret = callback(arg); + RET2RVAL(ret, rvalue); + + /* + * Recursively invoke myself + * to iterate over each element in the tree. + */ + TQ_FOR(arg->expr, &(expr->members), next) { + assert(arg->expr->expr_type != A1TC_INVALID); + ret = asn1f_recurse_expr(arg, callback); + RET2RVAL(ret, rvalue); + } + + arg->expr = expr; /* Restore original position */ + + return rvalue; +} + + +/* + * Check that every child of a given expr has unique name or does not have any. + */ +int +asn1f_check_unique_expr(arg_t *arg, + int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b)) { + asn1p_expr_t *expr; + int rvalue = 0; + + TQ_FOR(expr, &(arg->expr->members), next) { + if(expr->Identifier) { + int ret = asn1f_check_unique_expr_child(arg, expr, + opt_compare); + if(ret) rvalue = -1; + } else { + /* + * No point of comparing this child with any other: + * this one does not have a name. + */ + } + } + + return rvalue; +} + +/* + * Check that every preceeding child of the given expr is not + * having the name of the given one. + */ +int +asn1f_check_unique_expr_child(arg_t *arg, asn1p_expr_t *child, + int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b)) { + asn1p_expr_t *expr; + int rvalue = 0; + + assert(child); + assert(opt_compare || child->Identifier); + + TQ_FOR(expr, &(arg->expr->members), next) { + int ret; + + if(expr == child) + break; + + /* + * Compare according to the custom rule or default + * names comparisons. + */ + if(opt_compare) { + ret = opt_compare(expr, child); + } else { + if(expr->Identifier == NULL + || expr->expr_type == A1TC_EXTENSIBLE) + continue; + ret = strcasecmp(expr->Identifier, child->Identifier); + } + + if(ret == 0) { + char *msg; + msg = opt_compare + ?"Expressions clash" + :"Identifiers name clash"; + arg->eh(1, + "%s: " + "\"%s\" at line %d has similar %s with " + "\"%s\" at line %d", + msg, + expr->Identifier, + expr->_lineno, + opt_compare?"property":"name", + child->Identifier, + child->_lineno + ); + + rvalue = -1; + } + } + + return rvalue; +} + +int +asn1f_count_children(asn1p_expr_t *expr) { + asn1p_expr_t *child; + int count = 0; + + TQ_FOR(child, &(expr->members), next) { + count++; + } + + return count; +} + diff --git a/libasn1fix/asn1fix_misc.h b/libasn1fix/asn1fix_misc.h new file mode 100644 index 00000000..e88e4322 --- /dev/null +++ b/libasn1fix/asn1fix_misc.h @@ -0,0 +1,47 @@ +/* + * Miscellaneous functions necessary for several other modules. + */ +#ifndef _ASN1FIX_MISC_H_ +#define _ASN1FIX_MISC_H_ + +/* + * Return a pointer to the locally held string with human-readable + * definition of the value. + */ +char const *asn1f_printable_value(asn1p_value_t *); + +/* + * Return a pointer to the locally held string with human-readable + * definition of the reference. + */ +char const *asn1f_printable_reference(asn1p_ref_t *); + +/* + * Recursively invoke a given function over the given expr and all its + * children. + */ +int asn1f_recurse_expr(arg_t *arg, int (*f)(arg_t *arg)); + +/* + * Check that every child of a given expr has unique name or does not have any. + * If opt_compare == NULL, the default comparison of the argument's + * names (identifiers) will be performed. + */ +int asn1f_check_unique_expr(arg_t *arg, + int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b)); + +/* + * Check that every preceeding child of the given expr is not + * having the name of the given one. + * If opt_compare == NULL, the default comparison of the argument's + * names (identifiers) will be performed. + */ +int asn1f_check_unique_expr_child(arg_t *arg, asn1p_expr_t *child, + int (*opt_compare)(asn1p_expr_t *a, asn1p_expr_t *b)); + +/* + * Return number of children. + */ +int asn1f_count_children(asn1p_expr_t *parent); + +#endif /* _ASN1FIX_MISC_H_ */ diff --git a/libasn1fix/asn1fix_param.c b/libasn1fix/asn1fix_param.c new file mode 100644 index 00000000..0c838cc5 --- /dev/null +++ b/libasn1fix/asn1fix_param.c @@ -0,0 +1,165 @@ +#include "asn1fix_internal.h" + +static int asn1f_parametrize(arg_t *arg, asn1p_expr_t *ex, asn1p_expr_t *ptype); +static int asn1f_param_process_recursive(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *ptype, asn1p_expr_t *actargs); +static asn1p_expr_t *_referenced_argument(asn1p_ref_t *ref, asn1p_expr_t *ptype, asn1p_expr_t *actargs); + +int +asn1f_fix_parametrized_assignment(arg_t *arg) { + asn1p_expr_t *expr = arg->expr; + asn1p_expr_t *ptype; + + assert(expr->expr_type == A1TC_PARAMETRIZED); + assert(expr->reference); + + DEBUG("%s(\"%s\" ::= \"%s\" { %s }) for line %d", + __func__, expr->Identifier, + asn1f_printable_reference(expr->reference), + asn1f_printable_value(expr->value), + expr->_lineno); + + /* + * Find the corresponding parametrized type definition. + */ + DEBUG("Looking for parametrized type definition \"%s\"", + asn1f_printable_reference(expr->reference)); + ptype = asn1f_lookup_symbol(arg, expr->reference, 0); + if(ptype == NULL) { + DEBUG("%s: missing parametrized type declaration", + asn1f_printable_reference(expr->reference)); + return -1; + } + + /* + * Check that the number of arguments which are expected by + * the parametrized type declaration is consistent with the + * number of arguments supplied by the parametrized assignment. + */ + if(asn1f_count_children(expr) != ptype->params->params_count) { + FATAL("Number of actual arguments %d in %s at line %d " + "is not equal to number of expected arguments " + "%d in %s at line %d", + asn1f_count_children(expr), + asn1f_printable_reference(expr->reference), + expr->_lineno, + ptype->params->params_count, + ptype->Identifier, + ptype->_lineno + ); + return -1; + } + + /* + * Perform an expansion of a parametrized assignment. + */ + return asn1f_parametrize(arg, expr, ptype); +} + +#define SUBSTITUTE(to, from) do { \ + asn1p_expr_t tmp; \ + tmp = *(to); \ + *(to) = *(from); \ + *(from) = tmp; \ + (to)->next = tmp.next; \ + memset(&((from)->next), 0, \ + sizeof((from)->next)); \ + asn1p_expr_free(from); \ + } while(0) + +static int +asn1f_parametrize(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *ptype) { + asn1p_expr_t *nex; + void *p; + int ret; + + /* + * The algorithm goes like that: + * 1. Replace the expression's type with parametrized type. + * 2. For every child in the parametrized type, import it + * as a child of the expression, replacing all occurences of + * symbols which are defined as parametrized type arguments + * with the actual values. + */ + + nex = asn1p_expr_clone(ptype); + if(nex == NULL) return -1; + + /* + * Cleanup the new expression so there is no ptype-related + * stuff hanging around. + */ + p = strdup(expr->Identifier); + if(p) { + free(nex->Identifier); + nex->Identifier = p; + } else { + asn1p_expr_free(nex); + return -1; + } + asn1p_paramlist_free(nex->params); + nex->params = NULL; + nex->meta_type = expr->meta_type; + + ret = asn1f_param_process_recursive(arg, nex, ptype, expr); + if(ret != 0) { + asn1p_expr_free(nex); + return ret; + } + + SUBSTITUTE(expr, nex); + + return ret; +} + +static int +asn1f_param_process_recursive(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *ptype, asn1p_expr_t *actargs) { + asn1p_expr_t *child; + + TQ_FOR(child, &(expr->members), next) { + asn1p_expr_t *ra; + asn1p_expr_t *ne; + + ra = _referenced_argument(child->reference, ptype, actargs); + if(ra == NULL) continue; + + DEBUG("Substituting parameter for %s %s at line %d", + child->Identifier, + asn1f_printable_reference(child->reference), + child->_lineno + ); + + assert(child->meta_type == AMT_TYPEREF); + assert(child->expr_type == A1TC_REFERENCE); + + ne = asn1p_expr_clone(ra); + if(ne == NULL) return -1; + assert(ne->Identifier == 0); + ne->Identifier = strdup(child->Identifier); + if(ne->Identifier == 0) { + asn1p_expr_free(ne); + return -1; + } + SUBSTITUTE(child, ne); + } + + return 0; +} + +static asn1p_expr_t * +_referenced_argument(asn1p_ref_t *ref, asn1p_expr_t *ptype, asn1p_expr_t *actargs) { + asn1p_expr_t *aa; + int i; + + if(ref == NULL || ref->comp_count != 1) + return NULL; + + aa = TQ_FIRST(&(actargs->members)); + for(i = 0; i < ptype->params->params_count; + i++, aa = TQ_NEXT(aa, next)) { + if(strcmp(ref->components[0].name, + ptype->params->params[i].argument) == 0) + return aa; + } + + return NULL; +} diff --git a/libasn1fix/asn1fix_param.h b/libasn1fix/asn1fix_param.h new file mode 100644 index 00000000..062ad8bd --- /dev/null +++ b/libasn1fix/asn1fix_param.h @@ -0,0 +1,6 @@ +#ifndef _ASN1FIX_PARAMETRIZATION_H_ +#define _ASN1FIX_PARAMETRIZATION_H_ + +int asn1f_fix_parametrized_assignment(arg_t *arg); + +#endif /* _ASN1FIX_PARAMETRIZATION_H_ */ diff --git a/libasn1fix/asn1fix_retrieve.c b/libasn1fix/asn1fix_retrieve.c new file mode 100644 index 00000000..0dfcce40 --- /dev/null +++ b/libasn1fix/asn1fix_retrieve.c @@ -0,0 +1,366 @@ +#include "asn1fix_internal.h" + +static asn1p_expr_t *asn1f_find_terminal_thing(arg_t *arg, asn1p_expr_t *expr, asn1p_module_t **optm, int type_or_value); +static int asn1f_compatible_with_exports(arg_t *arg, asn1p_module_t *mod, const char *name); + + +/* + * Lookup a child by its name. + */ +asn1p_expr_t * +asn1f_lookup_child(asn1p_expr_t *tc, const char *name) { + asn1p_expr_t *child_tc; + + TQ_FOR(child_tc, &(tc->members), next) { + if(child_tc->Identifier + && strcmp(child_tc->Identifier, name) == 0) { + return child_tc; + } + } + + errno = ESRCH; + return NULL; +} + +asn1p_module_t * +asn1f_lookup_in_imports(arg_t *arg, const char *name) { + asn1p_module_t *mod; + asn1p_xports_t *xp; + asn1p_expr_t *tc; + + /* + * Search in which exactly module this name is defined. + */ + TQ_FOR(xp, &(arg->mod->imports), xp_next) { + TQ_FOR(tc, &(xp->members), next) { + if(strcmp(name, tc->Identifier) == 0) + break; + } + if(tc) break; + } + if(xp == NULL) { + errno = ESRCH; + return NULL; + } + + /* + * Okay, right now we have a module name and, hopefully, an OID. + * Search the arg->asn for the specified module. + */ + mod = asn1f_lookup_module(arg, xp->from, xp->from_oid); + if(mod == NULL) { + /* ENOENT/ETOOMANYREFS */ + return NULL; + } + + /* + * Check that the EXPORTS section of this module contains + * the symbol we care about, or it is EXPORTS ALL. + */ + if(asn1f_compatible_with_exports(arg, mod, name)) { + errno = EPERM; + return NULL; + } + + return mod; +} + +asn1p_module_t * +asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) { + asn1p_module_t *mod; + + assert(module_name); + + /* + * If OID is given, the module_name is unused. + * If OID is not given, the module_name may mean + * either the real module's name, or the symbol which is the + * result of renaming. Check this first. + */ + if(oid == 0) { + asn1p_xports_t *xp; + /* + * Check inside the IMPORTS section for possible renaming. + * Renaming practically means that a module_name is mentioned + * somewhere in the IMPORTS section AND OID is given. + */ + TQ_FOR(xp, &(arg->mod->imports), xp_next) { + if(strcmp(module_name, xp->from)) + continue; + if(oid) { + FATAL("Ambiguous reference: " + "%s " + "matches several modules", + module_name); + errno = ETOOMANYREFS; + return NULL; + } + /* + * Yes, there is a renaming. + * Make lookup use OID instead. + */ + oid = xp->from_oid; + } + } + + /* + * Perform lookup using OID or module_name. + */ + TQ_FOR(mod, &(arg->asn->modules), mod_next) { + if(oid) { + if(mod->module_oid) { + if(asn1p_oid_compare(oid, + mod->module_oid)) { + continue; + } else { + /* Match! Even if name doesn't. */ + return mod; + } + } else { + /* Not match, even if name is the same. */ + continue; + } + } + + if(strcmp(module_name, mod->Identifier) == 0) + return mod; + } + + DEBUG("\tModule \"%s\" not found", module_name); + + errno = ENOENT; + return NULL; +} + + + +asn1p_expr_t * +asn1f_lookup_symbol(arg_t *arg, asn1p_ref_t *ref, asn1p_module_t **module_r) { + asn1p_expr_t *ref_tc; /* Referenced tc */ + asn1p_module_t *src_mod; + char *modulename; + char *identifier; + + /* + * First of all, a reference to a symbol may be specified + * using several possible forms: + * a) simple identifier + * v INTEGER ::= value + * b) external reference + * v INTEGER ::= Module1.value + * c) class-related stuff (the most complex stuff) + * v ::= <[A-Z][A-Z0-9a-z-]*>.&<[A-Z0-9a-z-]+>. + * All other forms are not implemented at this moment. + */ + + DEBUG("%s(%s) in %s for line %d", __func__, + asn1f_printable_reference(ref), + arg->mod->Identifier, + ref->_lineno); + + if(ref->comp_count == 1) { + modulename = NULL; + identifier = ref->components[0].name; + } else if(ref->comp_count == 2 + && ref->components[1].name[0] != '&') { + modulename = ref->components[0].name; + identifier = ref->components[1].name; + } else if(ref->comp_count > 1 + && isupper(ref->components[0].name[0]) + && ref->components[1].name[0] == '&') { + asn1p_expr_t *extract; + /* + * This is a reference to a CLASS-related stuff. + * Employ a separate function for that. + */ + extract = asn1f_class_access(arg, ref, module_r); + + return extract; + } else { + DEBUG("\tToo many components: %d", ref->comp_count); + errno = EINVAL; + return NULL; + } + + /* + * If module name is specified explicitly + * OR the current module's IMPORTS clause contains the identifier, + * fetch that module. + */ + if(modulename) { + src_mod = asn1f_lookup_module(arg, modulename, 0); + if(src_mod == NULL) { + FATAL("Module \"%s\" " + "mentioned at line %d is not found", + modulename, ref->_lineno); + return NULL; + } + + /* + * Check that the EXPORTS section of this module contains + * the symbol we care about, or it is EXPORTS ALL. + */ + if(asn1f_compatible_with_exports(arg, src_mod, identifier)) { + errno = EPERM; + return NULL; + } + } else { + src_mod = asn1f_lookup_in_imports(arg, identifier); + if(src_mod == NULL && errno != ESRCH) { + /* + * Return only of the name was not found. + * If module was not found or more serious error + * encountered, just return preserving the errno. + */ + return NULL; + } + } + + if(src_mod == 0) src_mod = arg->mod; + + /* + * Now we know where to search for a value. + */ + TQ_FOR(ref_tc, &(src_mod->members), next) { + if(ref_tc->Identifier) + if(strcmp(ref_tc->Identifier, identifier) == 0) + break; + } + if(ref_tc == NULL) { + DEBUG("Module \"%s\" does not contain \"%s\" " + "mentioned at line %d", + src_mod->Identifier, + identifier, + ref->_lineno + ); + errno = ESRCH; + return NULL; + } + + if(module_r) + *module_r = src_mod; + + return ref_tc; +} + + +asn1p_expr_t * +asn1f_find_terminal_type(arg_t *arg, asn1p_expr_t *expr, + asn1p_module_t **optm) { + return asn1f_find_terminal_thing(arg, expr, optm, 0); +} + +asn1p_expr_t * +asn1f_find_terminal_value(arg_t *arg, asn1p_expr_t *expr, + asn1p_module_t **optm) { + return asn1f_find_terminal_thing(arg, expr, optm, 1); +} + +static asn1p_expr_t * +asn1f_find_terminal_thing(arg_t *arg, asn1p_expr_t *expr, + asn1p_module_t **optm, int type_or_value) { + asn1p_module_t *mod; + asn1p_ref_t *ref; + asn1p_expr_t *tc; + + if(type_or_value) { + /* VALUE */ + assert(expr->meta_type == AMT_VALUE); + assert(expr->value); + if(expr->value->type != ATV_REFERENCED) { + /* Expression is a terminal value itself */ + if(optm) *optm = arg->mod; + return expr; + } + ref = expr->value->value.reference; + } else { + /* TYPE */ + if(expr->expr_type != A1TC_REFERENCE) { + /* Expression is a terminal type itself */ + if(optm) *optm = arg->mod; + return expr; + } + ref = expr->reference; + } + + DEBUG("%s:%s(%s->%s) for line %d", + __func__, type_or_value?"VALUE":"TYPE", + expr->Identifier, asn1f_printable_reference(ref), + expr->_lineno); + + assert(ref); + + /* + * Lookup inside the type itself (ENUMERATED, INTEGER, etc). + */ + if(type_or_value) { + asn1p_expr_t *val_type_tc; + val_type_tc = asn1f_find_terminal_type(arg, expr, 0); + if(val_type_tc + && asn1f_look_value_in_type(arg, val_type_tc, expr)) + return NULL; + if(expr->value->type != ATV_REFERENCED) { + if(optm) *optm = arg->mod; + return expr; + } + assert(ref == expr->value->value.reference); + ref = expr->value->value.reference; + } + + /* + * Lookup inside the default module. + */ + tc = asn1f_lookup_symbol(arg, ref, &mod); + if(tc == NULL) { + DEBUG("\tSymbol \"%s\" not found", + asn1f_printable_reference(ref)); + return NULL; + } + + /* + * Recursive loops detection. + */ + if(tc->_mark & TM_RECURSION) { + DEBUG("Recursion loop detected for %s at line %d", + asn1f_printable_reference(ref), ref->_lineno); + errno = EPERM; + return NULL; + } + + tc->_mark |= TM_RECURSION; + WITH_MODULE(mod, + expr = asn1f_find_terminal_thing(arg, tc, optm, type_or_value)); + tc->_mark &= ~TM_RECURSION; + + return expr; +} + +/* + * Make sure that the specified name is present or otherwise does + * not contradict with the EXPORTS clause of the specified module. + */ +static int +asn1f_compatible_with_exports(arg_t *arg, asn1p_module_t *mod, const char *name) { + asn1p_xports_t *exports; + asn1p_expr_t *item; + + assert(mod); + assert(name); + + exports = TQ_FIRST(&(mod->exports)); + if(exports == NULL) { + /* No EXPORTS section or EXPORTS ALL; */ + return 0; + } + + TQ_FOR(item, &(exports->members), next) { + if(strcmp(item->Identifier, name) == 0) + return 0; + } + + DEBUG("Symbol \"%s\" contradicts with EXPORTS of module %s", + name, mod->Identifier); + + errno = ESRCH; + return -1; +} diff --git a/libasn1fix/asn1fix_retrieve.h b/libasn1fix/asn1fix_retrieve.h new file mode 100644 index 00000000..47aa0a5b --- /dev/null +++ b/libasn1fix/asn1fix_retrieve.h @@ -0,0 +1,73 @@ +/* + * Miscellaneous functions necessary for several other modules. + */ +#ifndef _ASN1FIX_RETRIEVE_H_ +#define _ASN1FIX_RETRIEVE_H_ + +/* + * Simple search for the label in the descendants of the given node. + * ERRORS: + * NULL/ESRCH + */ +asn1p_expr_t *asn1f_lookup_child(asn1p_expr_t *tc, const char *name); + +/* + * Return a module which contain a specified name, as stated in appropriate + * IMPORTS section of the current module (arg->mod). + * + * RETURN VALUES: + * NULL/ESRCH: The name was not found in IMPORTS section. + * NULL/EPERM: The name was not found in EXPORTS section of the source module. + * Also, NULL with errno values defined by asn1f_lookup_module(). + */ +asn1p_module_t *asn1f_lookup_in_imports(arg_t *arg, const char *name); + +/* + * Return a module by its name or optional OID. + * + * RETURN VALUES: + * NULL/ENOENT: No module was found by the specified name and oid + * NULL/ETOOMANYREFS: Several modules are matching the specified name and oid + */ +asn1p_module_t *asn1f_lookup_module(arg_t *arg, + const char *module_name, + asn1p_oid_t *module_oid); + +/* + * Return the reference to a destination of the given reference, + * symbol lookup. Not a recursive function. + * Optional module reference may be assigned a module in which the + * particular expr was found. + */ +asn1p_expr_t *asn1f_lookup_symbol(arg_t *arg, asn1p_ref_t *ref, + asn1p_module_t **opt_module_r); + +/* + * Recursively find the original type for the given expression. + * i.e.: + * If the original specification defines + * v Type1 ::= 5 + * Type1 ::= Type2 (1..5) + * Type3 ::= Type4 (2..7) + * Type4 ::= INTEGER (1..10) + * Then this function, given the the first expression as an argument, + * would return an expression for Type4. + * WARNING: No attempts are made to honor constraints at this moment. + */ +asn1p_expr_t *asn1f_find_terminal_type(arg_t *arg, asn1p_expr_t *tc, + asn1p_module_t **opt_module_r); + +/* + * Recursively find the original value for the given expression. + * i.e.: + * If the original specification defines + * v Type1 ::= value + * value Type2 ::= value2 + * value2 Type3 ::= 3 + * Then this function will return the expression for value2 if given + * the v as an argment. + */ +asn1p_expr_t *asn1f_find_terminal_value(arg_t *arg, asn1p_expr_t *tc, + asn1p_module_t **opt_module_r); + +#endif /* _ASN1FIX_RETRIEVE_H_ */ diff --git a/libasn1fix/asn1fix_tags.c b/libasn1fix/asn1fix_tags.c new file mode 100644 index 00000000..ed8c19f2 --- /dev/null +++ b/libasn1fix/asn1fix_tags.c @@ -0,0 +1,47 @@ +#include "asn1fix_internal.h" + +int +asn1f_fetch_tag(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, struct asn1p_type_tag_s *tag) { + int ret; + + if(expr->tag.tag_class != TC_NOCLASS) { + *tag = expr->tag; + return 0; + } + + if(expr->expr_type == A1TC_EXTENSIBLE) { + memset(tag, 0, sizeof(*tag)); + tag->tag_class = -1; + return 0; + } + + if(expr->meta_type == AMT_TYPE) { + memset(tag, 0, sizeof(*tag)); + tag->tag_class = TC_UNIVERSAL; + tag->tag_value = expr_type2uclass_value[expr->expr_type]; + return (tag->tag_value == 0) ? -1 : 0; + } + + if(expr->meta_type == AMT_TYPEREF) { + arg_t arg; + + memset(&arg, 0, sizeof(arg)); + arg.asn = asn; + arg.mod = mod; + arg.expr = expr; + + expr = asn1f_lookup_symbol(&arg, expr->reference, &mod); + if(expr == NULL) return -1; + + if(expr->_mark & TM_RECURSION) + return -1; + + expr->_mark |= TM_RECURSION; + ret = asn1f_fetch_tag(asn, mod, expr, tag); + expr->_mark &= ~TM_RECURSION; + return ret; + } + + return -1; +} + diff --git a/libasn1fix/asn1fix_tags.h b/libasn1fix/asn1fix_tags.h new file mode 100644 index 00000000..9d3595b9 --- /dev/null +++ b/libasn1fix/asn1fix_tags.h @@ -0,0 +1,6 @@ +#ifndef _ASN1FIX_TAGS_H_ +#define _ASN1FIX_TAGS_H_ + +int asn1f_fetch_tag(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, struct asn1p_type_tag_s *tag); + +#endif /* _ASN1FIX_TAGS_H_ */ diff --git a/libasn1fix/asn1fix_value.c b/libasn1fix/asn1fix_value.c new file mode 100644 index 00000000..a22fd3dc --- /dev/null +++ b/libasn1fix/asn1fix_value.c @@ -0,0 +1,159 @@ +#include "asn1fix_internal.h" + +static int _asn1f_copy_value(arg_t *arg, asn1p_expr_t *to,asn1p_expr_t *from); + +int +asn1f_value_resolve(arg_t *arg, asn1p_expr_t *expr) { + asn1p_module_t *val_mod; + asn1p_expr_t *val_type_expr; + asn1p_expr_t *value_expr; + asn1p_expr_t *type_expr; + int ret; + + /* Make sure this IS a value assignment */ + assert(expr->meta_type == AMT_VALUE); + assert(expr->value); + + DEBUG("%s(=\"%s\", %x)", __func__, + asn1f_printable_value(expr->value), expr->expr_type); + + /* + * 1. Find the terminal type for this assignment. + */ + type_expr = asn1f_find_terminal_type(arg, expr, 0); + if(type_expr == 0) { + DEBUG("\tTerminal type for %s not found", expr->Identifier); + return -1; + } + + if(asn1f_look_value_in_type(arg, type_expr, expr) == -1) + return -1; + + /* + * 2. Find the terminal value also. + */ + value_expr = asn1f_find_terminal_value(arg, expr, &val_mod); + if(value_expr) { + DEBUG("\tTerminal value for %s->%s is %s at line %d", + expr->Identifier, asn1f_printable_value(expr->value), + value_expr->Identifier, value_expr->_lineno); + } else { + DEBUG("\tTerminal value for %s->%s not found", + expr->Identifier, asn1f_printable_value(expr->value)); + return -1; + } + + /* + * 3. Find the _type_ of a _terminal value_. + */ + WITH_MODULE(val_mod, + val_type_expr = asn1f_find_terminal_type(arg, value_expr, 0)); + if(val_type_expr) { + DEBUG("\tTerminal type of value %s->%s is %s at line %d", + expr->Identifier, asn1f_printable_value(expr->value), + val_type_expr->Identifier, val_type_expr->_lineno); + } else { + DEBUG("\tTerminal type of value %s->%s not found", + expr->Identifier, asn1f_printable_value(expr->value)); + return -1; + } + + /* + * 4. Check compatibility between the type of the current expression + * and the type of the discovered value. + */ + ret = asn1f_check_type_compatibility(arg, type_expr, val_type_expr); + if(ret == -1) { + DEBUG("\tIncompatible type of %s at %d with %s at %d", + type_expr->Identifier, type_expr->_lineno, + val_type_expr->Identifier, val_type_expr->_lineno); + return -1; + } + + if(asn1f_look_value_in_type(arg, val_type_expr, expr) == -1) + return -1; + + /* + * 5. Copy value from the terminal value into the current expression. + */ + ret = _asn1f_copy_value(arg, expr, value_expr); + if(ret == -1) { + DEBUG("\tValue %s cannot be copied from line %d to line %d", + asn1f_printable_value(value_expr->value), + value_expr->_lineno, expr->_lineno); + return -1; + } + + DEBUG("\tFinal value for \"%s\" at line %d is %s", + expr->Identifier, expr->_lineno, + asn1f_printable_value(expr->value)); + + return 0; +} + +static int +_asn1f_copy_value(arg_t *arg, asn1p_expr_t *to, asn1p_expr_t *from) { + asn1p_value_t *v; + + v = asn1p_value_clone(from->value); + if(v) { + asn1p_value_free(to->value); + to->value = v; + DEBUG("Copied value %s from \"%s\" on line %d " + "to \"%s\" on line %d", + asn1f_printable_value(v), + from->Identifier, + from->_lineno, + to->Identifier, + to->_lineno + ); + return 0; + } else { + return -1; + } +} + +int +asn1f_look_value_in_type(arg_t *arg, + asn1p_expr_t *type_expr, + asn1p_expr_t *value_expr) { + asn1p_expr_t *child_expr; + char *identifier; + + if(value_expr->value->type != ATV_REFERENCED + || value_expr->value->value.reference->comp_count != 1) + return 0; + if(type_expr->expr_type != ASN_BASIC_INTEGER + && type_expr->expr_type != ASN_BASIC_ENUMERATED) + return 0; + + DEBUG("%s(for %s in %s %x) for line %d", __func__, + asn1f_printable_value(value_expr->value), + type_expr->Identifier, + type_expr->expr_type, + value_expr->_lineno); + + /* + * Look into the definitions of the type itself: + * Type1 ::= INTEGER { a(1), b(2) } + * value Type1 = b -- will assign 2 + */ + identifier = value_expr->value->value.reference->components[0].name; + + child_expr = asn1f_lookup_child(type_expr, identifier); + DEBUG("\tLooking into a type %s at line %d for %s at line %d: %s", + type_expr->Identifier, type_expr->_lineno, + identifier, value_expr->_lineno, + child_expr + ? asn1f_printable_value(child_expr->value) + : "" + ); + + if(child_expr && child_expr->value) { + if(_asn1f_copy_value(arg, value_expr, child_expr)) + return -1; + /* Fall through */ + } + + return 0; +} diff --git a/libasn1fix/asn1fix_value.h b/libasn1fix/asn1fix_value.h new file mode 100644 index 00000000..7234035e --- /dev/null +++ b/libasn1fix/asn1fix_value.h @@ -0,0 +1,28 @@ +/* + * Functions related with processing values. + */ +#ifndef _ASN1FIX_VALUE_H_ +#define _ASN1FIX_VALUE_H_ + +/* + * Resolve the value given by reference. + * This function also takes a parameter which specifies the desired + * value's type. + * + * RETURN VALUES: + * 0: Value resolved successfully. + * -1/EPERM: Recursive looping detected. + * -1/EEXIST: Reference is not compatible with the desired type. + * -1/ESRCH: Cannot find the terminal reference. + */ +int asn1f_value_resolve(arg_t *arg, asn1p_expr_t *tc); + +/* + * Check if a value in value_expr refers to the enumeration or integer element + * within the type provided. If yes, it will replace referenced value with + * the appropriate inline value. + */ +int asn1f_look_value_in_type(arg_t *arg, + asn1p_expr_t *type_expr, asn1p_expr_t *value_expr); + +#endif /* _ASN1FIX_VALUE_H_ */ diff --git a/libasn1fix/check_fixer.c b/libasn1fix/check_fixer.c new file mode 100644 index 00000000..21c5b12f --- /dev/null +++ b/libasn1fix/check_fixer.c @@ -0,0 +1,313 @@ +#undef NDEBUG +#include +#include +#include +#include +#include +#include +#include +#include + +#include "asn1fix.h" +#include "asn1fix_internal.h" + +static int check(const char *fname, + enum asn1p_flags parser_flags, + enum asn1f_flags fixer_flags); +static int post_fix_check(asn1p_t *asn); +static int post_fix_check_element(asn1p_module_t *mod, asn1p_expr_t *expr); + +int +main(int ac, char **av) { + struct dirent *dp; + DIR *dir; + int failed = 0; + int completed = 0; + enum asn1p_flags parser_flags = A1P_NOFLAGS; + enum asn1f_flags fixer_flags = A1F_NOFLAGS; + int ret; + + /* + * Just in case when one decides that some flags better be + * enabled during `ASN1_FIXER_FLAGS=1 make check` or some + * similar usage. + */ + if(getenv("ASN1_PARSER_FLAGS")) + parser_flags = atoi(getenv("ASN1_PARSER_FLAGS")); + if(getenv("ASN1_FIXER_FLAGS")) + fixer_flags = atoi(getenv("ASN1_FIXER_FLAGS")); + + /* + * Go into a directory with tests. + */ + if(ac <= 1) { + fprintf(stderr, "Testing in ./tests...\n"); + ret = chdir("../tests"); + assert(ret == 0); + dir = opendir("."); + assert(dir); + } else { + dir = 0; + } + + /* + * Scan every *.asn1 file and try to parse and fix it. + */ + if(dir) { + while((dp = readdir(dir))) { + int len = strlen(dp->d_name); + if(len && strcmp(dp->d_name + len - 5, ".asn1") == 0) { + ret = check(dp->d_name, + parser_flags, fixer_flags); + if(ret) { + fprintf(stderr, + "FAILED: %s\n", + dp->d_name); + failed++; + } + completed++; + } + } + closedir(dir); + + fprintf(stderr, + "Tests COMPLETED: %d\n" + "Tests FAILED: %d\n" + , + completed, failed + ); + } else { + int i; + for(i = 1; i < ac; i++) { + ret = check(av[i], parser_flags, fixer_flags); + if(ret) { + fprintf(stderr, "FAILED: %s\n", av[i]); + failed++; + } + completed++; + } + } + + if(completed == 0) { + fprintf(stderr, "No tests defined?!\n"); + exit(EX_NOINPUT); + } + + if(failed) + exit(EX_DATAERR); + return 0; +} + +static int +check(const char *fname, + enum asn1p_flags parser_flags, + enum asn1f_flags fixer_flags) { + asn1p_t *asn; + int expected_parseable; /* Is it expected to be parseable? */ + int expected_fix_code; /* What code a fixer must return */ + int r_value = 0; + + /* + * Figure out how the processing should go by inferring + * expectations from the file name. + */ + if(strstr(fname, "-OK.")) { + expected_parseable = 1; + expected_fix_code = 0; + } else if(strstr(fname, "-NP.")) { + expected_parseable = 0; + expected_fix_code = 123; /* Does not matter */ + } else if(strstr(fname, "-SE.")) { + expected_parseable = 1; + expected_fix_code = -1; /* Semantically incorrect */ + } else if(strstr(fname, "-SW.")) { + expected_parseable = 1; + expected_fix_code = 1; /* Semantically suspicious */ + } else { + fprintf(stderr, "%s: Invalid file name format\n", fname); + return -1; + } + + fprintf(stderr, "[=> %s]\n", fname); + + /* + * Perform low-level parsing. + */ + if(!expected_parseable) + fprintf(stderr, "Expecting error...\n"); + asn = asn1p_parse_file(fname, parser_flags); + if(asn == NULL) { + if(expected_parseable) { + fprintf(stderr, "Cannot parse file \"%s\"\n", fname); + r_value = -1; + } else { + fprintf(stderr, + "Previous error is EXPECTED, no worry\n"); + } + } else if(!expected_parseable) { + fprintf(stderr, + "The file \"%s\" is not expected to be parseable, " + "yet parsing was successfull!\n", fname); + r_value = -1; + } + + /* + * Perform semantical checks and fixes. + */ + if(asn && r_value == 0) { + int ret; + + if(expected_fix_code) + fprintf(stderr, "Expecting some problems...\n"); + + ret = asn1f_process(asn, fixer_flags, 0); + if(ret) { + if(ret == expected_fix_code) { + fprintf(stderr, + "Previous error is EXPECTED, " + "no worry\n"); + } else { + fprintf(stderr, + "Cannot process file \"%s\": %d\n", + fname, ret); + r_value = -1; + } + } else if(ret != expected_fix_code) { + fprintf(stderr, + "File \"%s\" is expected " + "to be semantically incorrect, " + "yet processing was successful!\n", + fname); + r_value = -1; + } + } + + /* + * Check validity of some values, if grammar has special + * instructions for that. + */ + if(asn && r_value == 0) { + if(post_fix_check(asn)) + r_value = -1; + } + + /* + * TODO: destroy the asn. + */ + + return r_value; +} + + +static int +post_fix_check(asn1p_t *asn) { + asn1p_module_t *mod; + asn1p_expr_t *expr; + int r_value = 0; + + TQ_FOR(mod, &(asn->modules), mod_next) { + TQ_FOR(expr, &(mod->members), next) { + assert(expr->Identifier); + if(strncmp(expr->Identifier, "check-", 6) == 0) { + if(post_fix_check_element(mod, expr)) + r_value = -1; + } + } + } + + return r_value; +} + + +static int +post_fix_check_element(asn1p_module_t *mod, asn1p_expr_t *check_expr) { + asn1p_expr_t *expr = NULL; + char *name; + asn1p_value_t *value; + + if(check_expr->expr_type != ASN_BASIC_INTEGER + || check_expr->meta_type != AMT_VALUE) { + fprintf(stderr, + "CHECKER: Unsupported type of \"%s\" value: " + "%d at line %d of %s\n", + check_expr->Identifier, + check_expr->expr_type, + check_expr->_lineno, + mod->source_file_name + ); + return -1; + } + + assert(check_expr->meta_type == AMT_VALUE); + + value = check_expr->value; + if(value == NULL || value->type != ATV_INTEGER) { + fprintf(stderr, + "CHECKER: Unsupported value type of \"%s\": " + "%d at line %d of %s\n", + check_expr->Identifier, + value?value->type:-1, + expr->_lineno, + mod->source_file_name + ); + return -1; + } + + name = check_expr->Identifier + sizeof("check-") - 1; + + /* + * Scan in search for the original. + */ + TQ_FOR(expr, &(mod->members), next) { + if(strcmp(expr->Identifier, name) == 0) + break; + } + + if(expr == NULL) { + fprintf(stderr, + "CHECKER: Value \"%s\" requested by " + "\"check-%s\" at line %d of %s is not found!\n", + name, name, check_expr->_lineno, + mod->source_file_name + ); + return -1; + } + + if(0 && expr->expr_type != check_expr->expr_type) { + fprintf(stderr, + "CHECKER: Value type of \"%s\" (=%d) at line %d " + "does not have desired type %d as requested by " + "\"check-%s\" in %s\n", + expr->Identifier, + expr->expr_type, + expr->_lineno, + check_expr->expr_type, + name, + mod->source_file_name + ); + return -1; + } + + if(expr->value == NULL + || expr->value->type != value->type) { + fprintf(stderr, + "CHECKER: Value of \"%s\" (\"%s\", type=%d) at line %d " + "does not have desired type %d as requested by " + "\"check-%s\" in %s\n", + expr->Identifier, + asn1f_printable_value(expr->value), + expr->value->type, + expr->_lineno, + value->type, + name, + mod->source_file_name + ); + return -1; + } + + assert(value->type = ATV_INTEGER); + + return 0; +} + + diff --git a/libasn1parser/Makefile.am b/libasn1parser/Makefile.am new file mode 100644 index 00000000..0f9ff161 --- /dev/null +++ b/libasn1parser/Makefile.am @@ -0,0 +1,35 @@ + +AM_CFLAGS = @ADD_CFLAGS@ +AM_YFLAGS = -p asn1p_ -d +AM_LFLAGS = -sp -Cem -Pasn1p_ -olex.yy.c + +noinst_LTLIBRARIES = libasn1parser.la + +libasn1parser_la_LDFLAGS = -all-static +libasn1parser_la_SOURCES = \ + asn1parser.c asn1parser.h \ + asn1p_y.y asn1p_l.l \ + asn1p_module.c asn1p_module.h \ + asn1p_oid.c asn1p_oid.h \ + asn1p_value.c asn1p_value.h \ + asn1p_expr.c asn1p_expr.h \ + asn1p_expr_str.h \ + asn1p_expr2uclass.h \ + asn1p_xports.c asn1p_xports.h \ + asn1p_constr.c asn1p_constr.h \ + asn1p_param.c asn1p_param.h \ + asn1p_class.c asn1p_class.h \ + asn1p_ref.c asn1p_ref.h \ + asn1p_list.h + +asn1p_expr_str.h: expr-h.pl asn1p_expr.h + ./expr-h.pl asn1p_expr.h > $@ + +EXTRA_DIST = expr-h.pl + +check_PROGRAMS = check_parser + +LDADD = ${noinst_LTLIBRARIES} +DEPENDENCIES = ${noinst_LTLIBRARIES} + +TESTS = ${check_PROGRAMS} diff --git a/libasn1parser/Makefile.in b/libasn1parser/Makefile.in new file mode 100644 index 00000000..7c4bd5f8 --- /dev/null +++ b/libasn1parser/Makefile.in @@ -0,0 +1,459 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +ADD_CFLAGS = @ADD_CFLAGS@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AWK = @AWK@ +CC = @CC@ +CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@ +CPP = @CPP@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LEX = @LEX@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PATH = @PATH@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +YACC = @YACC@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +AM_CFLAGS = @ADD_CFLAGS@ +AM_YFLAGS = -p asn1p_ -d +AM_LFLAGS = -sp -Cem -Pasn1p_ -olex.yy.c + +noinst_LTLIBRARIES = libasn1parser.la + +libasn1parser_la_LDFLAGS = -all-static +libasn1parser_la_SOURCES = \ + asn1parser.c asn1parser.h \ + asn1p_y.y asn1p_l.l \ + asn1p_module.c asn1p_module.h \ + asn1p_oid.c asn1p_oid.h \ + asn1p_value.c asn1p_value.h \ + asn1p_expr.c asn1p_expr.h \ + asn1p_expr_str.h \ + asn1p_expr2uclass.h \ + asn1p_xports.c asn1p_xports.h \ + asn1p_constr.c asn1p_constr.h \ + asn1p_param.c asn1p_param.h \ + asn1p_class.c asn1p_class.h \ + asn1p_ref.c asn1p_ref.h \ + asn1p_list.h + + +EXTRA_DIST = expr-h.pl + +check_PROGRAMS = check_parser + +LDADD = ${noinst_LTLIBRARIES} +DEPENDENCIES = ${noinst_LTLIBRARIES} + +TESTS = ${check_PROGRAMS} +subdir = libasn1parser +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + +libasn1parser_la_LIBADD = +am_libasn1parser_la_OBJECTS = asn1parser.lo asn1p_y.lo asn1p_l.lo \ + asn1p_module.lo asn1p_oid.lo asn1p_value.lo asn1p_expr.lo \ + asn1p_xports.lo asn1p_constr.lo asn1p_param.lo asn1p_class.lo \ + asn1p_ref.lo +libasn1parser_la_OBJECTS = $(am_libasn1parser_la_OBJECTS) +check_PROGRAMS = check_parser$(EXEEXT) +check_parser_SOURCES = check_parser.c +check_parser_OBJECTS = check_parser.$(OBJEXT) +check_parser_LDADD = $(LDADD) +check_parser_DEPENDENCIES = libasn1parser.la +check_parser_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/asn1p_class.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1p_constr.Plo $(DEPDIR)/asn1p_expr.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1p_l.Plo $(DEPDIR)/asn1p_module.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1p_oid.Plo $(DEPDIR)/asn1p_param.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1p_ref.Plo $(DEPDIR)/asn1p_value.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1p_xports.Plo $(DEPDIR)/asn1p_y.Plo \ +@AMDEP_TRUE@ $(DEPDIR)/asn1parser.Plo $(DEPDIR)/check_parser.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) +LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) +YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) +LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS) +DIST_SOURCES = $(libasn1parser_la_SOURCES) check_parser.c +DIST_COMMON = Makefile.am Makefile.in asn1p_l.c asn1p_y.c asn1p_y.h +SOURCES = $(libasn1parser_la_SOURCES) check_parser.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .l .lo .o .obj .y + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu libasn1parser/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) +asn1p_y.h: asn1p_y.c +libasn1parser.la: $(libasn1parser_la_OBJECTS) $(libasn1parser_la_DEPENDENCIES) + $(LINK) $(libasn1parser_la_LDFLAGS) $(libasn1parser_la_OBJECTS) $(libasn1parser_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +check_parser$(EXEEXT): $(check_parser_OBJECTS) $(check_parser_DEPENDENCIES) + @rm -f check_parser$(EXEEXT) + $(LINK) $(check_parser_LDFLAGS) $(check_parser_OBJECTS) $(check_parser_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_class.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_constr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_expr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_l.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_module.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_oid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_param.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_ref.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_value.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_xports.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1p_y.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/asn1parser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/check_parser.Po@am__quote@ + +distclean-depend: + -rm -rf $(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` + +.c.lo: +@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< +CCDEPMODE = @CCDEPMODE@ + +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LEXLIB = @LEXLIB@ + +.l.c: + $(LEXCOMPILE) $< && mv $(LEX_OUTPUT_ROOT).c $@ + +.y.c: + $(YACCCOMPILE) $< && mv y.tab.c $@ + if test -f y.tab.h; then \ + if cmp -s y.tab.h $*.h; then \ + rm -f y.tab.h; \ + else \ + mv y.tab.h $*.h; \ + fi; \ + fi +uninstall-info-am: + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + fi + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "asn1p_y.h" || rm -f asn1p_y.h +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +uninstall-am: uninstall-info-am + +.PHONY: GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES distclean distclean-compile \ + distclean-depend distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + tags uninstall uninstall-am uninstall-info-am + + +asn1p_expr_str.h: expr-h.pl asn1p_expr.h + ./expr-h.pl asn1p_expr.h > $@ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libasn1parser/asn1p_class.c b/libasn1parser/asn1p_class.c new file mode 100644 index 00000000..cd0e385a --- /dev/null +++ b/libasn1parser/asn1p_class.c @@ -0,0 +1,135 @@ +#include +#include +#include +#include +#include + +#include "asn1parser.h" + +asn1p_wsyntx_chunk_t * +asn1p_wsyntx_chunk_new() { + asn1p_wsyntx_chunk_t *wc; + + wc = calloc(1, sizeof(*wc)); + + return wc; +} + +void +asn1p_wsyntx_chunk_free(asn1p_wsyntx_chunk_t *wc) { + if(wc) { + if(wc->ref) + asn1p_ref_free(wc->ref); + if(wc->buf) + free(wc->buf); + free(wc); + } +} + +asn1p_wsyntx_chunk_t * +asn1p_wsyntx_chunk_clone(asn1p_wsyntx_chunk_t *wc) { + asn1p_wsyntx_chunk_t *nc; + + nc = asn1p_wsyntx_chunk_new(); + if(nc) { + if(wc->buf) { + nc->buf = malloc(wc->len + 1); + if(nc->buf) { + nc->len = wc->len; + memcpy(nc->buf, wc->buf, wc->len); + nc->buf[nc->len] = '\0'; + } + } + if(wc->ref) { + nc->ref = asn1p_ref_clone(wc->ref); + } + + if(!nc->ref && !nc->buf) { + asn1p_wsyntx_chunk_free(nc); + return NULL; + } + } + + return nc; +} + +asn1p_wsyntx_t * +asn1p_wsyntx_new() { + asn1p_wsyntx_t *wx; + + wx = calloc(1, sizeof(*wx)); + if(wx) { + TQ_INIT(&(wx->chunks)); + } + + return wx; +} + +void +asn1p_wsyntx_free(asn1p_wsyntx_t *wx) { + if(wx) { + asn1p_wsyntx_chunk_t *wc; + while((wc = TQ_REMOVE(&(wx->chunks), next))) + asn1p_wsyntx_chunk_free(wc); + free(wx); + } +} + +asn1p_wsyntx_t * +asn1p_wsyntx_clone(asn1p_wsyntx_t *wx) { + asn1p_wsyntx_t *nw; + + nw = asn1p_wsyntx_new(); + if(nw) { + asn1p_wsyntx_chunk_t *wc; + asn1p_wsyntx_chunk_t *nc; + TQ_FOR(wc, &(wx->chunks), next) { + nc = asn1p_wsyntx_chunk_clone(wc); + if(nc) { + TQ_ADD(&(nw->chunks), nc, next); + } else { + asn1p_wsyntx_free(nw); + return NULL; + } + } + } + + return nw; +} + +asn1p_wsyntx_chunk_t * +asn1p_wsyntx_chunk_fromref(asn1p_ref_t *ref, int do_copy) { + asn1p_wsyntx_chunk_t *wc; + + if(do_copy) { + static asn1p_wsyntx_chunk_t tmp; + tmp.ref = ref; + wc = asn1p_wsyntx_chunk_clone(&tmp); + } else { + wc = asn1p_wsyntx_chunk_new(); + if(wc) wc->ref = ref; + } + + return wc; +} + +asn1p_wsyntx_chunk_t * +asn1p_wsyntx_chunk_frombuf(char *buf, int len, int do_copy) { + asn1p_wsyntx_chunk_t *wc; + + if(do_copy) { + static asn1p_wsyntx_chunk_t tmp; + tmp.buf = buf; + tmp.len = len; + wc = asn1p_wsyntx_chunk_clone(&tmp); + } else { + wc = asn1p_wsyntx_chunk_new(); + if(wc) { + wc->buf = buf; + wc->len = len; + } + } + + return wc; +} + diff --git a/libasn1parser/asn1p_class.h b/libasn1parser/asn1p_class.h new file mode 100644 index 00000000..4a0f19e1 --- /dev/null +++ b/libasn1parser/asn1p_class.h @@ -0,0 +1,53 @@ +/* + * CLASS-related stuff. + */ +#ifndef ASN1_PARSER_CLASS_H +#define ASN1_PARSER_CLASS_H + +#include + +/* + * WITH SYNTAX free-form chunks. + */ +typedef struct asn1p_wsyntx_chunk_s { + /* + * It could be the union, but the story is: + * if ref is here, the ref is used. + * Otherwise, buf/len is used. + */ + asn1p_ref_t *ref; + + char *buf; + int len; + + TQ_ENTRY(struct asn1p_wsyntx_chunk_s) next; +} asn1p_wsyntx_chunk_t; + +typedef struct asn1p_wsyntx_s { + + TQ_HEAD(struct asn1p_wsyntx_chunk_s) chunks; + +} asn1p_wsyntx_t; + + +/* + * Constructor, destructor and cloning function. + */ +asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_new(void); +void asn1p_wsyntx_chunk_free(asn1p_wsyntx_chunk_t *); +asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_clone(asn1p_wsyntx_chunk_t *); + +asn1p_wsyntx_t *asn1p_wsyntx_new(void); +void asn1p_wsyntx_free(asn1p_wsyntx_t *); +asn1p_wsyntx_t *asn1p_wsyntx_clone(asn1p_wsyntx_t *); + +/* + * RETURN VALUES: + * 0: Component has been added + * -1: Failure to add component (refer to errno) + */ +asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_fromref(asn1p_ref_t *ref, int do_copy); +asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_frombuf(char *buf, int len, int do_copy); + + +#endif /* ASN1_PARSER_CLASS_H */ diff --git a/libasn1parser/asn1p_constr.c b/libasn1parser/asn1p_constr.c new file mode 100644 index 00000000..6e198892 --- /dev/null +++ b/libasn1parser/asn1p_constr.c @@ -0,0 +1,91 @@ +#include +#include +#include +#include + +#include "asn1parser.h" + +asn1p_constraint_t * +asn1p_constraint_new(int _lineno) { + asn1p_constraint_t *ct; + + ct = calloc(1, sizeof(*ct)); + if(ct) { + ct->_lineno = _lineno; + } + + return ct; +} + + +void +asn1p_constraint_free(asn1p_constraint_t *ct) { + if(ct) { + + if(ct->value) + asn1p_value_free(ct->value); + if(ct->range_start) + asn1p_value_free(ct->range_start); + if(ct->range_stop) + asn1p_value_free(ct->range_stop); + + if(ct->elements) { + while(ct->el_count--) { + asn1p_constraint_free( + ct->elements[ct->el_count]); + } + free(ct->elements); + } + + free(ct); + } +} + +asn1p_constraint_t * +asn1p_constraint_clone(asn1p_constraint_t *src) { + asn1p_constraint_t *clone; + +#define CLONE(field, func) do { if(src->field) { \ + clone->field = func(src->field); \ + if(clone->field == NULL) { \ + asn1p_constraint_free(clone); \ + return NULL; \ + } \ + } } while(0) + + clone = asn1p_constraint_new(src->_lineno); + if(clone) { + clone->type = src->type; + CLONE(value, asn1p_value_clone); + CLONE(range_start, asn1p_value_clone); + CLONE(range_stop, asn1p_value_clone); + } + + return clone; +} + +int +asn1p_constraint_insert(asn1p_constraint_t *into, asn1p_constraint_t *what) { + assert(into); + assert(what); + + /* + * Make sure there's enough space to add an element. + */ + if(into->el_count == into->el_size) { + int newsize = into->el_size?into->el_size<<2:4; + void *p; + p = realloc(into->elements, + newsize * sizeof(into->elements[0])); + if(p) { + into->elements = p; + into->el_size = newsize; + } else { + return -1; + } + } + + into->elements[into->el_count++] = what; + + return 0; +} diff --git a/libasn1parser/asn1p_constr.h b/libasn1parser/asn1p_constr.h new file mode 100644 index 00000000..19099b2f --- /dev/null +++ b/libasn1parser/asn1p_constr.h @@ -0,0 +1,79 @@ +/* + * Type constraints. + */ +#ifndef ASN1_PARSER_CONSTRAINT_H +#define ASN1_PARSER_CONSTRAINT_H + +typedef struct asn1p_constraint_s { + + enum asn1p_constraint_type_e { + ACT_INVALID, /* for assertions */ + /* + * Constraint elements. + */ + ACT_EL_VALUE, /* 123, "A", T (elementary value) */ + ACT_EL_RANGE, /* 1..2 (elementary range) */ + ACT_EL_LLRANGE, /* 1<..2 (elementary range) */ + ACT_EL_RLRANGE, /* 1..<2 (elementary range) */ + ACT_EL_ULRANGE, /* 1<..<2 (elementary range) */ + ACT_EL_EXT, /* ... (extensibility mark) */ + /* + * Constraint types. + */ + ACT_CT_SIZE, /* SIZE constraint type */ + ACT_CT_FROM, /* FROM constraint type */ + ACT_CT_WCOMP, /* WITH COMPONENT */ + ACT_CT_WCOMPS, /* WITH COMPONENTS */ + /* + * Arrays of constraints. + */ + ACT_CA_SET, /* A set of constraints: (c1)(c2) */ + ACT_CA_CRC, /* Comp. relation c-t: ({a})({@b}) */ + ACT_CA_CSV, /* Comma-separated constraints array */ + ACT_CA_UNI, /* UNION (|) */ + ACT_CA_INT, /* INTERSECTION (^) */ + ACT_CA_EXC, /* EXCEPT */ + } type; + + enum asn1p_constr_pres_e { + ACPRES_DEFAULT, + ACPRES_PRESENT, + ACPRES_ABSENT, + ACPRES_OPTIONAL, + } presence; + + /* + * A single values. + */ + asn1p_value_t *value; + asn1p_value_t *range_start; + asn1p_value_t *range_stop; + + /* + * A collection of constraint elements. + */ + struct asn1p_constraint_s **elements; + int el_count; /* Number of meaningful elements */ + int el_size; /* Size of the allocated (elements) */ + + int _lineno; /* Position in a source file */ +} asn1p_constraint_t; + + +/* + * Constructors and a recursive destructor. + */ +asn1p_constraint_t *asn1p_constraint_new(int _lineno); +void asn1p_constraint_free(asn1p_constraint_t *); + +/* + * Clone the constraint and all its children. + */ +asn1p_constraint_t *asn1p_constraint_clone(asn1p_constraint_t *source_to_clone); + +/* + * Insert additional element into the element array of a (to) constraint. + */ +int asn1p_constraint_insert(asn1p_constraint_t *into, asn1p_constraint_t *what); + +#endif /* ASN1_PARSER_CONSTRAINT_H */ diff --git a/libasn1parser/asn1p_expr.c b/libasn1parser/asn1p_expr.c new file mode 100644 index 00000000..23ab4cb3 --- /dev/null +++ b/libasn1parser/asn1p_expr.c @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include + +#include "asn1parser.h" + +/* + * Construct a new empty types collection. + */ +asn1p_expr_t * +asn1p_expr_new(int _lineno) { + asn1p_expr_t *expr; + + expr = calloc(1, sizeof *expr); + if(expr) { + TQ_INIT(&(expr->members)); + expr->_lineno = _lineno; + } + + return expr; +} + +asn1p_expr_t * +asn1p_expr_clone(asn1p_expr_t *expr) { + asn1p_expr_t *clone; + asn1p_expr_t *tcmemb; /* Child of tc */ + + clone = asn1p_expr_new(expr->_lineno); + if(clone == NULL) return NULL; + +#define CLCOPY(field) do { clone->field = expr->field; } while(0) +#define CLCLONE(field, func) do { if(expr->field) { \ + clone->field = func(expr->field); \ + if(clone->field == NULL) { \ + asn1p_expr_free(clone); \ + return NULL; \ + } \ + } } while(0) + + /* + * Copy simple fields. + */ + CLCOPY(meta_type); + CLCOPY(expr_type); + CLCOPY(tag); + CLCOPY(marker); + CLCOPY(_mark); + + clone->data = 0; /* Do not clone this */ + clone->data_free = 0; /* Do not clone this */ + + /* + * Clone complex fields. + */ + CLCLONE(Identifier, strdup); + CLCLONE(reference, asn1p_ref_clone); + CLCLONE(constraints, asn1p_constraint_clone); + CLCLONE(params, asn1p_paramlist_clone); + CLCLONE(value, asn1p_value_clone); + CLCLONE(with_syntax, asn1p_wsyntx_clone); + + /* + * Copy all the children of this expr. + */ + TQ_FOR(tcmemb, &(expr->members), next) { + asn1p_expr_t *cmemb = asn1p_expr_clone(tcmemb); + if(cmemb == NULL) { + asn1p_expr_free(clone); + return NULL; + } + TQ_ADD(&(clone->members), cmemb, next); + } + + return clone; +} + +/* + * Destruct the types collection structure. + */ +void +asn1p_expr_free(asn1p_expr_t *expr) { + if(expr) { + asn1p_expr_t *tm; + + if(expr->Identifier) + free(expr->Identifier); + if(expr->reference) + asn1p_ref_free(expr->reference); + if(expr->constraints) + asn1p_constraint_free(expr->constraints); + if(expr->params) + asn1p_paramlist_free(expr->params); + if(expr->value) + asn1p_value_free(expr->value); + if(expr->with_syntax) + asn1p_wsyntx_free(expr->with_syntax); + + /* Remove all children */ + while((tm = TQ_REMOVE(&(expr->members), next))) { + asn1p_expr_free(tm); + } + + if(expr->data && expr->data_free) + expr->data_free(expr->data); + + memset(expr, 0, sizeof(*expr)); + free(expr); + } +} + diff --git a/libasn1parser/asn1p_expr.h b/libasn1parser/asn1p_expr.h new file mode 100644 index 00000000..331285c7 --- /dev/null +++ b/libasn1parser/asn1p_expr.h @@ -0,0 +1,214 @@ +/* + * A collection of data members of unspecified types. + */ +#ifndef ASN1_PARSER_EXPR_H +#define ASN1_PARSER_EXPR_H + +/* + * Meta type of the ASN expression. + */ +typedef enum asn1p_expr_meta { + AMT_INVALID, + AMT_TYPE, /* Type1 ::= INTEGER */ + AMT_TYPEREF, /* Type2 ::= Type1 */ + AMT_PARAMTYPE, /* Type3{Parameter} ::= SET { ... } */ + AMT_VALUE, /* value1 Type1 ::= 1 */ + AMT_VALUESET, /* ValueSet Type1 ::= { value1 } */ + AMT_OBJECT, /* FUNCTION ::= CLASS {...} */ + AMT_OBJECTSET, /* Functions FUNCTION ::= {...} */ + AMT_OBJECTFIELD, /* ... */ + AMT_EXPR_META_MAX +} asn1p_expr_meta_e; + +/* + * ASN type of the expression. + */ +typedef enum asn1p_expr_type { + /* + * Internal types. + */ + A1TC_INVALID, /* Invalid type */ + A1TC_REFERENCE, /* Reference to the type defined elsewhere */ + A1TC_EXPORTVAR, /* We're exporting this definition */ + A1TC_UNIVERVAL, /* A value of an ENUMERATED, INTEGER or BS */ + A1TC_BOOLBITPOS, /* A bit position in a BIT STRING */ + A1TC_BITVECTOR, /* A plain collection of bits */ + A1TC_OPAQUE, /* Opaque data encoded as a bitvector */ + A1TC_EXTENSIBLE, /* An extension marker "..." */ + A1TC_PARAMETRIZED, /* A parametrized type declaration */ + A1TC_VALUESET, /* Value set definition */ + A1TC_CLASSDEF, /* Information Object Class */ + A1TC_CLASSFIELD, /* Information Object Class field */ + A1TC_INSTANCE, /* Instance of Object Class */ + A1TC_TYPEID, /* Type identifier */ + /* + * ASN.1 Constructed types + */ +#define ASN_CONSTR_MASK 0x10 /* Every constructed type */ + ASN_CONSTR_SEQUENCE = ASN_CONSTR_MASK, /* SEQUENCE */ + ASN_CONSTR_CHOICE, /* CHOICE */ + ASN_CONSTR_SET, /* SET */ + ASN_CONSTR_SEQUENCE_OF, /* SEQUENCE OF */ + ASN_CONSTR_SET_OF, /* SET OF */ + ASN_CONSTR_ANY, /* ANY (deprecated) */ + /* + * ASN.1 Basic types + */ +#define ASN_BASIC_MASK 0x20 /* Every basic type */ + ASN_BASIC_BOOLEAN = ASN_BASIC_MASK, + ASN_BASIC_NULL, + ASN_BASIC_INTEGER, + ASN_BASIC_REAL, + ASN_BASIC_ENUMERATED, + ASN_BASIC_BIT_STRING, + ASN_BASIC_OCTET_STRING, + ASN_BASIC_OBJECT_IDENTIFIER, + ASN_BASIC_RELATIVE_OID, + ASN_BASIC_EXTERNAL, + ASN_BASIC_EMBEDDED_PDV, + ASN_BASIC_CHARACTER_STRING, + ASN_BASIC_UTCTime, + ASN_BASIC_GeneralizedTime, + /* + * ASN.1 String types + */ +#define ASN_STRING_MASK 0x40 /* Every string type */ + ASN_STRING_BMPString = ASN_STRING_MASK, + ASN_STRING_GeneralString, + ASN_STRING_GraphicString, + ASN_STRING_IA5String, + ASN_STRING_ISO646String, + ASN_STRING_NumericString, + ASN_STRING_PrintableString, + ASN_STRING_TeletexString, + ASN_STRING_T61String, + ASN_STRING_UniversalString, + ASN_STRING_UTF8String, + ASN_STRING_VideotexString, + ASN_STRING_VisibleString, + ASN_STRING_ObjectDescriptor, + ASN_EXPR_TYPE_MAX +} asn1p_expr_type_e; + +#include "asn1p_expr_str.h" +#include "asn1p_expr2uclass.h" + +/* + * A named collection of types. + */ +typedef struct asn1p_expr_s { + + /* + * Human readable name. + */ + char *Identifier; + + /* + * Meta type of the expression (type, value, value set, etc). + */ + asn1p_expr_meta_e meta_type; + + /* + * ASN type of the expression. + */ + asn1p_expr_type_e expr_type; + + /* + * Referenced type, if defined elsewhere. + * (If expr_type == A1TC_REFERENCE) + */ + asn1p_ref_t *reference; + + /* + * Constraints for the type. + */ + asn1p_constraint_t *constraints; + + /* + * A list of parameters for parametrized type declaration + * (AMT_PARAMTYPE). + */ + asn1p_paramlist_t *params; + + /* + * The actual value (DefinedValue or inlined value). + */ + asn1p_value_t *value; + + /* + * The WITH SYHTAX clause. + */ + asn1p_wsyntx_t *with_syntax; + + /* + * A tag. + */ + struct asn1p_type_tag_s { + enum { + TC_NOCLASS, + TC_UNIVERSAL, + TC_APPLICATION, + TC_CONTEXT_SPECIFIC, + TC_PRIVATE, + } tag_class; + enum { + TM_DEFAULT, + TM_IMPLICIT, + TM_EXPLICIT, + } tag_mode; + asn1_integer_t tag_value; + } tag; + + /* + * Whether automatic tagging is applicable for subtypes. + */ + int auto_tags_OK; + + enum asn1p_expr_marker_e { + EM_NOMARK, + EM_OPTIONAL, + EM_DEFAULT, /* FIXME: store the value somewhere. */ + } marker; + int unique; /* UNIQUE */ + + /* + * Members of the constructed type. + */ + TQ_HEAD(struct asn1p_expr_s) members; + + /* + * Next expression in the list. + */ + TQ_ENTRY(struct asn1p_expr_s) next; + + /* + * Line number where this structure is defined in the original + * grammar source. + */ + int _lineno; + /* + * Marks are used for various purposes. + * Here are some predefined ones. + */ + enum { + TM_NOMARK, + TM_RECURSION, /* Used to break recursion */ + } _mark; + + /* + * Opaque data may be attached to this structure, + * probably by compiler. + */ + void *data; + void (*data_free)(void *data); +} asn1p_expr_t; + + +/* + * Constructor and destructor. + */ +asn1p_expr_t *asn1p_expr_new(int _lineno); +asn1p_expr_t *asn1p_expr_clone(asn1p_expr_t *); +void asn1p_expr_free(asn1p_expr_t *expr); + +#endif /* ASN1_PARSER_EXPR_H */ diff --git a/libasn1parser/asn1p_expr2uclass.h b/libasn1parser/asn1p_expr2uclass.h new file mode 100644 index 00000000..416c9f72 --- /dev/null +++ b/libasn1parser/asn1p_expr2uclass.h @@ -0,0 +1,41 @@ +#ifndef ASN1_PARSER_EXPR2UCLASS_H +#define ASN1_PARSER_EXPR2UCLASS_H + +static int +expr_type2uclass_value[ASN_EXPR_TYPE_MAX] + __attribute__ ((unused)) = { + [ ASN_BASIC_BOOLEAN ] = 1, + [ ASN_BASIC_INTEGER ] = 2, + [ ASN_BASIC_BIT_STRING ] = 3, + [ ASN_BASIC_OCTET_STRING ] = 4, + [ ASN_BASIC_NULL ] = 5, + [ ASN_BASIC_OBJECT_IDENTIFIER ] = 6, + [ ASN_BASIC_EXTERNAL ] = 7, + [ ASN_STRING_ObjectDescriptor ] = 7, + [ ASN_BASIC_REAL ] = 9, + [ ASN_BASIC_ENUMERATED ] = 10, + [ ASN_BASIC_EMBEDDED_PDV ] = 11, + [ ASN_STRING_UTF8String ] = 12, + [ ASN_BASIC_RELATIVE_OID ] = 13, + [ ASN_CONSTR_SEQUENCE ] = 16, + [ ASN_CONSTR_SEQUENCE_OF ] = 16, + [ ASN_CONSTR_SET ] = 17, + [ ASN_CONSTR_SET_OF ] = 17, + [ ASN_STRING_NumericString ] = 18, + [ ASN_STRING_PrintableString ] = 19, + [ ASN_STRING_TeletexString ] = 20, + [ ASN_STRING_T61String ] = 20, + [ ASN_STRING_VideotexString ] = 21, + [ ASN_STRING_IA5String ] = 22, + [ ASN_BASIC_UTCTime ] = 23, + [ ASN_BASIC_GeneralizedTime ] = 24, + [ ASN_STRING_GraphicString ] = 25, + [ ASN_STRING_VisibleString ] = 26, + [ ASN_STRING_ISO646String ] = 26, + [ ASN_STRING_GeneralString ] = 27, + [ ASN_STRING_UniversalString ] = 28, + [ ASN_BASIC_CHARACTER_STRING ] = 29, + [ ASN_STRING_BMPString ] = 30, +}; + +#endif /* ASN1_PARSER_EXPR2UCLASS_H */ diff --git a/libasn1parser/asn1p_expr_str.h b/libasn1parser/asn1p_expr_str.h new file mode 100644 index 00000000..02de131b --- /dev/null +++ b/libasn1parser/asn1p_expr_str.h @@ -0,0 +1,57 @@ +/* + * This file is automatically generated by ./expr-h.pl + * DO NOT EDIT MANUALLY, fix the ./expr-h.pl instead if necessary. + */ +#ifndef ASN1_PARSER_EXPR_STR_H +#define ASN1_PARSER_EXPR_STR_H + +static char *asn1p_expr_type2str[] __attribute__ ((unused)) = { + [ ASN_CONSTR_SEQUENCE ] = "SEQUENCE", + [ ASN_CONSTR_CHOICE ] = "CHOICE", + [ ASN_CONSTR_SET ] = "SET", + [ ASN_CONSTR_SEQUENCE_OF ] = "SEQUENCE OF", + [ ASN_CONSTR_SET_OF ] = "SET OF", + [ ASN_CONSTR_ANY ] = "ANY", + [ ASN_BASIC_BOOLEAN ] = "BOOLEAN", + [ ASN_BASIC_NULL ] = "NULL", + [ ASN_BASIC_INTEGER ] = "INTEGER", + [ ASN_BASIC_REAL ] = "REAL", + [ ASN_BASIC_ENUMERATED ] = "ENUMERATED", + [ ASN_BASIC_BIT_STRING ] = "BIT STRING", + [ ASN_BASIC_OCTET_STRING ] = "OCTET STRING", + [ ASN_BASIC_OBJECT_IDENTIFIER ] = "OBJECT IDENTIFIER", + [ ASN_BASIC_RELATIVE_OID ] = "RELATIVE-OID", + [ ASN_BASIC_EXTERNAL ] = "EXTERNAL", + [ ASN_BASIC_EMBEDDED_PDV ] = "EMBEDDED PDV", + [ ASN_BASIC_CHARACTER_STRING ] = "CHARACTER STRING", + [ ASN_BASIC_UTCTime ] = "UTCTime", + [ ASN_BASIC_GeneralizedTime ] = "GeneralizedTime", + [ ASN_STRING_BMPString ] = "BMPString", + [ ASN_STRING_GeneralString ] = "GeneralString", + [ ASN_STRING_GraphicString ] = "GraphicString", + [ ASN_STRING_IA5String ] = "IA5String", + [ ASN_STRING_ISO646String ] = "ISO646String", + [ ASN_STRING_NumericString ] = "NumericString", + [ ASN_STRING_PrintableString ] = "PrintableString", + [ ASN_STRING_TeletexString ] = "TeletexString", + [ ASN_STRING_T61String ] = "T61String", + [ ASN_STRING_UniversalString ] = "UniversalString", + [ ASN_STRING_UTF8String ] = "UTF8String", + [ ASN_STRING_VideotexString ] = "VideotexString", + [ ASN_STRING_VisibleString ] = "VisibleString", + [ ASN_STRING_ObjectDescriptor ] = "ObjectDescriptor", +}; + +/* + * Convert the ASN.1 expression type back into the string representation. + */ +#define ASN_EXPR_TYPE2STR(type) \ + ( \ + ((type) < 0 \ + || (type) >= sizeof(asn1p_expr_type2str) \ + / sizeof(asn1p_expr_type2str[0])) \ + ? (char *)0 \ + : asn1p_expr_type2str[(type)] \ + ) + +#endif /* ASN1_PARSER_EXPR_STR_H */ diff --git a/libasn1parser/asn1p_l.c b/libasn1parser/asn1p_l.c new file mode 100644 index 00000000..6a6eb446 --- /dev/null +++ b/libasn1parser/asn1p_l.c @@ -0,0 +1,3861 @@ +#define yy_create_buffer asn1p__create_buffer +#define yy_delete_buffer asn1p__delete_buffer +#define yy_scan_buffer asn1p__scan_buffer +#define yy_scan_string asn1p__scan_string +#define yy_scan_bytes asn1p__scan_bytes +#define yy_flex_debug asn1p__flex_debug +#define yy_init_buffer asn1p__init_buffer +#define yy_flush_buffer asn1p__flush_buffer +#define yy_load_buffer_state asn1p__load_buffer_state +#define yy_switch_to_buffer asn1p__switch_to_buffer +#define yyin asn1p_in +#define yyleng asn1p_leng +#define yylex asn1p_lex +#define yyout asn1p_out +#define yyrestart asn1p_restart +#define yytext asn1p_text +#define yylineno asn1p_lineno + +#line 20 "lex.yy.c" +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header$ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT + +#define yywrap() 1 +#define YY_SKIP_YYWRAP + +#define FLEX_DEBUG +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; + +#define FLEX_DEBUG +extern int yylineno; +int yylineno = 1; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 123 +#define YY_END_OF_BUFFER 124 +static yyconst short int yy_acclist[1196] = + { 0, + 124, 122, 123, 117, 122, 123, 117, 123, 116, 122, + 123, 15, 122, 123, 116, 122, 123, 122, 123, 116, + 122, 123, 122, 123, 116, 122, 123, 122, 123, 23, + 122, 123, 22, 122, 123, 116, 122, 123, 122, 123, + 111, 112, 122, 123, 111, 112, 122, 123, 111, 112, + 122, 123, 111, 112, 122, 123, 111, 112, 122, 123, + 111, 112, 122, 123, 111, 112, 122, 123, 111, 112, + 122, 123, 111, 112, 122, 123, 111, 112, 122, 123, + 111, 112, 122, 123, 111, 112, 122, 123, 111, 112, + 122, 123, 111, 112, 122, 123, 111, 112, 122, 123, + + 111, 112, 122, 123, 111, 112, 122, 123, 111, 112, + 122, 123, 111, 112, 122, 123, 116, 122, 123, 110, + 122, 123, 5, 122, 123, 2, 123, 2, 122, 123, + 4, 122, 123, 7, 9, 122, 123, 7, 123, 9, + 122, 123, 9, 122, 123, 17, 122, 123, 17, 123, + 18, 122, 123, 12, 122, 123, 12, 123, 14, 122, + 123, 14, 122, 123, 10, 122, 123, 11, 122, 123, + 119, 122, 123, 120, 122, 123, 120, 123, 122, 123, + 121, 122, 123, 117, 15, 15, 108, 109, 1, 21, + 115, 6, 22, 111, 112, 111, 112, 111, 112, 111, + + 112, 111, 112, 111, 112, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 36, 111, 112, 111, 112, 111, + 112, 111, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 111, 112, 111, 112, 112, 112, 111, 112, 111, + 112, 111, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 111, 112, 112, 111, 112, 111, 112, 79, 111, + 112, 111, 112, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 111, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 112, 111, 112, 111, 112, 112, 112, 111, 112, + + 110, 5, 3, 8, 17, 16, 12, 119, 120, 118, + 108, 109, 21, 114, 113, 111, 112, 28, 111, 112, + 29, 111, 112, 111, 112, 111, 112, 111, 112, 33, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 49, 111, 112, 111, 112, 111, 112, 111, + 112, 111, 112, 111, 112, 111, 112, 112, 112, 111, + 112, 111, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 111, 112, 71, 111, 112, 72, 111, 112, 111, + 112, 112, 111, 112, 111, 112, 111, 112, 112, 111, + + 112, 82, 111, 112, 111, 112, 111, 112, 111, 112, + 112, 111, 112, 111, 112, 111, 112, 90, 111, 112, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 112, 111, 112, 111, 112, 111, + 112, 112, 112, 112, 111, 112, 24, 13, 20, 19, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 111, 112, 57, 111, 112, 112, + + 112, 111, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 111, 112, 111, 112, 111, 112, 111, 112, 74, + 111, 112, 112, 111, 112, 111, 112, 111, 112, 112, + 111, 112, 111, 112, 111, 112, 111, 112, 112, 87, + 111, 112, 111, 112, 111, 112, 91, 111, 112, 111, + 112, 111, 112, 111, 112, 95, 111, 112, 97, 111, + 112, 111, 112, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 112, 112, 112, 107, 111, 112, + 111, 112, 111, 112, 111, 112, 111, 112, 32, 111, + 112, 112, 111, 112, 111, 112, 111, 112, 39, 111, + + 112, 111, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 111, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 111, 112, 111, 112, 111, 112, 56, 111, 112, + 112, 112, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 111, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 112, 111, 112, 78, 111, 112, 111, 112, 112, + 111, 112, 111, 112, 111, 112, 111, 112, 112, 111, + 112, 111, 112, 111, 112, 111, 112, 112, 111, 112, + 112, 99, 111, 112, 111, 112, 111, 112, 112, 111, + 112, 112, 112, 112, 25, 26, 111, 112, 111, 112, + + 111, 112, 111, 112, 112, 111, 112, 111, 112, 38, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + 51, 111, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 112, 112, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 111, 112, 112, 76, 111, 112, 111, 112, + 112, 111, 112, 111, 112, 111, 112, 111, 112, 112, + 111, 112, 111, 112, 92, 111, 112, 93, 111, 112, + 112, 111, 112, 112, 100, 111, 112, 111, 112, 112, + + 112, 112, 112, 112, 111, 112, 111, 112, 111, 112, + 112, 35, 111, 112, 111, 112, 111, 112, 111, 112, + 111, 112, 44, 111, 112, 45, 111, 112, 111, 112, + 111, 112, 48, 111, 112, 111, 112, 111, 112, 53, + 111, 112, 111, 112, 111, 112, 112, 112, 112, 111, + 112, 111, 112, 64, 111, 112, 65, 111, 112, 111, + 112, 111, 112, 68, 111, 112, 111, 112, 111, 112, + 111, 112, 112, 111, 112, 112, 81, 111, 112, 111, + 112, 84, 111, 112, 86, 111, 112, 112, 111, 112, + 111, 112, 112, 111, 112, 112, 111, 112, 103, 112, + + 112, 112, 112, 112, 111, 112, 111, 112, 111, 112, + 112, 111, 112, 111, 112, 111, 112, 111, 112, 111, + 112, 47, 111, 112, 111, 112, 52, 111, 112, 111, + 112, 55, 111, 112, 112, 112, 112, 112, 111, 112, + 63, 111, 112, 66, 111, 112, 67, 111, 112, 111, + 112, 112, 111, 112, 112, 80, 111, 112, 112, 111, + 112, 112, 111, 112, 89, 111, 112, 112, 111, 112, + 112, 111, 112, 112, 112, 112, 112, 111, 112, 111, + 112, 31, 111, 112, 34, 112, 37, 111, 112, 40, + 111, 112, 111, 112, 111, 112, 111, 112, 111, 112, + + 111, 112, 112, 112, 112, 61, 112, 111, 112, 111, + 112, 112, 111, 112, 112, 112, 111, 112, 112, 111, + 112, 94, 112, 111, 112, 112, 101, 111, 112, 112, + 112, 112, 112, 111, 112, 111, 112, 41, 111, 112, + 42, 111, 112, 43, 111, 112, 111, 112, 50, 111, + 112, 111, 112, 112, 112, 112, 62, 111, 112, 111, + 112, 112, 111, 112, 112, 112, 111, 112, 112, 111, + 112, 111, 112, 112, 104, 112, 112, 112, 112, 111, + 112, 30, 111, 112, 46, 111, 112, 111, 112, 112, + 112, 112, 111, 112, 112, 111, 112, 112, 112, 111, + + 112, 112, 111, 112, 111, 112, 112, 112, 112, 112, + 24, 25, 111, 112, 111, 112, 112, 112, 112, 69, + 111, 112, 70, 112, 111, 112, 112, 112, 111, 112, + 112, 88, 111, 112, 111, 112, 112, 112, 112, 112, + 111, 112, 54, 111, 112, 59, 112, 112, 60, 112, + 111, 112, 75, 112, 112, 83, 111, 112, 112, 111, + 112, 96, 112, 112, 112, 106, 112, 111, 112, 112, + 73, 111, 112, 112, 112, 111, 112, 112, 105, 112, + 27, 111, 112, 58, 112, 112, 85, 112, 98, 111, + 112, 102, 112, 77, 112 + + } ; + +static yyconst short int yy_accept[676] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 4, 7, 9, 12, 15, 18, + 20, 23, 25, 28, 30, 33, 36, 39, 41, 45, + 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, + 89, 93, 97, 101, 105, 109, 113, 117, 120, 123, + 126, 128, 131, 134, 138, 140, 143, 146, 149, 151, + 154, 157, 159, 162, 165, 168, 171, 174, 177, 179, + 181, 184, 184, 185, 186, 187, 187, 188, 188, 189, + 189, 189, 190, 191, 192, 193, 194, 194, 196, 198, + 200, 202, 204, 206, 207, 209, 211, 213, 215, 218, + + 220, 222, 224, 226, 228, 230, 232, 234, 236, 237, + 238, 240, 242, 244, 246, 248, 250, 252, 254, 255, + 257, 259, 262, 264, 265, 267, 269, 271, 273, 274, + 276, 278, 280, 282, 284, 286, 288, 290, 292, 293, + 295, 297, 298, 299, 301, 301, 301, 301, 301, 301, + 302, 303, 304, 305, 306, 307, 308, 308, 309, 310, + 311, 311, 312, 313, 313, 313, 314, 315, 316, 318, + 321, 324, 326, 328, 330, 333, 335, 337, 339, 341, + 343, 345, 347, 349, 351, 353, 356, 358, 360, 362, + 364, 366, 368, 369, 370, 372, 374, 376, 378, 380, + + 382, 384, 387, 390, 392, 393, 395, 397, 399, 400, + 402, 405, 407, 409, 411, 412, 414, 416, 418, 421, + 423, 425, 427, 429, 431, 433, 435, 436, 438, 440, + 442, 443, 444, 445, 447, 448, 448, 448, 448, 448, + 449, 449, 450, 451, 453, 455, 457, 459, 461, 463, + 465, 467, 469, 471, 473, 475, 477, 479, 481, 483, + 485, 487, 489, 491, 493, 495, 497, 500, 501, 502, + 504, 506, 508, 510, 512, 514, 516, 518, 520, 523, + 524, 526, 528, 530, 531, 533, 535, 537, 539, 540, + 543, 545, 547, 550, 552, 554, 556, 559, 562, 564, + + 565, 567, 569, 571, 573, 575, 576, 577, 578, 581, + 581, 581, 581, 581, 583, 585, 587, 589, 592, 593, + 595, 597, 599, 602, 604, 606, 608, 610, 612, 614, + 616, 618, 620, 622, 624, 626, 628, 631, 632, 633, + 634, 636, 638, 640, 642, 644, 646, 648, 650, 652, + 653, 655, 658, 660, 661, 663, 665, 667, 669, 670, + 672, 674, 676, 678, 679, 681, 682, 685, 687, 689, + 690, 692, 693, 694, 695, 696, 696, 696, 696, 699, + 701, 703, 705, 706, 708, 710, 713, 715, 717, 719, + 721, 723, 725, 727, 729, 731, 734, 736, 738, 740, + + 742, 743, 744, 745, 747, 749, 751, 753, 755, 757, + 759, 761, 763, 765, 766, 769, 771, 772, 774, 776, + 778, 780, 781, 783, 785, 788, 791, 792, 794, 795, + 798, 800, 801, 802, 803, 804, 805, 805, 805, 805, + 807, 809, 811, 812, 815, 817, 819, 821, 823, 826, + 829, 831, 833, 836, 838, 840, 843, 845, 847, 848, + 849, 850, 852, 854, 857, 860, 862, 864, 867, 869, + 871, 873, 874, 876, 877, 880, 882, 885, 888, 889, + 891, 893, 894, 896, 897, 899, 901, 902, 903, 904, + 905, 905, 905, 905, 907, 909, 911, 912, 914, 916, + + 918, 920, 922, 925, 927, 930, 932, 935, 936, 937, + 938, 939, 941, 944, 947, 950, 952, 953, 955, 956, + 959, 960, 962, 963, 965, 968, 969, 971, 972, 974, + 975, 976, 977, 978, 978, 978, 978, 980, 982, 985, + 987, 990, 993, 995, 997, 999, 1001, 1003, 1004, 1005, + 1006, 1008, 1010, 1012, 1013, 1015, 1016, 1017, 1019, 1020, + 1022, 1024, 1026, 1027, 1030, 1031, 1032, 1033, 1034, 1034, + 1034, 1034, 1036, 1038, 1041, 1044, 1047, 1049, 1052, 1054, + 1055, 1056, 1057, 1060, 1062, 1063, 1065, 1066, 1067, 1069, + 1070, 1072, 1074, 1075, 1077, 1078, 1079, 1080, 1080, 1080, + + 1080, 1082, 1085, 1088, 1090, 1091, 1092, 1093, 1095, 1096, + 1098, 1099, 1100, 1102, 1103, 1105, 1107, 1108, 1109, 1110, + 1111, 1111, 1113, 1113, 1115, 1117, 1118, 1119, 1120, 1123, + 1125, 1127, 1128, 1129, 1131, 1132, 1135, 1137, 1138, 1139, + 1140, 1141, 1141, 1143, 1146, 1148, 1149, 1151, 1153, 1155, + 1156, 1159, 1160, 1162, 1164, 1165, 1166, 1168, 1168, 1170, + 1171, 1174, 1175, 1176, 1178, 1179, 1181, 1184, 1186, 1187, + 1189, 1192, 1194, 1196, 1196 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 5, 6, 1, 1, 1, 7, 8, 9, + 9, 10, 1, 9, 11, 12, 13, 14, 15, 16, + 16, 17, 18, 19, 16, 20, 16, 21, 22, 23, + 24, 1, 1, 9, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 1, 52, 53, 1, 1, 54, 55, 56, 57, + + 58, 59, 60, 61, 62, 63, 59, 64, 65, 66, + 67, 68, 59, 69, 70, 71, 72, 73, 59, 74, + 59, 75, 76, 77, 78, 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, 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, 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, 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, 1, 1 + } ; + +static yyconst int yy_meta[79] = + { 0, + 1, 2, 3, 3, 1, 4, 5, 6, 1, 1, + 7, 1, 1, 8, 8, 8, 8, 8, 8, 8, + 9, 1, 1, 9, 8, 8, 8, 8, 8, 8, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 1, 1, 1, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 12, 1, 12 + } ; + +static yyconst short int yy_base[691] = + { 0, + 0, 0, 76, 78, 80, 81, 82, 89, 83, 93, + 96, 106, 844, 833, 116, 119, 822, 821, 177, 126, + 4166, 127, 816, 123, 4166, 134, 805, 4166, 242, 292, + 141, 298, 152, 314, 322, 130, 338, 359, 360, 376, + 382, 397, 410, 437, 440, 462, 463, 495, 0, 0, + 4166, 4166, 811, 4166, 4166, 807, 807, 0, 0, 809, + 0, 0, 787, 4166, 4166, 4166, 0, 160, 191, 104, + 4166, 800, 261, 0, 798, 797, 0, 79, 0, 426, + 793, 4166, 511, 787, 4166, 527, 771, 512, 513, 528, + 529, 544, 550, 0, 561, 567, 578, 589, 595, 611, + + 617, 628, 641, 644, 664, 661, 672, 685, 727, 737, + 696, 702, 713, 719, 730, 741, 747, 758, 725, 771, + 774, 787, 795, 725, 798, 811, 822, 835, 720, 851, + 857, 868, 874, 885, 900, 901, 916, 917, 716, 932, + 933, 716, 45, 948, 980, 987, 736, 97, 120, 0, + 0, 4166, 4166, 0, 4166, 0, 750, 0, 291, 4166, + 761, 0, 0, 79, 739, 994, 4166, 4166, 990, 1003, + 1011, 1014, 1027, 1035, 1038, 1051, 1059, 1067, 1075, 1088, + 1096, 1099, 1120, 1121, 1136, 1142, 1153, 1159, 1170, 1176, + 1187, 1198, 707, 693, 1211, 1219, 1222, 1237, 1240, 1243, + + 1267, 1261, 1264, 1282, 702, 1285, 1300, 1306, 696, 1317, + 1328, 1334, 1345, 1356, 686, 1367, 1373, 1384, 1390, 1405, + 1406, 1421, 1432, 1438, 1453, 1459, 692, 1470, 1481, 1492, + 675, 686, 681, 1503, 4166, 1542, 697, 143, 158, 4166, + 683, 4166, 4166, 1527, 1528, 1543, 1549, 1564, 1565, 1582, + 1581, 1597, 1603, 1614, 1625, 1643, 1640, 1646, 1661, 1664, + 1667, 1682, 1688, 1699, 1710, 1725, 1731, 664, 668, 1742, + 1748, 1763, 1764, 1779, 1785, 1796, 1809, 1817, 1825, 658, + 1840, 1843, 1856, 670, 1864, 1880, 1879, 1896, 649, 1897, + 1912, 1925, 1933, 1936, 1954, 1951, 1957, 1972, 1975, 648, + + 1978, 1993, 1999, 2010, 2016, 660, 649, 660, 2031, 2063, + 283, 280, 305, 2048, 2064, 2072, 2080, 2088, 644, 2096, + 2104, 2117, 2125, 2128, 2146, 2143, 2149, 2164, 2170, 2185, + 2186, 2201, 2216, 2222, 2233, 2239, 2254, 653, 641, 627, + 2255, 2275, 2272, 2293, 2292, 2310, 2309, 2325, 2331, 633, + 2342, 2353, 2359, 623, 2370, 2381, 2387, 2398, 639, 2411, + 2414, 2422, 2435, 616, 2446, 625, 2452, 2467, 2468, 613, + 2483, 607, 604, 610, 4166, 302, 321, 96, 2489, 2504, + 2507, 2515, 610, 2530, 2536, 2547, 2553, 2564, 2570, 2581, + 2592, 2598, 2615, 2621, 2637, 2638, 2653, 2654, 2669, 2675, + + 605, 607, 599, 2686, 2692, 2707, 2708, 2728, 2729, 2744, + 2752, 2765, 2773, 604, 2776, 2794, 631, 2791, 2797, 2812, + 2815, 603, 2823, 2838, 2841, 2844, 590, 2859, 574, 2862, + 2865, 588, 576, 574, 583, 581, 317, 309, 328, 2880, + 2883, 2896, 572, 2904, 2917, 2925, 2928, 2941, 2949, 2952, + 2965, 2976, 2973, 2989, 3000, 3011, 3017, 3028, 54, 589, + 564, 3034, 3045, 3056, 3062, 3073, 3079, 3094, 3095, 3110, + 3111, 583, 3126, 566, 3127, 3144, 3147, 3150, 558, 3165, + 3171, 554, 3186, 576, 3192, 0, 555, 559, 536, 566, + 347, 226, 339, 3203, 3209, 3224, 548, 3230, 3241, 3254, + + 3262, 3265, 3280, 3283, 3291, 3304, 3307, 531, 525, 525, + 531, 3322, 3328, 3339, 3345, 3356, 516, 3367, 512, 3373, + 511, 3384, 521, 3395, 3401, 517, 3412, 504, 3418, 506, + 507, 520, 466, 325, 465, 348, 3429, 3440, 3451, 0, + 3457, 3468, 3479, 3490, 3496, 3511, 3512, 467, 476, 464, + 0, 3527, 3528, 470, 3544, 450, 462, 3545, 474, 3560, + 0, 3566, 447, 3577, 444, 454, 423, 424, 361, 3616, + 353, 3601, 3602, 3617, 3618, 3633, 3634, 3649, 3650, 430, + 434, 428, 3665, 3673, 421, 3681, 421, 412, 3689, 403, + 3697, 3705, 410, 0, 400, 401, 403, 189, 3737, 519, + + 3722, 3723, 3738, 3746, 398, 417, 394, 3759, 398, 3767, + 391, 391, 3770, 383, 3783, 3794, 383, 378, 383, 378, + 371, 4166, 3833, 3818, 3819, 378, 363, 359, 3834, 0, + 3840, 357, 347, 3851, 351, 3857, 3868, 330, 315, 305, + 295, 558, 3884, 3881, 0, 282, 0, 3892, 0, 262, + 3907, 256, 3910, 0, 188, 141, 0, 3954, 3939, 138, + 3940, 120, 105, 3955, 95, 0, 3956, 0, 37, 0, + 3972, 0, 0, 4166, 4017, 4029, 4041, 4053, 4065, 4077, + 4088, 4089, 4093, 4104, 4116, 4128, 4139, 4144, 4149, 4154 + } ; + +static yyconst short int yy_def[691] = + { 0, + 674, 1, 675, 675, 676, 676, 677, 677, 678, 678, + 679, 679, 674, 674, 674, 674, 674, 680, 674, 681, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 682, 683, 684, + 674, 674, 674, 674, 674, 674, 674, 685, 685, 674, + 686, 686, 674, 674, 674, 674, 687, 674, 674, 19, + 674, 674, 674, 680, 680, 674, 688, 674, 689, 681, + 681, 674, 674, 674, 674, 674, 674, 29, 29, 29, + 29, 29, 29, 690, 29, 29, 29, 29, 29, 29, + + 29, 29, 29, 29, 29, 29, 29, 29, 690, 690, + 29, 29, 29, 29, 29, 29, 29, 29, 690, 29, + 29, 29, 29, 690, 29, 29, 29, 29, 690, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 690, 29, + 29, 690, 690, 29, 674, 682, 146, 146, 146, 683, + 684, 674, 674, 685, 674, 686, 674, 687, 674, 674, + 674, 688, 689, 674, 674, 674, 674, 674, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 690, 690, 29, 29, 29, 29, 29, 29, + + 29, 29, 29, 29, 690, 29, 29, 29, 690, 29, + 29, 29, 29, 29, 690, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 690, 29, 29, 29, + 690, 690, 690, 29, 674, 674, 146, 146, 146, 674, + 674, 674, 674, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 690, 690, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 690, + 29, 29, 29, 690, 29, 29, 29, 29, 690, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 690, + + 29, 29, 29, 29, 29, 690, 690, 690, 29, 674, + 146, 146, 146, 29, 29, 29, 29, 29, 690, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 690, 690, 690, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 690, + 29, 29, 29, 690, 29, 29, 29, 29, 690, 29, + 29, 29, 29, 690, 29, 690, 29, 29, 29, 690, + 29, 690, 690, 690, 674, 146, 146, 146, 29, 29, + 29, 29, 690, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + + 690, 690, 690, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 690, 29, 29, 690, 29, 29, 29, + 29, 690, 29, 29, 29, 29, 690, 29, 690, 29, + 29, 690, 690, 690, 690, 690, 146, 146, 146, 29, + 29, 29, 690, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 690, 690, + 690, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 690, 29, 690, 29, 29, 29, 29, 690, 29, + 29, 690, 29, 690, 29, 690, 690, 690, 690, 690, + 146, 146, 146, 29, 29, 29, 690, 29, 29, 29, + + 29, 29, 29, 29, 29, 29, 29, 690, 690, 690, + 690, 29, 29, 29, 29, 29, 690, 29, 690, 29, + 690, 29, 690, 29, 29, 690, 29, 690, 29, 690, + 690, 690, 690, 146, 146, 146, 29, 29, 29, 690, + 29, 29, 29, 29, 29, 29, 29, 690, 690, 690, + 690, 29, 29, 690, 29, 690, 690, 29, 690, 29, + 690, 29, 690, 29, 690, 690, 690, 690, 146, 674, + 146, 29, 29, 29, 29, 29, 29, 29, 29, 690, + 690, 690, 29, 29, 690, 29, 690, 690, 29, 690, + 29, 29, 690, 690, 690, 690, 690, 146, 674, 146, + + 29, 29, 29, 29, 690, 690, 690, 29, 690, 29, + 690, 690, 29, 690, 29, 29, 690, 690, 690, 690, + 146, 674, 674, 29, 29, 690, 690, 690, 29, 690, + 29, 690, 690, 29, 690, 29, 29, 690, 690, 690, + 690, 146, 29, 29, 690, 690, 690, 29, 690, 690, + 29, 690, 29, 690, 690, 690, 690, 674, 29, 690, + 29, 690, 690, 29, 690, 690, 29, 690, 690, 690, + 29, 690, 690, 0, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674 + } ; + +static yyconst short int yy_nxt[4245] = + { 0, + 14, 15, 16, 15, 17, 18, 19, 20, 21, 14, + 22, 23, 24, 25, 26, 26, 26, 26, 26, 26, + 27, 17, 28, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 36, 36, 36, 38, 39, 40, 41, + 36, 42, 43, 44, 45, 46, 47, 36, 36, 36, + 48, 17, 14, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 21, 17, 21, 51, 52, + 51, 52, 55, 55, 59, 62, 53, 60, 53, 56, + 56, 59, 57, 57, 60, 62, 508, 68, 69, 68, + + 76, 232, 70, 63, 242, 673, 64, 68, 69, 68, + 243, 674, 70, 63, 233, 509, 64, 73, 73, 73, + 73, 73, 73, 72, 439, 674, 72, 80, 80, 80, + 72, 78, 85, 72, 72, 147, 147, 82, 238, 80, + 80, 83, 83, 83, 83, 83, 83, 86, 86, 86, + 86, 86, 86, 86, 672, 88, 674, 239, 65, 147, + 66, 159, 159, 159, 670, 88, 88, 88, 65, 88, + 66, 28, 100, 71, 88, 312, 101, 88, 88, 102, + 88, 28, 147, 71, 72, 88, 669, 88, 104, 105, + 313, 88, 159, 159, 159, 668, 88, 147, 76, 106, + + 666, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 621, 147, 78, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 88, 665, 535, 88, 88, 88, 88, 88, + 88, 88, 73, 73, 73, 147, 88, 89, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 90, 88, 91, + 88, 92, 88, 88, 88, 88, 93, 88, 88, 88, + 88, 88, 159, 159, 159, 94, 94, 94, 94, 94, + + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 88, 376, 147, + 95, 663, 147, 88, 96, 377, 103, 88, 97, 88, + 98, 88, 662, 88, 437, 88, 88, 88, 107, 88, + 99, 147, 88, 491, 147, 438, 660, 88, 147, 88, + 378, 88, 492, 88, 657, 108, 147, 88, 88, 88, + 147, 88, 111, 88, 147, 112, 88, 147, 569, 493, + 656, 534, 571, 88, 113, 114, 655, 88, 147, 109, + 115, 536, 88, 116, 88, 88, 147, 147, 600, 654, + 110, 117, 147, 598, 88, 88, 88, 88, 88, 88, + + 147, 120, 121, 88, 118, 122, 125, 88, 642, 126, + 147, 88, 652, 88, 650, 123, 649, 127, 647, 88, + 88, 88, 88, 128, 646, 130, 88, 80, 80, 80, + 124, 119, 88, 164, 88, 88, 88, 645, 131, 80, + 80, 88, 132, 641, 640, 88, 639, 88, 638, 88, + 129, 635, 633, 133, 88, 135, 632, 630, 134, 628, + 627, 136, 88, 626, 620, 88, 570, 570, 570, 619, + 618, 617, 88, 614, 88, 88, 88, 140, 137, 88, + 612, 88, 611, 141, 88, 138, 609, 88, 88, 607, + 606, 605, 597, 596, 139, 144, 595, 88, 88, 88, + + 88, 88, 88, 594, 147, 142, 88, 88, 145, 145, + 145, 145, 145, 145, 145, 593, 590, 588, 587, 146, + 623, 623, 623, 143, 166, 166, 166, 166, 166, 166, + 166, 585, 582, 581, 148, 580, 568, 88, 88, 149, + 86, 86, 86, 86, 86, 86, 86, 88, 88, 88, + 88, 88, 88, 88, 88, 169, 88, 88, 147, 658, + 658, 658, 567, 170, 88, 88, 88, 88, 88, 88, + 566, 565, 88, 88, 563, 88, 561, 171, 559, 88, + 557, 88, 556, 172, 554, 88, 88, 88, 88, 88, + 551, 174, 88, 173, 88, 550, 88, 147, 88, 549, + + 88, 548, 88, 88, 88, 88, 88, 540, 533, 532, + 175, 88, 531, 88, 88, 88, 530, 176, 528, 526, + 88, 523, 88, 521, 88, 519, 88, 177, 88, 511, + 88, 510, 88, 88, 88, 178, 88, 497, 490, 88, + 489, 180, 88, 488, 487, 486, 88, 484, 88, 179, + 88, 482, 88, 88, 88, 88, 88, 479, 474, 472, + 461, 88, 460, 88, 181, 182, 88, 88, 459, 184, + 183, 443, 88, 436, 435, 434, 88, 432, 88, 88, + 88, 88, 429, 88, 427, 88, 88, 188, 88, 88, + 185, 186, 422, 417, 414, 403, 88, 88, 88, 88, + + 189, 88, 402, 88, 190, 88, 401, 191, 187, 88, + 88, 88, 383, 195, 374, 373, 88, 372, 366, 359, + 88, 88, 88, 192, 88, 354, 350, 88, 339, 88, + 196, 88, 338, 88, 160, 88, 311, 88, 88, 88, + 88, 88, 308, 307, 88, 198, 88, 306, 88, 300, + 88, 289, 197, 284, 88, 88, 88, 88, 88, 280, + 269, 199, 200, 88, 268, 88, 88, 88, 201, 88, + 243, 241, 88, 240, 88, 147, 88, 231, 88, 227, + 88, 215, 88, 88, 203, 88, 88, 209, 202, 205, + 194, 88, 193, 204, 168, 88, 88, 88, 167, 88, + + 165, 161, 88, 160, 206, 160, 88, 157, 88, 88, + 88, 88, 88, 88, 155, 88, 85, 207, 88, 153, + 88, 152, 88, 88, 88, 87, 88, 84, 75, 72, + 88, 88, 88, 88, 88, 88, 88, 88, 208, 88, + 72, 210, 88, 674, 674, 674, 88, 88, 88, 674, + 88, 674, 674, 674, 674, 88, 211, 88, 674, 88, + 88, 88, 674, 213, 674, 674, 212, 214, 674, 674, + 88, 674, 88, 674, 88, 216, 88, 674, 674, 88, + 674, 674, 88, 674, 674, 674, 217, 674, 88, 674, + 88, 674, 88, 88, 88, 88, 88, 218, 674, 88, + + 219, 88, 674, 88, 674, 88, 674, 88, 674, 88, + 88, 88, 88, 88, 223, 221, 674, 220, 88, 674, + 88, 674, 222, 674, 88, 88, 88, 674, 674, 88, + 674, 224, 674, 674, 674, 88, 88, 88, 88, 88, + 88, 88, 88, 674, 88, 88, 674, 674, 674, 674, + 674, 88, 88, 88, 88, 88, 226, 88, 88, 229, + 225, 88, 230, 674, 228, 674, 674, 88, 88, 88, + 88, 88, 88, 88, 674, 674, 88, 88, 674, 674, + 674, 674, 674, 88, 674, 88, 674, 88, 236, 236, + 236, 234, 88, 145, 145, 145, 145, 145, 145, 145, + + 674, 674, 674, 674, 674, 674, 674, 166, 166, 166, + 166, 166, 166, 166, 674, 88, 674, 674, 244, 674, + 674, 674, 674, 674, 674, 88, 237, 88, 88, 88, + 674, 235, 674, 245, 88, 674, 88, 674, 88, 88, + 88, 674, 88, 674, 674, 674, 88, 88, 88, 246, + 88, 88, 88, 88, 674, 88, 674, 674, 88, 674, + 88, 674, 88, 88, 88, 247, 88, 248, 674, 674, + 88, 88, 88, 88, 88, 88, 88, 88, 674, 88, + 674, 674, 88, 674, 88, 674, 88, 674, 88, 674, + 88, 674, 88, 249, 250, 88, 88, 674, 88, 674, + + 88, 674, 88, 88, 88, 674, 88, 252, 251, 674, + 88, 88, 88, 88, 88, 674, 674, 674, 674, 88, + 674, 88, 674, 88, 88, 88, 674, 88, 674, 674, + 253, 88, 88, 88, 88, 254, 88, 674, 88, 674, + 88, 255, 256, 88, 257, 88, 88, 674, 674, 259, + 674, 674, 258, 674, 674, 88, 88, 88, 88, 88, + 88, 88, 674, 674, 88, 88, 674, 88, 674, 674, + 674, 88, 674, 88, 260, 88, 674, 88, 88, 88, + 88, 88, 674, 674, 88, 674, 88, 262, 88, 261, + 88, 674, 88, 674, 88, 88, 88, 88, 88, 674, + + 674, 88, 674, 88, 265, 263, 674, 88, 264, 88, + 674, 88, 88, 88, 88, 88, 674, 674, 674, 674, + 88, 674, 88, 88, 88, 674, 88, 674, 674, 266, + 674, 88, 674, 88, 267, 88, 88, 88, 674, 674, + 674, 674, 88, 674, 88, 674, 88, 88, 88, 674, + 88, 674, 674, 270, 88, 88, 271, 272, 88, 88, + 273, 88, 88, 88, 674, 88, 88, 674, 88, 674, + 674, 276, 274, 674, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 275, 88, 277, 88, 88, 674, 88, + 674, 674, 88, 674, 674, 674, 88, 674, 88, 88, + + 88, 88, 88, 88, 88, 88, 88, 88, 278, 674, + 88, 88, 674, 281, 674, 674, 674, 279, 674, 88, + 88, 88, 88, 674, 88, 88, 88, 674, 282, 88, + 674, 88, 674, 674, 674, 88, 674, 88, 283, 88, + 674, 88, 88, 88, 88, 88, 674, 674, 674, 674, + 88, 674, 88, 88, 88, 674, 88, 674, 674, 88, + 285, 88, 674, 88, 674, 88, 674, 88, 674, 88, + 88, 88, 88, 88, 674, 674, 286, 674, 88, 674, + 88, 88, 88, 674, 88, 674, 674, 287, 674, 88, + 674, 88, 88, 88, 674, 88, 674, 291, 88, 674, + + 88, 288, 290, 674, 88, 674, 88, 674, 88, 88, + 88, 88, 88, 674, 674, 88, 674, 88, 674, 88, + 674, 88, 674, 88, 674, 88, 674, 88, 292, 88, + 88, 88, 674, 293, 88, 674, 674, 674, 294, 674, + 88, 88, 88, 88, 88, 88, 88, 674, 674, 88, + 88, 674, 674, 674, 674, 674, 88, 88, 88, 674, + 88, 674, 674, 88, 295, 88, 674, 88, 674, 88, + 674, 88, 674, 88, 296, 88, 88, 88, 88, 674, + 297, 298, 88, 674, 88, 674, 674, 299, 88, 674, + 88, 674, 88, 674, 88, 88, 88, 88, 88, 674, + + 674, 674, 674, 88, 674, 88, 88, 88, 301, 88, + 302, 305, 674, 674, 88, 303, 88, 88, 88, 674, + 88, 674, 674, 674, 304, 88, 674, 88, 88, 88, + 674, 88, 674, 674, 309, 674, 88, 674, 88, 674, + 88, 674, 88, 236, 236, 236, 674, 88, 674, 674, + 674, 674, 88, 88, 674, 310, 310, 310, 310, 310, + 310, 310, 88, 88, 314, 88, 88, 88, 88, 315, + 674, 88, 88, 674, 88, 316, 674, 674, 88, 674, + 88, 674, 88, 674, 88, 317, 88, 88, 88, 88, + 88, 674, 674, 88, 674, 674, 674, 674, 674, 88, + + 88, 318, 88, 88, 88, 321, 88, 88, 88, 88, + 320, 674, 674, 674, 674, 674, 88, 88, 88, 88, + 88, 88, 88, 322, 674, 88, 88, 674, 88, 674, + 674, 674, 88, 674, 88, 319, 88, 674, 88, 88, + 88, 88, 88, 674, 674, 323, 674, 88, 674, 88, + 88, 88, 324, 88, 674, 674, 674, 674, 88, 674, + 88, 674, 88, 674, 88, 88, 325, 326, 88, 88, + 674, 88, 674, 674, 674, 88, 674, 88, 88, 88, + 88, 88, 88, 328, 327, 88, 88, 88, 329, 88, + 88, 330, 88, 674, 674, 331, 88, 674, 88, 88, + + 88, 88, 88, 88, 88, 88, 88, 88, 88, 674, + 674, 88, 674, 88, 674, 674, 674, 88, 674, 88, + 333, 332, 674, 88, 88, 88, 88, 88, 674, 674, + 674, 674, 88, 674, 88, 88, 88, 674, 88, 674, + 334, 674, 674, 88, 674, 88, 674, 335, 674, 88, + 88, 336, 674, 337, 88, 674, 88, 674, 674, 674, + 88, 674, 88, 674, 88, 674, 88, 88, 88, 88, + 88, 674, 674, 88, 674, 88, 674, 88, 674, 88, + 674, 88, 674, 88, 674, 88, 88, 88, 88, 88, + 674, 341, 88, 674, 674, 342, 674, 674, 88, 88, + + 88, 88, 88, 88, 88, 343, 674, 88, 88, 345, + 88, 674, 340, 674, 88, 674, 88, 674, 88, 674, + 88, 88, 88, 344, 88, 348, 346, 674, 674, 88, + 674, 88, 674, 88, 88, 88, 674, 347, 674, 674, + 88, 674, 88, 674, 88, 674, 88, 674, 88, 674, + 88, 674, 88, 88, 88, 674, 88, 674, 674, 349, + 88, 88, 88, 674, 88, 88, 351, 674, 88, 88, + 674, 674, 674, 674, 674, 88, 674, 88, 88, 88, + 88, 88, 88, 674, 88, 674, 352, 88, 674, 88, + 356, 88, 355, 88, 353, 88, 674, 674, 674, 88, + + 88, 88, 674, 88, 88, 88, 674, 357, 88, 674, + 674, 674, 674, 674, 88, 88, 88, 88, 88, 88, + 358, 88, 88, 88, 88, 674, 674, 674, 674, 674, + 674, 88, 88, 88, 88, 88, 88, 88, 674, 674, + 88, 88, 674, 674, 674, 674, 674, 88, 674, 88, + 88, 88, 674, 361, 674, 360, 88, 674, 88, 674, + 88, 88, 88, 674, 88, 674, 674, 674, 88, 88, + 88, 88, 88, 362, 674, 88, 88, 88, 363, 88, + 88, 674, 88, 674, 674, 365, 88, 674, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 674, + + 88, 88, 674, 88, 674, 674, 674, 88, 674, 88, + 88, 88, 88, 88, 88, 367, 88, 88, 88, 88, + 674, 364, 88, 674, 88, 674, 674, 369, 88, 674, + 88, 674, 88, 674, 88, 88, 88, 368, 88, 674, + 674, 88, 674, 88, 674, 88, 674, 88, 674, 88, + 674, 88, 674, 88, 88, 88, 88, 674, 371, 674, + 88, 674, 674, 674, 674, 674, 88, 674, 88, 674, + 88, 370, 674, 88, 674, 88, 310, 310, 310, 310, + 310, 310, 310, 88, 674, 88, 674, 88, 380, 88, + 674, 379, 88, 674, 674, 674, 674, 88, 381, 88, + + 674, 88, 674, 88, 382, 88, 674, 88, 88, 88, + 674, 88, 674, 88, 375, 88, 88, 88, 674, 88, + 384, 88, 674, 88, 88, 88, 674, 88, 674, 88, + 385, 88, 88, 88, 674, 88, 674, 674, 674, 88, + 88, 88, 88, 88, 674, 386, 674, 674, 88, 674, + 88, 674, 88, 88, 88, 674, 88, 674, 674, 674, + 88, 88, 88, 88, 88, 387, 674, 88, 88, 88, + 388, 88, 88, 674, 88, 389, 674, 674, 88, 674, + 88, 88, 88, 88, 390, 88, 88, 88, 88, 88, + 88, 674, 391, 88, 674, 88, 392, 393, 674, 88, + + 674, 88, 674, 88, 674, 88, 674, 88, 88, 88, + 88, 88, 674, 394, 88, 674, 674, 674, 674, 674, + 88, 88, 88, 88, 88, 88, 88, 395, 674, 88, + 88, 674, 674, 674, 674, 674, 88, 674, 88, 674, + 88, 88, 397, 674, 396, 88, 674, 88, 674, 674, + 674, 88, 674, 88, 674, 88, 674, 88, 88, 88, + 88, 88, 674, 674, 88, 398, 88, 674, 88, 674, + 88, 674, 88, 674, 88, 399, 400, 88, 88, 88, + 88, 674, 674, 88, 674, 674, 674, 404, 674, 88, + 88, 88, 88, 88, 88, 674, 674, 88, 88, 88, + + 88, 405, 674, 406, 674, 674, 674, 88, 674, 88, + 88, 88, 88, 674, 88, 407, 88, 88, 88, 88, + 408, 674, 674, 674, 674, 674, 674, 88, 88, 409, + 88, 88, 88, 674, 88, 88, 88, 88, 410, 674, + 674, 413, 674, 412, 88, 88, 88, 88, 88, 88, + 88, 411, 674, 88, 88, 674, 88, 674, 674, 674, + 88, 674, 88, 674, 88, 674, 88, 88, 88, 88, + 88, 674, 674, 674, 674, 88, 674, 88, 88, 88, + 674, 88, 674, 674, 88, 415, 88, 674, 88, 674, + 88, 674, 88, 674, 88, 88, 416, 88, 88, 674, + + 674, 674, 674, 88, 674, 88, 88, 88, 674, 88, + 674, 418, 88, 419, 88, 674, 88, 674, 88, 674, + 88, 674, 88, 88, 420, 88, 88, 674, 674, 674, + 674, 88, 674, 88, 674, 88, 88, 88, 674, 88, + 674, 421, 88, 423, 674, 674, 88, 88, 88, 88, + 88, 424, 425, 88, 674, 88, 674, 88, 88, 88, + 88, 88, 674, 674, 674, 674, 88, 674, 674, 674, + 88, 88, 88, 674, 88, 674, 674, 88, 428, 88, + 674, 88, 426, 88, 674, 88, 674, 88, 674, 88, + 88, 88, 88, 88, 674, 430, 88, 674, 674, 674, + + 674, 674, 88, 88, 88, 88, 88, 88, 88, 431, + 674, 88, 88, 674, 88, 674, 674, 674, 88, 674, + 88, 674, 88, 674, 88, 674, 88, 88, 88, 88, + 440, 441, 88, 88, 674, 674, 674, 674, 674, 88, + 88, 88, 88, 88, 88, 674, 88, 674, 88, 674, + 88, 88, 88, 433, 88, 88, 674, 674, 442, 88, + 674, 88, 674, 674, 674, 88, 674, 444, 674, 88, + 674, 88, 88, 88, 88, 88, 674, 674, 88, 445, + 88, 446, 88, 674, 88, 674, 88, 674, 88, 88, + 88, 88, 88, 674, 674, 88, 447, 88, 674, 88, + + 674, 88, 674, 88, 674, 88, 88, 448, 88, 88, + 674, 674, 674, 674, 88, 674, 88, 88, 88, 450, + 88, 674, 674, 88, 449, 88, 674, 88, 674, 88, + 674, 88, 674, 88, 674, 88, 88, 88, 674, 674, + 88, 451, 88, 452, 674, 674, 88, 674, 453, 674, + 88, 674, 88, 674, 88, 674, 88, 674, 88, 88, + 88, 454, 88, 88, 674, 88, 674, 674, 674, 674, + 674, 674, 88, 88, 88, 88, 88, 88, 88, 88, + 674, 88, 88, 674, 674, 455, 674, 674, 88, 88, + 88, 88, 88, 88, 88, 674, 456, 88, 88, 458, + + 88, 457, 674, 674, 88, 674, 88, 674, 88, 674, + 88, 88, 88, 88, 88, 462, 674, 88, 674, 88, + 674, 88, 674, 88, 463, 88, 674, 88, 674, 88, + 88, 88, 88, 88, 464, 674, 88, 674, 674, 674, + 674, 674, 88, 88, 88, 88, 88, 88, 674, 674, + 465, 88, 88, 88, 88, 467, 466, 674, 674, 674, + 674, 674, 674, 88, 88, 88, 88, 88, 88, 88, + 674, 674, 88, 88, 674, 674, 674, 88, 674, 88, + 469, 88, 674, 88, 674, 468, 674, 88, 88, 88, + 88, 88, 674, 674, 674, 674, 88, 674, 88, 674, + + 88, 88, 88, 674, 88, 471, 674, 470, 88, 88, + 88, 88, 88, 88, 674, 88, 88, 88, 473, 88, + 88, 674, 88, 674, 674, 674, 88, 674, 475, 88, + 88, 88, 88, 88, 476, 88, 88, 88, 88, 674, + 88, 88, 674, 478, 674, 674, 674, 88, 88, 88, + 88, 88, 88, 674, 88, 477, 88, 674, 88, 88, + 88, 674, 88, 88, 481, 674, 88, 88, 480, 88, + 674, 674, 674, 88, 674, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 483, 88, 88, 674, + 88, 674, 674, 674, 88, 674, 88, 88, 88, 88, + + 88, 88, 88, 88, 88, 88, 88, 485, 88, 88, + 674, 674, 674, 674, 674, 88, 674, 88, 88, 88, + 88, 88, 88, 494, 88, 674, 495, 88, 496, 88, + 674, 88, 674, 88, 674, 88, 674, 674, 674, 88, + 88, 88, 88, 88, 674, 498, 674, 674, 88, 674, + 88, 674, 88, 88, 88, 674, 88, 674, 674, 674, + 88, 88, 499, 88, 88, 500, 88, 88, 674, 88, + 674, 674, 88, 501, 88, 674, 88, 88, 88, 674, + 88, 674, 674, 674, 88, 88, 88, 88, 88, 88, + 88, 88, 674, 88, 674, 674, 88, 502, 88, 674, + + 88, 88, 88, 503, 88, 674, 674, 674, 88, 88, + 88, 88, 88, 88, 88, 88, 674, 88, 674, 674, + 88, 674, 674, 674, 88, 88, 88, 674, 88, 674, + 674, 674, 504, 88, 674, 88, 88, 88, 674, 88, + 674, 674, 506, 505, 88, 674, 88, 674, 88, 674, + 88, 674, 88, 88, 88, 88, 88, 674, 674, 88, + 674, 88, 674, 507, 674, 88, 512, 88, 674, 88, + 88, 88, 88, 88, 674, 674, 674, 674, 88, 674, + 88, 88, 88, 674, 88, 674, 674, 88, 513, 88, + 674, 88, 674, 88, 674, 88, 674, 88, 88, 88, + + 88, 88, 674, 674, 88, 674, 88, 515, 88, 674, + 88, 674, 88, 674, 88, 514, 88, 88, 88, 88, + 88, 516, 674, 88, 674, 674, 674, 674, 674, 88, + 88, 88, 88, 88, 88, 88, 88, 674, 88, 88, + 674, 674, 674, 674, 674, 88, 88, 88, 518, 88, + 88, 88, 88, 674, 88, 88, 674, 674, 674, 674, + 674, 520, 88, 88, 88, 88, 88, 674, 674, 88, + 88, 88, 88, 522, 674, 88, 674, 674, 674, 88, + 517, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 674, 524, 88, 674, 88, 674, 674, 525, + + 88, 674, 88, 674, 88, 674, 88, 674, 88, 88, + 88, 88, 674, 537, 527, 88, 529, 88, 674, 674, + 674, 88, 674, 88, 674, 88, 674, 88, 88, 88, + 88, 88, 674, 674, 88, 674, 88, 674, 88, 674, + 88, 538, 88, 674, 88, 674, 88, 88, 88, 88, + 539, 674, 674, 88, 674, 88, 674, 674, 674, 88, + 674, 88, 674, 88, 674, 88, 88, 88, 88, 88, + 674, 541, 674, 674, 88, 674, 88, 674, 88, 88, + 88, 674, 543, 674, 542, 88, 674, 88, 674, 88, + 88, 88, 674, 88, 674, 674, 674, 88, 88, 544, + + 88, 88, 88, 545, 88, 88, 88, 674, 88, 88, + 674, 546, 674, 674, 674, 88, 88, 88, 88, 88, + 88, 674, 88, 674, 88, 674, 88, 88, 88, 88, + 88, 674, 88, 674, 674, 88, 547, 674, 674, 88, + 674, 88, 88, 88, 88, 674, 88, 88, 88, 674, + 552, 88, 674, 88, 674, 674, 674, 88, 674, 88, + 674, 88, 674, 88, 88, 88, 88, 88, 674, 674, + 88, 674, 88, 674, 88, 674, 88, 674, 88, 674, + 88, 88, 88, 88, 88, 674, 674, 674, 674, 88, + 674, 88, 88, 88, 674, 88, 555, 674, 88, 553, + + 88, 674, 88, 674, 88, 560, 88, 674, 88, 88, + 88, 88, 88, 674, 674, 674, 558, 88, 674, 88, + 88, 88, 674, 88, 674, 674, 88, 674, 88, 674, + 88, 674, 88, 674, 88, 674, 88, 88, 88, 88, + 88, 674, 674, 88, 674, 88, 674, 88, 674, 562, + 674, 88, 674, 564, 88, 88, 88, 88, 674, 674, + 674, 674, 88, 674, 88, 88, 88, 674, 88, 674, + 674, 572, 674, 88, 674, 88, 88, 88, 573, 88, + 674, 674, 88, 674, 88, 674, 88, 674, 88, 674, + 88, 674, 88, 88, 88, 88, 88, 674, 674, 674, + + 674, 88, 674, 88, 88, 88, 575, 88, 674, 674, + 574, 674, 88, 674, 88, 88, 88, 674, 88, 674, + 576, 88, 674, 88, 674, 88, 674, 88, 674, 88, + 674, 88, 674, 577, 88, 88, 88, 88, 578, 674, + 88, 674, 674, 674, 674, 674, 88, 579, 88, 88, + 88, 88, 88, 88, 674, 88, 88, 674, 674, 674, + 584, 674, 88, 88, 88, 88, 88, 88, 583, 88, + 88, 88, 88, 674, 674, 674, 586, 674, 674, 88, + 88, 88, 589, 88, 88, 88, 674, 674, 88, 88, + 674, 88, 674, 674, 674, 88, 674, 88, 591, 88, + + 674, 88, 88, 88, 88, 88, 674, 674, 674, 592, + 88, 674, 88, 674, 88, 674, 88, 570, 570, 570, + 674, 88, 674, 674, 674, 674, 88, 88, 674, 599, + 599, 599, 599, 599, 599, 599, 88, 88, 88, 602, + 88, 88, 88, 88, 674, 88, 88, 674, 674, 601, + 674, 674, 88, 88, 88, 88, 88, 88, 88, 88, + 674, 88, 88, 674, 674, 674, 674, 674, 88, 88, + 88, 88, 88, 88, 88, 88, 603, 88, 88, 674, + 674, 674, 604, 674, 88, 88, 88, 88, 88, 88, + 88, 674, 674, 88, 88, 674, 674, 674, 88, 674, + + 88, 674, 88, 674, 88, 674, 88, 674, 88, 88, + 88, 608, 88, 674, 88, 674, 88, 88, 610, 674, + 88, 613, 88, 674, 88, 88, 88, 674, 88, 615, + 88, 674, 88, 88, 88, 674, 88, 616, 674, 674, + 88, 88, 88, 674, 88, 674, 674, 88, 88, 88, + 599, 599, 599, 599, 599, 599, 599, 88, 88, 624, + 88, 88, 88, 88, 674, 674, 88, 88, 674, 674, + 674, 88, 674, 88, 674, 88, 674, 88, 674, 674, + 674, 88, 88, 88, 88, 88, 674, 674, 622, 625, + 88, 674, 88, 674, 88, 88, 629, 674, 88, 631, + + 674, 674, 88, 88, 88, 88, 88, 88, 88, 88, + 636, 88, 674, 634, 88, 674, 674, 674, 88, 88, + 88, 674, 88, 637, 674, 674, 674, 88, 674, 88, + 674, 88, 674, 88, 623, 623, 623, 674, 88, 674, + 674, 674, 674, 88, 88, 674, 599, 599, 599, 599, + 599, 599, 599, 88, 88, 88, 88, 88, 88, 88, + 674, 643, 88, 88, 674, 88, 674, 644, 674, 88, + 674, 88, 674, 88, 674, 88, 88, 88, 88, 88, + 674, 674, 88, 648, 88, 674, 88, 674, 88, 674, + 88, 674, 88, 88, 88, 88, 88, 674, 674, 651, + + 653, 88, 674, 88, 674, 88, 88, 88, 659, 88, + 674, 674, 88, 674, 674, 674, 88, 88, 88, 88, + 88, 88, 674, 88, 674, 88, 674, 88, 88, 88, + 674, 88, 88, 674, 674, 88, 88, 674, 664, 674, + 661, 674, 88, 674, 88, 88, 88, 88, 674, 88, + 674, 88, 674, 674, 88, 658, 658, 658, 674, 674, + 674, 674, 674, 674, 88, 88, 674, 599, 599, 599, + 599, 599, 599, 599, 88, 88, 88, 88, 88, 88, + 88, 88, 674, 88, 88, 674, 667, 674, 674, 674, + 88, 88, 88, 88, 88, 88, 671, 88, 674, 88, + + 88, 674, 674, 674, 674, 674, 674, 88, 674, 88, + 674, 88, 674, 674, 674, 674, 88, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 54, + 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, + 54, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 67, 67, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 67, 74, 74, 74, + 674, 74, 74, 74, 74, 74, 74, 74, 74, 81, + 81, 674, 674, 81, 674, 81, 147, 674, 147, 150, + + 150, 674, 150, 150, 151, 151, 674, 151, 151, 151, + 674, 151, 151, 151, 151, 151, 154, 154, 154, 674, + 154, 154, 154, 154, 154, 154, 154, 154, 156, 156, + 156, 156, 156, 156, 156, 156, 674, 156, 156, 158, + 674, 674, 158, 674, 158, 158, 158, 158, 158, 158, + 162, 162, 674, 162, 162, 163, 163, 674, 163, 163, + 94, 94, 674, 94, 94, 13, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674 + } ; + +static yyconst short int yy_chk[4245] = + { 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, 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, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, + 4, 4, 5, 6, 7, 9, 3, 7, 4, 5, + 6, 8, 5, 6, 8, 10, 459, 11, 11, 11, + + 78, 143, 11, 9, 164, 669, 9, 12, 12, 12, + 164, 70, 12, 10, 143, 459, 10, 15, 15, 15, + 16, 16, 16, 15, 378, 70, 16, 20, 20, 20, + 24, 78, 24, 20, 22, 378, 148, 22, 148, 20, + 20, 22, 22, 22, 22, 22, 22, 26, 26, 26, + 26, 26, 26, 26, 665, 36, 70, 149, 9, 149, + 9, 68, 68, 68, 663, 36, 31, 36, 10, 36, + 10, 11, 31, 11, 36, 238, 31, 33, 31, 31, + 31, 12, 238, 12, 19, 31, 662, 33, 33, 33, + 239, 33, 69, 69, 69, 660, 33, 239, 19, 33, + + 656, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 598, 598, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 29, 655, 492, 29, 29, 29, 29, 29, + 29, 29, 73, 73, 73, 492, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 159, 159, 159, 29, 29, 29, 29, 29, + + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 30, 311, 312, + 30, 652, 311, 32, 30, 312, 32, 30, 30, 30, + 30, 30, 650, 32, 376, 32, 30, 32, 34, 34, + 30, 376, 32, 437, 313, 377, 646, 35, 438, 34, + 313, 34, 438, 34, 641, 34, 437, 35, 34, 35, + 377, 35, 37, 37, 534, 37, 35, 439, 534, 439, + 640, 491, 536, 37, 37, 37, 639, 37, 493, 35, + 37, 493, 37, 38, 38, 39, 491, 536, 571, 638, + 35, 38, 571, 569, 38, 39, 38, 39, 38, 39, + + 569, 40, 40, 38, 39, 40, 41, 41, 621, 41, + 621, 40, 635, 40, 633, 40, 632, 41, 628, 41, + 40, 41, 42, 41, 627, 42, 41, 80, 80, 80, + 40, 39, 42, 80, 42, 43, 42, 626, 43, 80, + 80, 42, 43, 620, 619, 43, 618, 43, 617, 43, + 41, 614, 612, 43, 43, 44, 611, 609, 43, 607, + 606, 44, 44, 605, 597, 45, 535, 535, 535, 596, + 595, 593, 44, 590, 44, 45, 44, 45, 44, 45, + 588, 44, 587, 45, 45, 44, 585, 46, 47, 582, + 581, 580, 568, 567, 44, 47, 566, 46, 47, 46, + + 47, 46, 47, 565, 535, 45, 46, 47, 48, 48, + 48, 48, 48, 48, 48, 563, 559, 557, 556, 48, + 600, 600, 600, 46, 83, 83, 83, 83, 83, 83, + 83, 554, 550, 549, 48, 548, 533, 88, 89, 48, + 86, 86, 86, 86, 86, 86, 86, 88, 89, 88, + 89, 88, 89, 90, 91, 89, 88, 89, 600, 642, + 642, 642, 532, 90, 91, 90, 91, 90, 91, 92, + 531, 530, 90, 91, 528, 93, 526, 91, 523, 92, + 521, 92, 519, 92, 517, 93, 95, 93, 92, 93, + 511, 95, 96, 93, 93, 510, 95, 642, 95, 509, + + 95, 508, 96, 97, 96, 95, 96, 497, 490, 489, + 96, 96, 488, 97, 98, 97, 487, 97, 484, 482, + 99, 479, 97, 474, 98, 472, 98, 98, 98, 461, + 99, 460, 99, 98, 99, 100, 100, 443, 436, 99, + 435, 101, 101, 434, 433, 432, 100, 429, 100, 100, + 100, 427, 101, 102, 101, 100, 101, 422, 417, 414, + 403, 101, 402, 102, 102, 102, 103, 102, 401, 104, + 103, 383, 102, 374, 373, 372, 103, 370, 103, 104, + 103, 104, 366, 104, 364, 103, 106, 106, 104, 105, + 105, 105, 359, 354, 350, 340, 106, 107, 106, 105, + + 106, 105, 339, 105, 106, 106, 338, 107, 105, 107, + 108, 107, 319, 111, 308, 307, 107, 306, 300, 289, + 108, 111, 108, 108, 108, 284, 280, 112, 269, 108, + 112, 111, 268, 111, 241, 111, 237, 112, 113, 112, + 111, 112, 233, 232, 114, 114, 112, 231, 113, 227, + 113, 215, 113, 209, 114, 115, 114, 113, 114, 205, + 194, 114, 114, 114, 193, 115, 116, 115, 115, 115, + 165, 161, 117, 157, 115, 147, 116, 142, 116, 139, + 116, 129, 117, 118, 117, 116, 117, 124, 116, 119, + 110, 117, 109, 118, 87, 118, 120, 118, 84, 121, + + 81, 76, 118, 75, 120, 72, 120, 63, 120, 121, + 120, 121, 122, 121, 60, 120, 57, 121, 121, 56, + 123, 53, 122, 125, 122, 27, 122, 23, 18, 17, + 123, 122, 123, 125, 123, 125, 126, 125, 123, 123, + 14, 125, 125, 13, 0, 0, 126, 127, 126, 0, + 126, 0, 0, 0, 0, 126, 126, 127, 0, 127, + 128, 127, 0, 128, 0, 0, 127, 128, 0, 0, + 128, 0, 128, 0, 128, 130, 130, 0, 0, 128, + 0, 0, 131, 0, 0, 0, 130, 0, 130, 0, + 130, 0, 131, 132, 131, 130, 131, 131, 0, 133, + + 131, 131, 0, 132, 0, 132, 0, 132, 0, 133, + 134, 133, 132, 133, 135, 133, 0, 132, 133, 0, + 134, 0, 134, 0, 134, 135, 136, 0, 0, 134, + 0, 136, 0, 0, 0, 135, 136, 135, 136, 135, + 136, 137, 138, 0, 135, 136, 0, 0, 0, 0, + 0, 137, 138, 137, 138, 137, 138, 140, 141, 141, + 137, 138, 141, 0, 140, 0, 0, 140, 141, 140, + 141, 140, 141, 144, 0, 0, 140, 141, 0, 0, + 0, 0, 0, 144, 0, 144, 0, 144, 146, 146, + 146, 144, 144, 145, 145, 145, 145, 145, 145, 145, + + 146, 146, 146, 146, 146, 146, 146, 166, 166, 166, + 166, 166, 166, 166, 0, 169, 0, 0, 169, 0, + 0, 0, 0, 0, 0, 169, 146, 169, 170, 169, + 0, 145, 0, 169, 169, 0, 171, 0, 170, 172, + 170, 0, 170, 0, 0, 0, 171, 170, 171, 172, + 171, 172, 173, 172, 0, 171, 0, 0, 172, 0, + 174, 0, 173, 175, 173, 173, 173, 174, 0, 0, + 174, 173, 174, 175, 174, 175, 176, 175, 0, 174, + 0, 0, 175, 0, 177, 0, 176, 0, 176, 0, + 176, 0, 178, 176, 177, 176, 177, 0, 177, 0, + + 179, 0, 178, 177, 178, 0, 178, 179, 178, 0, + 179, 178, 179, 180, 179, 0, 0, 0, 0, 179, + 0, 181, 0, 180, 182, 180, 0, 180, 0, 0, + 180, 181, 180, 181, 182, 181, 182, 0, 182, 0, + 181, 182, 182, 182, 183, 183, 184, 0, 0, 184, + 0, 0, 183, 0, 0, 183, 184, 183, 184, 183, + 184, 185, 0, 0, 183, 184, 0, 186, 0, 0, + 0, 185, 0, 185, 185, 185, 0, 186, 187, 186, + 185, 186, 0, 0, 188, 0, 186, 188, 187, 187, + 187, 0, 187, 0, 188, 189, 188, 187, 188, 0, + + 0, 190, 0, 188, 190, 189, 0, 189, 189, 189, + 0, 190, 191, 190, 189, 190, 0, 0, 0, 0, + 190, 0, 191, 192, 191, 0, 191, 0, 0, 191, + 0, 191, 0, 192, 192, 192, 195, 192, 0, 0, + 0, 0, 192, 0, 196, 0, 195, 197, 195, 0, + 195, 0, 0, 195, 196, 195, 196, 197, 196, 197, + 197, 197, 198, 196, 0, 199, 197, 0, 200, 0, + 0, 200, 198, 0, 198, 199, 198, 199, 200, 199, + 200, 198, 200, 199, 199, 201, 202, 200, 0, 203, + 0, 0, 201, 0, 0, 0, 202, 0, 202, 203, + + 202, 203, 201, 203, 201, 202, 201, 204, 203, 0, + 206, 201, 0, 206, 0, 0, 0, 204, 0, 204, + 206, 204, 206, 0, 206, 207, 204, 0, 207, 206, + 0, 208, 0, 0, 0, 207, 0, 207, 208, 207, + 0, 208, 210, 208, 207, 208, 0, 0, 0, 0, + 208, 0, 210, 211, 210, 0, 210, 0, 0, 212, + 210, 210, 0, 211, 0, 211, 0, 211, 0, 212, + 213, 212, 211, 212, 0, 0, 212, 0, 212, 0, + 213, 214, 213, 0, 213, 0, 0, 213, 0, 213, + 0, 214, 216, 214, 0, 214, 0, 217, 217, 0, + + 214, 214, 216, 0, 216, 0, 216, 0, 217, 218, + 217, 216, 217, 0, 0, 219, 0, 217, 0, 218, + 0, 218, 0, 218, 0, 219, 0, 219, 218, 219, + 220, 221, 0, 220, 219, 0, 0, 0, 221, 0, + 220, 221, 220, 221, 220, 221, 222, 0, 0, 220, + 221, 0, 0, 0, 0, 0, 222, 223, 222, 0, + 222, 0, 0, 224, 222, 222, 0, 223, 0, 223, + 0, 223, 0, 224, 223, 224, 223, 224, 225, 0, + 224, 225, 224, 0, 226, 0, 0, 226, 225, 0, + 225, 0, 225, 0, 226, 228, 226, 225, 226, 0, + + 0, 0, 0, 226, 0, 228, 229, 228, 228, 228, + 228, 230, 0, 0, 228, 228, 229, 230, 229, 0, + 229, 0, 0, 0, 229, 229, 0, 230, 234, 230, + 0, 230, 0, 0, 234, 0, 230, 0, 234, 0, + 234, 0, 234, 236, 236, 236, 0, 234, 0, 0, + 0, 0, 244, 245, 0, 236, 236, 236, 236, 236, + 236, 236, 244, 245, 244, 245, 244, 245, 246, 245, + 0, 244, 245, 0, 247, 246, 0, 0, 246, 0, + 246, 0, 246, 0, 247, 247, 247, 246, 247, 248, + 249, 0, 0, 247, 0, 0, 0, 0, 0, 248, + + 249, 248, 249, 248, 249, 251, 251, 250, 248, 249, + 250, 0, 0, 0, 0, 0, 251, 250, 251, 250, + 251, 250, 252, 252, 0, 251, 250, 0, 253, 0, + 0, 0, 252, 0, 252, 249, 252, 0, 253, 254, + 253, 252, 253, 0, 0, 253, 0, 253, 0, 254, + 255, 254, 254, 254, 0, 0, 0, 0, 254, 0, + 255, 0, 255, 0, 255, 257, 255, 256, 256, 255, + 0, 258, 0, 0, 0, 257, 0, 257, 256, 257, + 256, 258, 256, 258, 257, 258, 259, 256, 259, 260, + 258, 260, 261, 0, 0, 261, 259, 0, 259, 260, + + 259, 260, 261, 260, 261, 259, 261, 262, 260, 0, + 0, 261, 0, 263, 0, 0, 0, 262, 0, 262, + 263, 262, 0, 263, 264, 263, 262, 263, 0, 0, + 0, 0, 263, 0, 264, 265, 264, 0, 264, 0, + 264, 0, 0, 264, 0, 265, 0, 265, 0, 265, + 266, 265, 0, 266, 265, 0, 267, 0, 0, 0, + 266, 0, 266, 0, 266, 0, 267, 270, 267, 266, + 267, 0, 0, 271, 0, 267, 0, 270, 0, 270, + 0, 270, 0, 271, 0, 271, 270, 271, 272, 273, + 0, 271, 271, 0, 0, 272, 0, 0, 272, 273, + + 272, 273, 272, 273, 274, 273, 0, 272, 273, 275, + 275, 0, 270, 0, 274, 0, 274, 0, 274, 0, + 275, 276, 275, 274, 275, 277, 276, 0, 0, 275, + 0, 276, 0, 276, 277, 276, 0, 276, 0, 0, + 276, 0, 278, 0, 277, 0, 277, 0, 277, 0, + 279, 0, 278, 277, 278, 0, 278, 0, 0, 278, + 279, 278, 279, 0, 279, 281, 281, 0, 282, 279, + 0, 0, 0, 0, 0, 281, 0, 281, 282, 281, + 282, 283, 282, 0, 281, 0, 282, 282, 0, 285, + 286, 283, 285, 283, 283, 283, 0, 0, 0, 285, + + 283, 285, 0, 285, 287, 286, 0, 287, 285, 0, + 0, 0, 0, 0, 287, 286, 287, 286, 287, 286, + 288, 288, 290, 287, 286, 0, 0, 0, 0, 0, + 0, 288, 290, 288, 290, 288, 290, 291, 0, 0, + 288, 290, 0, 0, 0, 0, 0, 291, 0, 291, + 292, 291, 0, 292, 0, 291, 291, 0, 293, 0, + 292, 294, 292, 0, 292, 0, 0, 0, 293, 292, + 293, 294, 293, 294, 0, 294, 296, 293, 295, 295, + 294, 0, 297, 0, 0, 299, 296, 0, 296, 295, + 296, 295, 297, 295, 297, 296, 297, 298, 295, 0, + + 299, 297, 0, 301, 0, 0, 0, 298, 0, 298, + 299, 298, 299, 301, 299, 301, 298, 301, 302, 299, + 0, 296, 301, 0, 303, 0, 0, 303, 302, 0, + 302, 0, 302, 0, 303, 304, 303, 302, 303, 0, + 0, 305, 0, 303, 0, 304, 0, 304, 0, 304, + 0, 305, 0, 305, 304, 305, 309, 0, 305, 0, + 305, 0, 0, 0, 0, 0, 309, 0, 309, 0, + 309, 304, 0, 314, 0, 309, 310, 310, 310, 310, + 310, 310, 310, 314, 0, 314, 0, 314, 315, 315, + 0, 314, 314, 0, 0, 0, 0, 316, 316, 315, + + 0, 315, 0, 315, 317, 317, 0, 316, 315, 316, + 0, 316, 0, 318, 310, 317, 316, 317, 0, 317, + 320, 320, 0, 318, 317, 318, 0, 318, 0, 321, + 321, 320, 318, 320, 0, 320, 0, 0, 0, 321, + 320, 321, 322, 321, 0, 322, 0, 0, 321, 0, + 323, 0, 322, 324, 322, 0, 322, 0, 0, 0, + 323, 322, 323, 324, 323, 324, 0, 324, 326, 323, + 325, 325, 324, 0, 327, 326, 0, 0, 326, 0, + 326, 325, 326, 325, 327, 325, 327, 326, 327, 328, + 325, 0, 328, 327, 0, 329, 328, 329, 0, 328, + + 0, 328, 0, 328, 0, 329, 0, 329, 328, 329, + 330, 331, 0, 330, 329, 0, 0, 0, 0, 0, + 330, 331, 330, 331, 330, 331, 332, 331, 0, 330, + 331, 0, 0, 0, 0, 0, 332, 0, 332, 0, + 332, 333, 333, 0, 332, 332, 0, 334, 0, 0, + 0, 333, 0, 333, 0, 333, 0, 334, 335, 334, + 333, 334, 0, 0, 336, 334, 334, 0, 335, 0, + 335, 0, 335, 0, 336, 335, 336, 335, 336, 337, + 341, 0, 0, 336, 0, 0, 0, 341, 0, 337, + 341, 337, 341, 337, 341, 0, 0, 343, 337, 341, + + 342, 342, 0, 342, 0, 0, 0, 343, 0, 343, + 342, 343, 342, 0, 342, 343, 343, 345, 344, 342, + 344, 0, 0, 0, 0, 0, 0, 345, 344, 345, + 344, 345, 344, 0, 347, 346, 345, 344, 346, 0, + 0, 349, 0, 348, 347, 346, 347, 346, 347, 346, + 348, 347, 0, 347, 346, 0, 349, 0, 0, 0, + 348, 0, 348, 0, 348, 0, 349, 351, 349, 348, + 349, 0, 0, 0, 0, 349, 0, 351, 352, 351, + 0, 351, 0, 0, 353, 351, 351, 0, 352, 0, + 352, 0, 352, 0, 353, 355, 353, 352, 353, 0, + + 0, 0, 0, 353, 0, 355, 356, 355, 0, 355, + 0, 355, 357, 356, 355, 0, 356, 0, 356, 0, + 356, 0, 357, 358, 357, 356, 357, 0, 0, 0, + 0, 357, 0, 358, 0, 358, 360, 358, 0, 361, + 0, 358, 358, 360, 0, 0, 360, 362, 360, 361, + 360, 361, 362, 361, 0, 360, 0, 362, 361, 362, + 363, 362, 0, 0, 0, 0, 362, 0, 0, 0, + 363, 365, 363, 0, 363, 0, 0, 367, 365, 363, + 0, 365, 363, 365, 0, 365, 0, 367, 0, 367, + 365, 367, 368, 369, 0, 368, 367, 0, 0, 0, + + 0, 0, 368, 369, 368, 369, 368, 369, 371, 369, + 0, 368, 369, 0, 379, 0, 0, 0, 371, 0, + 371, 0, 371, 0, 379, 0, 379, 371, 379, 380, + 380, 381, 381, 379, 0, 0, 0, 0, 0, 380, + 382, 380, 381, 380, 381, 0, 381, 0, 380, 0, + 382, 381, 382, 371, 382, 384, 0, 0, 382, 382, + 0, 385, 0, 0, 0, 384, 0, 384, 0, 384, + 0, 385, 386, 385, 384, 385, 0, 0, 387, 385, + 385, 387, 386, 0, 386, 0, 386, 0, 387, 388, + 387, 386, 387, 0, 0, 389, 388, 387, 0, 388, + + 0, 388, 0, 388, 0, 389, 390, 389, 388, 389, + 0, 0, 0, 0, 389, 0, 390, 391, 390, 391, + 390, 0, 0, 392, 390, 390, 0, 391, 0, 391, + 0, 391, 0, 392, 0, 392, 391, 392, 0, 0, + 393, 392, 392, 393, 0, 0, 394, 0, 394, 0, + 393, 0, 393, 0, 393, 0, 394, 0, 394, 393, + 394, 395, 395, 396, 0, 394, 0, 0, 0, 0, + 0, 0, 395, 396, 395, 396, 395, 396, 397, 398, + 0, 395, 396, 0, 0, 397, 0, 0, 397, 398, + 397, 398, 397, 398, 399, 0, 398, 397, 398, 400, + + 400, 399, 0, 0, 399, 0, 399, 0, 399, 0, + 400, 404, 400, 399, 400, 404, 0, 405, 0, 400, + 0, 404, 0, 404, 405, 404, 0, 405, 0, 405, + 404, 405, 406, 407, 406, 0, 405, 0, 0, 0, + 0, 0, 406, 407, 406, 407, 406, 407, 0, 0, + 407, 406, 407, 408, 409, 409, 408, 0, 0, 0, + 0, 0, 0, 408, 409, 408, 409, 408, 409, 410, + 0, 0, 408, 409, 0, 0, 0, 411, 0, 410, + 411, 410, 0, 410, 0, 410, 0, 411, 410, 411, + 412, 411, 0, 0, 0, 0, 411, 0, 413, 0, + + 412, 415, 412, 0, 412, 413, 0, 412, 413, 412, + 413, 415, 413, 415, 0, 415, 418, 413, 416, 416, + 415, 0, 419, 0, 0, 0, 418, 0, 418, 416, + 418, 416, 419, 416, 419, 418, 419, 420, 416, 0, + 421, 419, 0, 421, 0, 0, 0, 420, 423, 420, + 421, 420, 421, 0, 421, 420, 420, 0, 423, 421, + 423, 0, 423, 424, 424, 0, 425, 423, 423, 426, + 0, 0, 0, 424, 0, 424, 425, 424, 425, 426, + 425, 426, 424, 426, 428, 425, 428, 430, 426, 0, + 431, 0, 0, 0, 428, 0, 428, 430, 428, 430, + + 431, 430, 431, 428, 431, 440, 430, 431, 441, 431, + 0, 0, 0, 0, 0, 440, 0, 440, 441, 440, + 441, 442, 441, 440, 440, 0, 441, 441, 442, 444, + 0, 442, 0, 442, 0, 442, 0, 0, 0, 444, + 442, 444, 445, 444, 0, 445, 0, 0, 444, 0, + 446, 0, 445, 447, 445, 0, 445, 0, 0, 0, + 446, 445, 446, 447, 446, 447, 448, 447, 0, 446, + 0, 0, 447, 448, 449, 0, 448, 450, 448, 0, + 448, 0, 0, 0, 449, 448, 449, 450, 449, 450, + 451, 450, 0, 449, 0, 0, 450, 451, 453, 0, + + 451, 452, 451, 452, 451, 0, 0, 0, 453, 451, + 453, 452, 453, 452, 454, 452, 0, 453, 0, 0, + 452, 0, 0, 0, 454, 455, 454, 0, 454, 0, + 0, 0, 454, 454, 0, 455, 456, 455, 0, 455, + 0, 0, 457, 455, 455, 0, 456, 0, 456, 0, + 456, 0, 457, 458, 457, 456, 457, 0, 0, 462, + 0, 457, 0, 458, 0, 458, 462, 458, 0, 462, + 463, 462, 458, 462, 0, 0, 0, 0, 462, 0, + 463, 464, 463, 0, 463, 0, 0, 465, 463, 463, + 0, 464, 0, 464, 0, 464, 0, 465, 466, 465, + + 464, 465, 0, 0, 467, 0, 465, 467, 466, 0, + 466, 0, 466, 0, 467, 466, 467, 466, 467, 468, + 469, 469, 0, 467, 0, 0, 0, 0, 0, 468, + 469, 468, 469, 468, 469, 470, 471, 0, 468, 469, + 0, 0, 0, 0, 0, 470, 471, 470, 471, 470, + 471, 473, 475, 0, 470, 471, 0, 0, 0, 0, + 0, 473, 475, 473, 475, 473, 475, 0, 0, 476, + 473, 475, 477, 476, 0, 478, 0, 0, 0, 476, + 470, 476, 477, 476, 477, 478, 477, 478, 476, 478, + 480, 477, 0, 480, 478, 0, 481, 0, 0, 481, + + 480, 0, 480, 0, 480, 0, 481, 0, 481, 480, + 481, 483, 0, 494, 483, 481, 485, 485, 0, 0, + 0, 483, 0, 483, 0, 483, 0, 485, 494, 485, + 483, 485, 0, 0, 495, 0, 485, 0, 494, 0, + 494, 495, 494, 0, 495, 0, 495, 494, 495, 496, + 496, 0, 0, 495, 0, 498, 0, 0, 0, 496, + 0, 496, 0, 496, 0, 498, 499, 498, 496, 498, + 0, 498, 0, 0, 498, 0, 499, 0, 499, 500, + 499, 0, 500, 0, 499, 499, 0, 501, 0, 500, + 502, 500, 0, 500, 0, 0, 0, 501, 500, 501, + + 502, 501, 502, 502, 502, 503, 501, 0, 504, 502, + 0, 504, 0, 0, 0, 503, 505, 503, 504, 503, + 504, 0, 504, 0, 503, 0, 505, 504, 505, 506, + 505, 0, 507, 0, 0, 505, 506, 0, 0, 506, + 0, 506, 507, 506, 507, 0, 507, 512, 506, 0, + 512, 507, 0, 513, 0, 0, 0, 512, 0, 512, + 0, 512, 0, 513, 514, 513, 512, 513, 0, 0, + 515, 0, 513, 0, 514, 0, 514, 0, 514, 0, + 515, 516, 515, 514, 515, 0, 0, 0, 0, 515, + 0, 516, 518, 516, 0, 516, 518, 0, 520, 516, + + 516, 0, 518, 0, 518, 524, 518, 0, 520, 522, + 520, 518, 520, 0, 0, 0, 522, 520, 0, 522, + 524, 522, 0, 522, 0, 0, 525, 0, 522, 0, + 524, 0, 524, 0, 524, 0, 525, 527, 525, 524, + 525, 0, 0, 529, 0, 525, 0, 527, 0, 527, + 0, 527, 0, 529, 537, 529, 527, 529, 0, 0, + 0, 0, 529, 0, 537, 538, 537, 0, 537, 0, + 0, 537, 0, 537, 0, 538, 539, 538, 538, 538, + 0, 0, 541, 0, 538, 0, 539, 0, 539, 0, + 539, 0, 541, 542, 541, 539, 541, 0, 0, 0, + + 0, 541, 0, 542, 543, 542, 543, 542, 0, 0, + 542, 0, 542, 0, 543, 544, 543, 0, 543, 0, + 544, 545, 0, 543, 0, 544, 0, 544, 0, 544, + 0, 545, 0, 545, 544, 545, 546, 547, 546, 0, + 545, 0, 0, 0, 0, 0, 546, 547, 546, 547, + 546, 547, 552, 553, 0, 546, 547, 0, 0, 0, + 553, 0, 552, 553, 552, 553, 552, 553, 552, 555, + 558, 552, 553, 0, 0, 0, 555, 0, 0, 555, + 558, 555, 558, 555, 558, 560, 0, 0, 555, 558, + 0, 562, 0, 0, 0, 560, 0, 560, 560, 560, + + 0, 562, 564, 562, 560, 562, 0, 0, 0, 562, + 562, 0, 564, 0, 564, 0, 564, 570, 570, 570, + 0, 564, 0, 0, 0, 0, 572, 573, 0, 570, + 570, 570, 570, 570, 570, 570, 572, 573, 572, 573, + 572, 573, 574, 575, 0, 572, 573, 0, 0, 572, + 0, 0, 574, 575, 574, 575, 574, 575, 576, 577, + 0, 574, 575, 0, 0, 0, 0, 0, 576, 577, + 576, 577, 576, 577, 578, 579, 577, 576, 577, 0, + 0, 0, 579, 0, 578, 579, 578, 579, 578, 579, + 583, 0, 0, 578, 579, 0, 0, 0, 584, 0, + + 583, 0, 583, 0, 583, 0, 586, 0, 584, 583, + 584, 584, 584, 0, 589, 0, 586, 584, 586, 0, + 586, 589, 591, 0, 589, 586, 589, 0, 589, 591, + 592, 0, 591, 589, 591, 0, 591, 592, 0, 0, + 592, 591, 592, 0, 592, 0, 0, 601, 602, 592, + 599, 599, 599, 599, 599, 599, 599, 601, 602, 601, + 602, 601, 602, 603, 0, 0, 601, 602, 0, 0, + 0, 604, 0, 603, 0, 603, 0, 603, 0, 0, + 0, 604, 603, 604, 608, 604, 0, 0, 599, 604, + 604, 0, 610, 0, 608, 613, 608, 0, 608, 610, + + 0, 0, 610, 608, 610, 613, 610, 613, 615, 613, + 615, 610, 0, 613, 613, 0, 0, 0, 615, 616, + 615, 0, 615, 616, 0, 0, 0, 615, 0, 616, + 0, 616, 0, 616, 623, 623, 623, 0, 616, 0, + 0, 0, 0, 624, 625, 0, 623, 623, 623, 623, + 623, 623, 623, 624, 625, 624, 625, 624, 625, 629, + 0, 624, 624, 625, 0, 631, 0, 625, 0, 629, + 0, 629, 0, 629, 0, 631, 634, 631, 629, 631, + 0, 0, 636, 631, 631, 0, 634, 0, 634, 0, + 634, 0, 636, 637, 636, 634, 636, 0, 0, 634, + + 637, 636, 0, 637, 0, 637, 644, 637, 643, 643, + 0, 0, 637, 0, 0, 0, 644, 648, 644, 643, + 644, 643, 0, 643, 0, 644, 0, 648, 643, 648, + 0, 648, 651, 0, 0, 653, 648, 0, 653, 0, + 648, 0, 651, 0, 651, 653, 651, 653, 0, 653, + 0, 651, 0, 0, 653, 658, 658, 658, 0, 0, + 0, 0, 0, 0, 659, 661, 0, 658, 658, 658, + 658, 658, 658, 658, 659, 661, 659, 661, 659, 661, + 664, 667, 0, 659, 661, 0, 659, 0, 0, 0, + 664, 667, 664, 667, 664, 667, 664, 671, 0, 664, + + 667, 0, 0, 0, 0, 0, 0, 671, 0, 671, + 0, 671, 0, 0, 0, 0, 671, 675, 675, 675, + 675, 675, 675, 675, 675, 675, 675, 675, 675, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 677, 677, 677, 677, 677, 677, 677, 677, 677, + 677, 677, 677, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 679, 679, 679, 679, 679, + 679, 679, 679, 679, 679, 679, 679, 680, 680, 680, + 0, 680, 680, 680, 680, 680, 680, 680, 680, 681, + 681, 0, 0, 681, 0, 681, 682, 0, 682, 683, + + 683, 0, 683, 683, 684, 684, 0, 684, 684, 684, + 0, 684, 684, 684, 684, 684, 685, 685, 685, 0, + 685, 685, 685, 685, 685, 685, 685, 685, 686, 686, + 686, 686, 686, 686, 686, 686, 0, 686, 686, 687, + 0, 0, 687, 0, 687, 687, 687, 687, 687, 687, + 688, 688, 0, 688, 688, 689, 689, 0, 689, 689, + 690, 690, 0, 690, 690, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674 + } ; + +extern int yy_flex_debug; +int yy_flex_debug = 1; + +static yyconst short int yy_rule_linenum[123] = + { 0, + 101, 104, 106, 107, 108, 111, 113, 114, 115, 127, + 134, 141, 147, 156, 164, 172, 173, 175, 194, 200, + 207, 214, 221, 231, 265, 272, 273, 274, 275, 283, + 284, 285, 286, 287, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + + 366, 367, 372, 373, 378, 379, 380, 383, 389, 396, + 405, 416, 422, 424, 425, 427, 429, 431, 444, 450, + 456, 464 + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +++yy_lp; \ +goto find_rule; \ +} +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "asn1p_l.l" +#define INITIAL 0 +#line 2 "asn1p_l.l" + +#include +#include +#include + +#include "asn1parser.h" +#include "asn1p_y.h" + +int asn1p_lex(void); +void asn1p_lexer_hack_push_opaque_state(void); /* Used in .y */ +void asn1p_lexer_hack_enable_with_syntax(void); /* Used in .y */ + +#define YY_FATAL_ERROR(msg) do { \ + fprintf(stderr, \ + "lexer error at line %d, " \ + "text \"%s\"\n", \ + yylineno, yytext); \ + exit(1); \ + } while(0) + +int asn1p_lexer_pedantic_1990 = 0; +int asn1p_lexer_types_year = 0; +int asn1p_lexer_constructs_year = 0; +static int _check_dashes(char *ptr); +static asn1_integer_t asn1p_atoi(char *ptr); /* errno is either 0 or ERANGE */ + +/* + * Check that the type is defined in the year of the standard choosen. + */ +#define TYPE_LIFETIME(fyr, lyr) \ + (!asn1p_lexer_types_year \ + || (fyr && fyr <= asn1p_lexer_types_year) \ + || (lyr && lyr > asn1p_lexer_types_year)) + +/* + * Check the the construction (or concept, i.e. CLASS) is defined in + * a given year. + */ +#define CONSTRUCT_LIFETIME(fyr, lyr) \ + (!asn1p_lexer_constructs_year \ + || (fyr && fyr <= asn1p_lexer_constructs_year) \ + || (lyr && lyr > asn1p_lexer_constructs_year)) + +/* + * Make sure that the label is compliant with the naming rules. + */ +#define CHECK_DASHES do { \ + if(_check_dashes(yytext)) { \ + fprintf(stderr, \ + "%s: Identifier format invalid: " \ + "Improper dash location\n", yytext); \ + return -1; \ + } } while(0) + +/* + * Append quoted string. + */ +#define QAPPEND(text, tlen) do { \ + char *prev_text = asn1p_lval.tv_opaque.buf; \ + int prev_len = asn1p_lval.tv_opaque.len; \ + char *p; \ + \ + p = malloc((tlen) + prev_len + 1); \ + if(p == NULL) return -1; \ + \ + if(prev_text) memcpy(p, prev_text, prev_len); \ + memcpy(p + prev_len, text, tlen); \ + p[prev_len + (tlen)] = '\0'; \ + \ + free(asn1p_lval.tv_opaque.buf); \ + asn1p_lval.tv_opaque.buf = p; \ + asn1p_lval.tv_opaque.len = (tlen) + prev_len; \ + } while(0) + +#define YY_NEVER_INTERACTIVE 1 +#define YY_NO_INPUT 1 +#define YY_NO_UNPUT 1 +#define YY_STACK_USED 1 +/* Performance penalty is OK */ +/* Controlled from within application */ +#define dash_comment 1 + +#define cpp_comment 2 + +#define quoted 3 + +#define opaque 4 + +#define with_syntax 5 + +/* Newline */ +/* White-space */ +#line 1806 "lex.yy.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 99 "asn1p_l.l" + + +#line 1960 "lex.yy.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 675 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 4166 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + { + yy_full_match = yy_cp; + break; + } + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER ) + { + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + ++yylineno; + } + +do_action: /* This label is used only to access EOF actions. */ + + if ( yy_flex_debug ) + { + if ( yy_act == 0 ) + fprintf( stderr, "--scanner backing up\n" ); + else if ( yy_act < 123 ) + fprintf( stderr, "--accepting rule at line %d (\"%s\")\n", + yy_rule_linenum[yy_act], yytext ); + else if ( yy_act == 123 ) + fprintf( stderr, "--accepting default rule (\"%s\")\n", + yytext ); + else if ( yy_act == 124 ) + fprintf( stderr, "--(end of buffer or a NUL)\n" ); + else + fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); + } + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 101 "asn1p_l.l" +yy_push_state(dash_comment); + YY_BREAK + +case 2: +YY_RULE_SETUP +#line 104 "asn1p_l.l" +yy_pop_state(); + YY_BREAK +case 3: +YY_RULE_SETUP +#line 106 "asn1p_l.l" +yy_pop_state(); /* End of comment */ + YY_BREAK +case 4: +YY_RULE_SETUP +#line 107 "asn1p_l.l" +/* Eat single dash */ + YY_BREAK +case 5: +YY_RULE_SETUP +#line 108 "asn1p_l.l" +/* Eat */ + YY_BREAK + +case 6: +YY_RULE_SETUP +#line 111 "asn1p_l.l" +yy_push_state(cpp_comment); + YY_BREAK + +case 7: +YY_RULE_SETUP +#line 113 "asn1p_l.l" +/* Eat */ + YY_BREAK +case 8: +YY_RULE_SETUP +#line 114 "asn1p_l.l" +yy_pop_state(); + YY_BREAK +case 9: +YY_RULE_SETUP +#line 115 "asn1p_l.l" +/* Eat */ + YY_BREAK + +/* + * This is state is being set from corresponding .y module when + * higher-level data is necessary to make proper parsing of the + * underlying data. Thus, we enter the state and save + * everything for later processing. + */ + +case 10: +YY_RULE_SETUP +#line 127 "asn1p_l.l" +{ + yy_push_state(opaque); + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 134 "asn1p_l.l" +{ + yy_pop_state(); + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 141 "asn1p_l.l" +{ + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 147 "asn1p_l.l" +{ + fprintf(stderr, + "ASN.1 Parser syncronization failure: " + "\"%s\" at line %d must not appear " + "inside value definition\n", + yytext, yylineno); + return -1; + } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 156 "asn1p_l.l" +{ + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + YY_BREAK + +case 15: +YY_RULE_SETUP +#line 164 "asn1p_l.l" +{ + asn1p_lval.tv_opaque.buf = 0; + asn1p_lval.tv_opaque.len = 0; + QAPPEND(yytext+1, yyleng-1); + yy_push_state(quoted); + } + YY_BREAK + +case 16: +YY_RULE_SETUP +#line 172 "asn1p_l.l" +{ QAPPEND(yytext, yyleng-1); } /* Add a single quote */ + YY_BREAK +case 17: +YY_RULE_SETUP +#line 173 "asn1p_l.l" +{ QAPPEND(yytext, yyleng); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 175 "asn1p_l.l" +{ + yy_pop_state(); + /* Do not append last quote: + // QAPPEND(yytext, yyleng); */ + + if(asn1p_lexer_pedantic_1990 + && strchr(yytext, '\n')) { + fprintf(stderr, "%s: " + "Newlines are prohibited by ASN.1:1990\n", + asn1p_lval.tv_opaque.buf); + return -1; + } + + return TOK_cstring; + } + YY_BREAK + +case 19: +YY_RULE_SETUP +#line 194 "asn1p_l.l" +{ + /* " \t\r\n" weren't allowed in ASN.1:1990. */ + asn1p_lval.tv_str = yytext; + return TOK_hstring; + } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 200 "asn1p_l.l" +{ + /* " \t\r\n" weren't allowed in ASN.1:1990. */ + asn1p_lval.tv_str = strdup(yytext); + return TOK_bstring; + } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 207 "asn1p_l.l" +{ + asn1p_lval.a_int = asn1p_atoi(yytext); + if(errno == ERANGE) + return -1; + return TOK_number_negative; + } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 214 "asn1p_l.l" +{ + asn1p_lval.a_int = asn1p_atoi(yytext); + if(errno == ERANGE) + return -1; + return TOK_number; + } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 221 "asn1p_l.l" +{ + asn1p_lval.a_int = asn1p_atoi(yytext); + if(errno == ERANGE) + return -1; + return TOK_number; + } + YY_BREAK +/* + * Tags + */ +case 24: +YY_RULE_SETUP +#line 231 "asn1p_l.l" +{ + char *p; + memset(&asn1p_lval.a_tag, 0, sizeof(asn1p_lval.a_tag)); + switch(yytext[1]) { + case 'U': + asn1p_lval.a_tag.tag_class = TC_UNIVERSAL; + p = yytext + sizeof("UNIVERSAL") + 1; + break; + case 'A': + asn1p_lval.a_tag.tag_class = TC_APPLICATION; + p = yytext + sizeof("APPLICATION") + 1; + break; + case 'P': + asn1p_lval.a_tag.tag_class = TC_PRIVATE; + p = yytext + sizeof("PRIVATE") + 1; + break; + default: + assert(yytext[1] >= '0' && yytext[1] <= '9'); + asn1p_lval.a_tag.tag_class = TC_CONTEXT_SPECIFIC; + p = yytext + 1; + break; + } + asn1p_lval.a_tag.tag_value = asn1p_atoi(p); + if(*p == '0' && asn1p_lval.a_tag.tag_value) { + fprintf(stderr, + "Tag value at line %d " + "cannot start with zero " + "and have multiple digits: \"%s\"\n", + yylineno, yytext); + return -1; + } + return TOK_tag; + } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 265 "asn1p_l.l" +{ + fprintf(stderr, + "Unsupported tag syntax at line %d: \"%s\"\n", + yylineno, yytext); + return -1; + } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 272 "asn1p_l.l" +return TOK_ABSENT; + YY_BREAK +case 27: +YY_RULE_SETUP +#line 273 "asn1p_l.l" +return TOK_ABSTRACT_SYNTAX; + YY_BREAK +case 28: +YY_RULE_SETUP +#line 274 "asn1p_l.l" +return TOK_ALL; + YY_BREAK +case 29: +YY_RULE_SETUP +#line 275 "asn1p_l.l" +{ + /* Appeared in 1990, removed in 1997 */ + if(TYPE_LIFETIME(1990, 1997)) + return TOK_ANY; + fprintf(stderr, "Keyword \"%s\" at line %d " + "is obsolete\n", yytext, yylineno); + REJECT; + } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 283 "asn1p_l.l" +return TOK_APPLICATION; + YY_BREAK +case 31: +YY_RULE_SETUP +#line 284 "asn1p_l.l" +return TOK_AUTOMATIC; + YY_BREAK +case 32: +YY_RULE_SETUP +#line 285 "asn1p_l.l" +return TOK_BEGIN; + YY_BREAK +case 33: +YY_RULE_SETUP +#line 286 "asn1p_l.l" +return TOK_BIT; + YY_BREAK +case 34: +YY_RULE_SETUP +#line 287 "asn1p_l.l" +{ + if(TYPE_LIFETIME(1994, 0)) + return TOK_BMPString; + REJECT; + } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 292 "asn1p_l.l" +return TOK_BOOLEAN; + YY_BREAK +case 36: +YY_RULE_SETUP +#line 293 "asn1p_l.l" +return TOK_BY; + YY_BREAK +case 37: +YY_RULE_SETUP +#line 294 "asn1p_l.l" +return TOK_CHARACTER; + YY_BREAK +case 38: +YY_RULE_SETUP +#line 295 "asn1p_l.l" +return TOK_CHOICE; + YY_BREAK +case 39: +YY_RULE_SETUP +#line 296 "asn1p_l.l" +return TOK_CLASS; + YY_BREAK +case 40: +YY_RULE_SETUP +#line 297 "asn1p_l.l" +return TOK_COMPONENT; + YY_BREAK +case 41: +YY_RULE_SETUP +#line 298 "asn1p_l.l" +return TOK_COMPONENTS; + YY_BREAK +case 42: +YY_RULE_SETUP +#line 299 "asn1p_l.l" +return TOK_CONSTRAINED; + YY_BREAK +case 43: +YY_RULE_SETUP +#line 300 "asn1p_l.l" +return TOK_CONTAINING; + YY_BREAK +case 44: +YY_RULE_SETUP +#line 301 "asn1p_l.l" +return TOK_DEFAULT; + YY_BREAK +case 45: +YY_RULE_SETUP +#line 302 "asn1p_l.l" +{ + /* Appeared in 1990, removed in 1997 */ + if(TYPE_LIFETIME(1990, 1997)) + return TOK_DEFINED; + fprintf(stderr, "Keyword \"%s\" at line %d " + "is obsolete\n", yytext, yylineno); + /* Deprecated since */ + REJECT; + } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 311 "asn1p_l.l" +return TOK_DEFINITIONS; + YY_BREAK +case 47: +YY_RULE_SETUP +#line 312 "asn1p_l.l" +return TOK_EMBEDDED; + YY_BREAK +case 48: +YY_RULE_SETUP +#line 313 "asn1p_l.l" +return TOK_ENCODED; + YY_BREAK +case 49: +YY_RULE_SETUP +#line 314 "asn1p_l.l" +return TOK_END; + YY_BREAK +case 50: +YY_RULE_SETUP +#line 315 "asn1p_l.l" +return TOK_ENUMERATED; + YY_BREAK +case 51: +YY_RULE_SETUP +#line 316 "asn1p_l.l" +return TOK_EXCEPT; + YY_BREAK +case 52: +YY_RULE_SETUP +#line 317 "asn1p_l.l" +return TOK_EXPLICIT; + YY_BREAK +case 53: +YY_RULE_SETUP +#line 318 "asn1p_l.l" +return TOK_EXPORTS; + YY_BREAK +case 54: +YY_RULE_SETUP +#line 319 "asn1p_l.l" +return TOK_EXTENSIBILITY; + YY_BREAK +case 55: +YY_RULE_SETUP +#line 320 "asn1p_l.l" +return TOK_EXTERNAL; + YY_BREAK +case 56: +YY_RULE_SETUP +#line 321 "asn1p_l.l" +return TOK_FALSE; + YY_BREAK +case 57: +YY_RULE_SETUP +#line 322 "asn1p_l.l" +return TOK_FROM; + YY_BREAK +case 58: +YY_RULE_SETUP +#line 323 "asn1p_l.l" +return TOK_GeneralizedTime; + YY_BREAK +case 59: +YY_RULE_SETUP +#line 324 "asn1p_l.l" +return TOK_GeneralString; + YY_BREAK +case 60: +YY_RULE_SETUP +#line 325 "asn1p_l.l" +return TOK_GraphicString; + YY_BREAK +case 61: +YY_RULE_SETUP +#line 326 "asn1p_l.l" +return TOK_IA5String; + YY_BREAK +case 62: +YY_RULE_SETUP +#line 327 "asn1p_l.l" +return TOK_IDENTIFIER; + YY_BREAK +case 63: +YY_RULE_SETUP +#line 328 "asn1p_l.l" +return TOK_IMPLICIT; + YY_BREAK +case 64: +YY_RULE_SETUP +#line 329 "asn1p_l.l" +return TOK_IMPLIED; + YY_BREAK +case 65: +YY_RULE_SETUP +#line 330 "asn1p_l.l" +return TOK_IMPORTS; + YY_BREAK +case 66: +YY_RULE_SETUP +#line 331 "asn1p_l.l" +return TOK_INCLUDES; + YY_BREAK +case 67: +YY_RULE_SETUP +#line 332 "asn1p_l.l" +return TOK_INSTANCE; + YY_BREAK +case 68: +YY_RULE_SETUP +#line 333 "asn1p_l.l" +return TOK_INTEGER; + YY_BREAK +case 69: +YY_RULE_SETUP +#line 334 "asn1p_l.l" +return TOK_INTERSECTION; + YY_BREAK +case 70: +YY_RULE_SETUP +#line 335 "asn1p_l.l" +return TOK_ISO646String; + YY_BREAK +case 71: +YY_RULE_SETUP +#line 336 "asn1p_l.l" +return TOK_MAX; + YY_BREAK +case 72: +YY_RULE_SETUP +#line 337 "asn1p_l.l" +return TOK_MIN; + YY_BREAK +case 73: +YY_RULE_SETUP +#line 338 "asn1p_l.l" +return TOK_MINUS_INFINITY; + YY_BREAK +case 74: +YY_RULE_SETUP +#line 339 "asn1p_l.l" +return TOK_NULL; + YY_BREAK +case 75: +YY_RULE_SETUP +#line 340 "asn1p_l.l" +return TOK_NumericString; + YY_BREAK +case 76: +YY_RULE_SETUP +#line 341 "asn1p_l.l" +return TOK_OBJECT; + YY_BREAK +case 77: +YY_RULE_SETUP +#line 342 "asn1p_l.l" +return TOK_ObjectDescriptor; + YY_BREAK +case 78: +YY_RULE_SETUP +#line 343 "asn1p_l.l" +return TOK_OCTET; + YY_BREAK +case 79: +YY_RULE_SETUP +#line 344 "asn1p_l.l" +return TOK_OF; + YY_BREAK +case 80: +YY_RULE_SETUP +#line 345 "asn1p_l.l" +return TOK_OPTIONAL; + YY_BREAK +case 81: +YY_RULE_SETUP +#line 346 "asn1p_l.l" +return TOK_PATTERN; + YY_BREAK +case 82: +YY_RULE_SETUP +#line 347 "asn1p_l.l" +return TOK_PDV; + YY_BREAK +case 83: +YY_RULE_SETUP +#line 348 "asn1p_l.l" +return TOK_PLUS_INFINITY; + YY_BREAK +case 84: +YY_RULE_SETUP +#line 349 "asn1p_l.l" +return TOK_PRESENT; + YY_BREAK +case 85: +YY_RULE_SETUP +#line 350 "asn1p_l.l" +return TOK_PrintableString; + YY_BREAK +case 86: +YY_RULE_SETUP +#line 351 "asn1p_l.l" +return TOK_PRIVATE; + YY_BREAK +case 87: +YY_RULE_SETUP +#line 352 "asn1p_l.l" +return TOK_REAL; + YY_BREAK +case 88: +YY_RULE_SETUP +#line 353 "asn1p_l.l" +return TOK_RELATIVE_OID; + YY_BREAK +case 89: +YY_RULE_SETUP +#line 354 "asn1p_l.l" +return TOK_SEQUENCE; + YY_BREAK +case 90: +YY_RULE_SETUP +#line 355 "asn1p_l.l" +return TOK_SET; + YY_BREAK +case 91: +YY_RULE_SETUP +#line 356 "asn1p_l.l" +return TOK_SIZE; + YY_BREAK +case 92: +YY_RULE_SETUP +#line 357 "asn1p_l.l" +return TOK_STRING; + YY_BREAK +case 93: +YY_RULE_SETUP +#line 358 "asn1p_l.l" +return TOK_SYNTAX; + YY_BREAK +case 94: +YY_RULE_SETUP +#line 359 "asn1p_l.l" +return TOK_T61String; + YY_BREAK +case 95: +YY_RULE_SETUP +#line 360 "asn1p_l.l" +return TOK_TAGS; + YY_BREAK +case 96: +YY_RULE_SETUP +#line 361 "asn1p_l.l" +return TOK_TeletexString; + YY_BREAK +case 97: +YY_RULE_SETUP +#line 362 "asn1p_l.l" +return TOK_TRUE; + YY_BREAK +case 98: +YY_RULE_SETUP +#line 363 "asn1p_l.l" +return TOK_TYPE_IDENTIFIER; + YY_BREAK +case 99: +YY_RULE_SETUP +#line 364 "asn1p_l.l" +return TOK_UNION; + YY_BREAK +case 100: +YY_RULE_SETUP +#line 365 "asn1p_l.l" +return TOK_UNIQUE; + YY_BREAK +case 101: +YY_RULE_SETUP +#line 366 "asn1p_l.l" +return TOK_UNIVERSAL; + YY_BREAK +case 102: +YY_RULE_SETUP +#line 367 "asn1p_l.l" +{ + if(TYPE_LIFETIME(1994, 0)) + return TOK_UniversalString; + REJECT; + } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 372 "asn1p_l.l" +return TOK_UTCTime; + YY_BREAK +case 104: +YY_RULE_SETUP +#line 373 "asn1p_l.l" +{ + if(TYPE_LIFETIME(1994, 0)) + return TOK_UTF8String; + REJECT; + } + YY_BREAK +case 105: +YY_RULE_SETUP +#line 378 "asn1p_l.l" +return TOK_VideotexString; + YY_BREAK +case 106: +YY_RULE_SETUP +#line 379 "asn1p_l.l" +return TOK_VisibleString; + YY_BREAK +case 107: +YY_RULE_SETUP +#line 380 "asn1p_l.l" +return TOK_WITH; + YY_BREAK +case 108: +YY_RULE_SETUP +#line 383 "asn1p_l.l" +{ + CHECK_DASHES; + asn1p_lval.tv_str = strdup(yytext); + return TOK_typefieldreference; + } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 389 "asn1p_l.l" +{ + CHECK_DASHES; + asn1p_lval.tv_str = strdup(yytext); + return TOK_valuefieldreference; + } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 396 "asn1p_l.l" +{ + CHECK_DASHES; + asn1p_lval.tv_str = strdup(yytext); + return TOK_identifier; + } + YY_BREAK +/* + * objectclassreference + */ +case 111: +YY_RULE_SETUP +#line 405 "asn1p_l.l" +{ + CHECK_DASHES; + asn1p_lval.tv_str = strdup(yytext); + return TOK_objectclassreference; + } + YY_BREAK +/* + * typereference, modulereference + * NOTE: TOK_objectclassreference must be combined + * with this token to produce true typereference. + */ +case 112: +YY_RULE_SETUP +#line 416 "asn1p_l.l" +{ + CHECK_DASHES; + asn1p_lval.tv_str = strdup(yytext); + return TOK_typereference; + } + YY_BREAK +case 113: +YY_RULE_SETUP +#line 422 "asn1p_l.l" +return TOK_PPEQ; + YY_BREAK +case 114: +YY_RULE_SETUP +#line 424 "asn1p_l.l" +return TOK_ThreeDots; + YY_BREAK +case 115: +YY_RULE_SETUP +#line 425 "asn1p_l.l" +return TOK_TwoDots; + YY_BREAK +case 116: +YY_RULE_SETUP +#line 427 "asn1p_l.l" +return yytext[0]; + YY_BREAK +case 117: +YY_RULE_SETUP +#line 429 "asn1p_l.l" +/* Ignore whitespace */ + YY_BREAK +case 118: +YY_RULE_SETUP +#line 431 "asn1p_l.l" +{ + if(TYPE_LIFETIME(1994, 0)) + fprintf(stderr, "ERROR: "); + fprintf(stderr, + "Symbol '%c' at line %d is prohibited " + "by ASN.1:1994 and ASN.1:1997\n", + yytext[0], yylineno); + if(TYPE_LIFETIME(1994, 0)) + return -1; + } + YY_BREAK + +case 119: +YY_RULE_SETUP +#line 444 "asn1p_l.l" +{ + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + YY_BREAK +case 120: +YY_RULE_SETUP +#line 450 "asn1p_l.l" +{ + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 456 "asn1p_l.l" +{ + yy_pop_state(); + return '}'; + } + YY_BREAK + +case 122: +YY_RULE_SETUP +#line 464 "asn1p_l.l" +{ + fprintf(stderr, + "Unexpected token at line %d: \"%s\"\n", + yylineno, yytext); + while(YYSTATE != INITIAL) + yy_pop_state(); + yy_top_state(); /* Just to use this function. */ + yyterminate(); + yy_fatal_error("Unexpected token"); + return -1; +} + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(dash_comment): +case YY_STATE_EOF(cpp_comment): +case YY_STATE_EOF(quoted): +case YY_STATE_EOF(opaque): +case YY_STATE_EOF(with_syntax): +#line 476 "asn1p_l.l" +{ + while(YYSTATE != INITIAL) + yy_pop_state(); + yyterminate(); + } + YY_BREAK +case 123: +YY_RULE_SETUP +#line 483 "asn1p_l.l" +YY_FATAL_ERROR( "flex scanner jammed" ); + YY_BREAK +#line 2902 "lex.yy.c" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 675 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 675 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 674); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + if ( c == '\n' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + if ( c == '\n' ) + ++yylineno; + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 483 "asn1p_l.l" + + +/* + * Very dirty but wonderful hack allowing to rule states from within .y file. + */ +void +asn1p_lexer_hack_push_opaque_state() { + yy_push_state(opaque); +} + +/* + * Another hack which disables recognizing some tokens when inside WITH SYNTAX. + */ +void +asn1p_lexer_hack_enable_with_syntax() { + yy_push_state(with_syntax); +} + +/* + * Check that a token does not end with dash and does not contain + * several dashes in succession. + * "Name", "Type-Id", "T-y-p-e-i-d" are OK + * "end-", "vustom--value" are INVALID + */ +static int +_check_dashes(char *ptr) { + int prev_dash = 0; + + assert(*ptr != '-'); + + for(;; ptr++) { + switch(*ptr) { + case '-': + if(prev_dash++) /* No double dashes */ + return -1; + continue; + case '\0': + if(prev_dash) /* No dashes at the end */ + return -1; + break; + default: + prev_dash = 0; + continue; + } + break; + } + + return 0; +} + +static asn1_integer_t +asn1p_atoi(char *ptr) { + asn1_integer_t value; + errno = 0; /* Clear the error code */ + + if(sizeof(value) <= sizeof(int)) { + value = strtol(ptr, 0, 10); + } else { +#ifdef HAVE_STRTOIMAX + value = strtoimax(ptr, 0, 10); +#elif HAVE_STRTOLL + value = strtoll(ptr, 0, 10); +#else + value = strtol(ptr, 0, 10); +#endif + } + + if(errno == ERANGE) { + fprintf(stderr, + "Value \"%s\" at line %d is too large " + "for this compiler! Please contact the vendor.", + ptr, yylineno); + errno = ERANGE; /* Restore potentially clobbered errno */ + } + + return value; +} + diff --git a/libasn1parser/asn1p_l.l b/libasn1parser/asn1p_l.l new file mode 100644 index 00000000..0d86cb74 --- /dev/null +++ b/libasn1parser/asn1p_l.l @@ -0,0 +1,560 @@ +%{ + +#include +#include +#include + +#include "asn1parser.h" +#include "asn1p_y.h" + +int asn1p_lex(void); +void asn1p_lexer_hack_push_opaque_state(void); /* Used in .y */ +void asn1p_lexer_hack_enable_with_syntax(void); /* Used in .y */ + +#define YY_FATAL_ERROR(msg) do { \ + fprintf(stderr, \ + "lexer error at line %d, " \ + "text \"%s\"\n", \ + yylineno, yytext); \ + exit(1); \ + } while(0) + +int asn1p_lexer_pedantic_1990 = 0; +int asn1p_lexer_types_year = 0; +int asn1p_lexer_constructs_year = 0; +static int _check_dashes(char *ptr); +static asn1_integer_t asn1p_atoi(char *ptr); /* errno is either 0 or ERANGE */ + +/* + * Check that the type is defined in the year of the standard choosen. + */ +#define TYPE_LIFETIME(fyr, lyr) \ + (!asn1p_lexer_types_year \ + || (fyr && fyr <= asn1p_lexer_types_year) \ + || (lyr && lyr > asn1p_lexer_types_year)) + +/* + * Check the the construction (or concept, i.e. CLASS) is defined in + * a given year. + */ +#define CONSTRUCT_LIFETIME(fyr, lyr) \ + (!asn1p_lexer_constructs_year \ + || (fyr && fyr <= asn1p_lexer_constructs_year) \ + || (lyr && lyr > asn1p_lexer_constructs_year)) + +/* + * Make sure that the label is compliant with the naming rules. + */ +#define CHECK_DASHES do { \ + if(_check_dashes(yytext)) { \ + fprintf(stderr, \ + "%s: Identifier format invalid: " \ + "Improper dash location\n", yytext); \ + return -1; \ + } } while(0) + +/* + * Append quoted string. + */ +#define QAPPEND(text, tlen) do { \ + char *prev_text = asn1p_lval.tv_opaque.buf; \ + int prev_len = asn1p_lval.tv_opaque.len; \ + char *p; \ + \ + p = malloc((tlen) + prev_len + 1); \ + if(p == NULL) return -1; \ + \ + if(prev_text) memcpy(p, prev_text, prev_len); \ + memcpy(p + prev_len, text, tlen); \ + p[prev_len + (tlen)] = '\0'; \ + \ + free(asn1p_lval.tv_opaque.buf); \ + asn1p_lval.tv_opaque.buf = p; \ + asn1p_lval.tv_opaque.len = (tlen) + prev_len; \ + } while(0) + +%} + +%option never-interactive +%option noinput nounput +%option noyywrap stack +/* Performance penalty is OK */ +%option yylineno +/* Controlled from within application */ +%option debug + +%pointer + +%x dash_comment +%x cpp_comment +%x quoted +%x opaque +%x with_syntax + +/* Newline */ +NL [\r\v\f\n] +/* White-space */ +WSP [\t\r\v\f\n ] + +%% + +"--" yy_push_state(dash_comment); +{ + + {NL} yy_pop_state(); + + -- yy_pop_state(); /* End of comment */ + - /* Eat single dash */ + [^\r\v\f\n-]+ /* Eat */ + +} +"/*" yy_push_state(cpp_comment); +{ + [^*/] /* Eat */ + "*/" yy_pop_state(); + . /* Eat */ +} + + + /* + * This is state is being set from corresponding .y module when + * higher-level data is necessary to make proper parsing of the + * underlying data. Thus, we enter the state and save + * everything for later processing. + */ +{ + + "{" { + yy_push_state(opaque); + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + + "}" { + yy_pop_state(); + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + + [^{}:=]+ { + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + + "::=" { + fprintf(stderr, + "ASN.1 Parser syncronization failure: " + "\"%s\" at line %d must not appear " + "inside value definition\n", + yytext, yylineno); + return -1; + } + + [:=] { + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + + } + +\"[^\"]* { + asn1p_lval.tv_opaque.buf = 0; + asn1p_lval.tv_opaque.len = 0; + QAPPEND(yytext+1, yyleng-1); + yy_push_state(quoted); + } +{ + + \"\" { QAPPEND(yytext, yyleng-1); } /* Add a single quote */ + [^\"]+ { QAPPEND(yytext, yyleng); } + + \" { + yy_pop_state(); + /* Do not append last quote: + // QAPPEND(yytext, yyleng); */ + + if(asn1p_lexer_pedantic_1990 + && strchr(yytext, '\n')) { + fprintf(stderr, "%s: " + "Newlines are prohibited by ASN.1:1990\n", + asn1p_lval.tv_opaque.buf); + return -1; + } + + return TOK_cstring; + } + + } + + +'[0-9A-F \t\r\v\f\n]+'H { + /* " \t\r\n" weren't allowed in ASN.1:1990. */ + asn1p_lval.tv_str = yytext; + return TOK_hstring; + } + +'[01 \t\r\v\f\n]+'B { + /* " \t\r\n" weren't allowed in ASN.1:1990. */ + asn1p_lval.tv_str = strdup(yytext); + return TOK_bstring; + } + + +-[1-9][0-9]* { + asn1p_lval.a_int = asn1p_atoi(yytext); + if(errno == ERANGE) + return -1; + return TOK_number_negative; + } + +[1-9][0-9]* { + asn1p_lval.a_int = asn1p_atoi(yytext); + if(errno == ERANGE) + return -1; + return TOK_number; + } + +"0" { + asn1p_lval.a_int = asn1p_atoi(yytext); + if(errno == ERANGE) + return -1; + return TOK_number; + } + + /* + * Tags + */ +\[(UNIVERSAL[ \t\r\v\f\n]+|APPLICATION[ \t\r\v\f\n]+|PRIVATE[ \t\r\v\f\n]+)?[0-9]+\] { + char *p; + memset(&asn1p_lval.a_tag, 0, sizeof(asn1p_lval.a_tag)); + switch(yytext[1]) { + case 'U': + asn1p_lval.a_tag.tag_class = TC_UNIVERSAL; + p = yytext + sizeof("UNIVERSAL") + 1; + break; + case 'A': + asn1p_lval.a_tag.tag_class = TC_APPLICATION; + p = yytext + sizeof("APPLICATION") + 1; + break; + case 'P': + asn1p_lval.a_tag.tag_class = TC_PRIVATE; + p = yytext + sizeof("PRIVATE") + 1; + break; + default: + assert(yytext[1] >= '0' && yytext[1] <= '9'); + asn1p_lval.a_tag.tag_class = TC_CONTEXT_SPECIFIC; + p = yytext + 1; + break; + } + asn1p_lval.a_tag.tag_value = asn1p_atoi(p); + if(*p == '0' && asn1p_lval.a_tag.tag_value) { + fprintf(stderr, + "Tag value at line %d " + "cannot start with zero " + "and have multiple digits: \"%s\"\n", + yylineno, yytext); + return -1; + } + return TOK_tag; + } + +\[[A-Z]+[ \t\r\v\f\n]+[0-9]+\] { + fprintf(stderr, + "Unsupported tag syntax at line %d: \"%s\"\n", + yylineno, yytext); + return -1; + } + +ABSENT return TOK_ABSENT; +ABSTRACT-SYNTAX return TOK_ABSTRACT_SYNTAX; +ALL return TOK_ALL; +ANY { + /* Appeared in 1990, removed in 1997 */ + if(TYPE_LIFETIME(1990, 1997)) + return TOK_ANY; + fprintf(stderr, "Keyword \"%s\" at line %d " + "is obsolete\n", yytext, yylineno); + REJECT; + } +APPLICATION return TOK_APPLICATION; +AUTOMATIC return TOK_AUTOMATIC; +BEGIN return TOK_BEGIN; +BIT return TOK_BIT; +BMPString { + if(TYPE_LIFETIME(1994, 0)) + return TOK_BMPString; + REJECT; + } +BOOLEAN return TOK_BOOLEAN; +BY return TOK_BY; +CHARACTER return TOK_CHARACTER; +CHOICE return TOK_CHOICE; +CLASS return TOK_CLASS; +COMPONENT return TOK_COMPONENT; +COMPONENTS return TOK_COMPONENTS; +CONSRAINED return TOK_CONSTRAINED; +CONTAINING return TOK_CONTAINING; +DEFAULT return TOK_DEFAULT; +DEFINED { + /* Appeared in 1990, removed in 1997 */ + if(TYPE_LIFETIME(1990, 1997)) + return TOK_DEFINED; + fprintf(stderr, "Keyword \"%s\" at line %d " + "is obsolete\n", yytext, yylineno); + /* Deprecated since */ + REJECT; + } +DEFINITIONS return TOK_DEFINITIONS; +EMBEDDED return TOK_EMBEDDED; +ENCODED return TOK_ENCODED; +END return TOK_END; +ENUMERATED return TOK_ENUMERATED; +EXCEPT return TOK_EXCEPT; +EXPLICIT return TOK_EXPLICIT; +EXPORTS return TOK_EXPORTS; +EXTENSIBILITY return TOK_EXTENSIBILITY; +EXTERNAL return TOK_EXTERNAL; +FALSE return TOK_FALSE; +FROM return TOK_FROM; +GeneralizedTime return TOK_GeneralizedTime; +GeneralString return TOK_GeneralString; +GraphicString return TOK_GraphicString; +IA5String return TOK_IA5String; +IDENTIFIER return TOK_IDENTIFIER; +IMPLICIT return TOK_IMPLICIT; +IMPLIED return TOK_IMPLIED; +IMPORTS return TOK_IMPORTS; +INCLUDES return TOK_INCLUDES; +INSTANCE return TOK_INSTANCE; +INTEGER return TOK_INTEGER; +INTERSECTION return TOK_INTERSECTION; +ISO646String return TOK_ISO646String; +MAX return TOK_MAX; +MIN return TOK_MIN; +MINUS-INFINITY return TOK_MINUS_INFINITY; +NULL return TOK_NULL; +NumericString return TOK_NumericString; +OBJECT return TOK_OBJECT; +ObjectDescriptor return TOK_ObjectDescriptor; +OCTET return TOK_OCTET; +OF return TOK_OF; +OPTIONAL return TOK_OPTIONAL; +PATTERN return TOK_PATTERN; +PDV return TOK_PDV; +PLUS-INFINITY return TOK_PLUS_INFINITY; +PRESENT return TOK_PRESENT; +PrintableString return TOK_PrintableString; +PRIVATE return TOK_PRIVATE; +REAL return TOK_REAL; +RELATIVE-OID return TOK_RELATIVE_OID; +SEQUENCE return TOK_SEQUENCE; +SET return TOK_SET; +SIZE return TOK_SIZE; +STRING return TOK_STRING; +SYNTAX return TOK_SYNTAX; +T61String return TOK_T61String; +TAGS return TOK_TAGS; +TeletexString return TOK_TeletexString; +TRUE return TOK_TRUE; +TYPE-IDENTIFIER return TOK_TYPE_IDENTIFIER; +UNION return TOK_UNION; +UNIQUE return TOK_UNIQUE; +UNIVERSAL return TOK_UNIVERSAL; +UniversalString { + if(TYPE_LIFETIME(1994, 0)) + return TOK_UniversalString; + REJECT; + } +UTCTime return TOK_UTCTime; +UTF8String { + if(TYPE_LIFETIME(1994, 0)) + return TOK_UTF8String; + REJECT; + } +VideotexString return TOK_VideotexString; +VisibleString return TOK_VisibleString; +WITH return TOK_WITH; + + +&[A-Z][A-Za-z0-9-]* { + CHECK_DASHES; + asn1p_lval.tv_str = strdup(yytext); + return TOK_typefieldreference; + } + +&[a-z][a-zA-Z0-9-]* { + CHECK_DASHES; + asn1p_lval.tv_str = strdup(yytext); + return TOK_valuefieldreference; + } + + +[a-z][a-zA-Z0-9-]* { + CHECK_DASHES; + asn1p_lval.tv_str = strdup(yytext); + return TOK_identifier; + } + + /* + * objectclassreference + */ +[A-Z][A-Z0-9-]* { + CHECK_DASHES; + asn1p_lval.tv_str = strdup(yytext); + return TOK_objectclassreference; + } + + /* + * typereference, modulereference + * NOTE: TOK_objectclassreference must be combined + * with this token to produce true typereference. + */ +[A-Z][A-Za-z0-9-]* { + CHECK_DASHES; + asn1p_lval.tv_str = strdup(yytext); + return TOK_typereference; + } + +"::=" return TOK_PPEQ; + +"..." return TOK_ThreeDots; +".." return TOK_TwoDots; + +[(){},;:|!.&@\[\]] return yytext[0]; + +{WSP}+ /* Ignore whitespace */ + +[^A-Za-z0-9:=,{}<.@()[]'\"|&^*;!-] { + if(TYPE_LIFETIME(1994, 0)) + fprintf(stderr, "ERROR: "); + fprintf(stderr, + "Symbol '%c' at line %d is prohibited " + "by ASN.1:1994 and ASN.1:1997\n", + yytext[0], yylineno); + if(TYPE_LIFETIME(1994, 0)) + return -1; + } + +{ + + [^&{} \t\r\v\f\n]+ { + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + + {WSP}+ { + asn1p_lval.tv_opaque.buf = strdup(yytext); + asn1p_lval.tv_opaque.len = yyleng; + return TOK_opaque; + } + + "}" { + yy_pop_state(); + return '}'; + } + +} + + +<*>. { + fprintf(stderr, + "Unexpected token at line %d: \"%s\"\n", + yylineno, yytext); + while(YYSTATE != INITIAL) + yy_pop_state(); + yy_top_state(); /* Just to use this function. */ + yyterminate(); + yy_fatal_error("Unexpected token"); + return -1; +} + +<*><> { + while(YYSTATE != INITIAL) + yy_pop_state(); + yyterminate(); + } + + +%% + +/* + * Very dirty but wonderful hack allowing to rule states from within .y file. + */ +void +asn1p_lexer_hack_push_opaque_state() { + yy_push_state(opaque); +} + +/* + * Another hack which disables recognizing some tokens when inside WITH SYNTAX. + */ +void +asn1p_lexer_hack_enable_with_syntax() { + yy_push_state(with_syntax); +} + +/* + * Check that a token does not end with dash and does not contain + * several dashes in succession. + * "Name", "Type-Id", "T-y-p-e-i-d" are OK + * "end-", "vustom--value" are INVALID + */ +static int +_check_dashes(char *ptr) { + int prev_dash = 0; + + assert(*ptr != '-'); + + for(;; ptr++) { + switch(*ptr) { + case '-': + if(prev_dash++) /* No double dashes */ + return -1; + continue; + case '\0': + if(prev_dash) /* No dashes at the end */ + return -1; + break; + default: + prev_dash = 0; + continue; + } + break; + } + + return 0; +} + +static asn1_integer_t +asn1p_atoi(char *ptr) { + asn1_integer_t value; + errno = 0; /* Clear the error code */ + + if(sizeof(value) <= sizeof(int)) { + value = strtol(ptr, 0, 10); + } else { +#ifdef HAVE_STRTOIMAX + value = strtoimax(ptr, 0, 10); +#elif HAVE_STRTOLL + value = strtoll(ptr, 0, 10); +#else + value = strtol(ptr, 0, 10); +#endif + } + + if(errno == ERANGE) { + fprintf(stderr, + "Value \"%s\" at line %d is too large " + "for this compiler! Please contact the vendor.", + ptr, yylineno); + errno = ERANGE; /* Restore potentially clobbered errno */ + } + + return value; +} + diff --git a/libasn1parser/asn1p_list.h b/libasn1parser/asn1p_list.h new file mode 100644 index 00000000..1f808780 --- /dev/null +++ b/libasn1parser/asn1p_list.h @@ -0,0 +1,57 @@ +/* + * Singly linked tail queue support. + */ +#ifndef ASN1_PARSER_LIST_H +#define ASN1_PARSER_LIST_H + +#define TQ_HEAD(type) \ + struct { \ + type *tq_head; \ + type**tq_tail; \ + } + +#define TQ_HEAD_COPY(to, from) \ + do { (to)->tq_head = (from)->tq_head; \ + (to)->tq_tail = (from)->tq_tail; } while(0) + +#define TQ_ENTRY(type) \ + struct { \ + type *tq_next; \ + } + +#define TQ_FIRST(headp) ((headp)->tq_head) +#define TQ_NEXT(el, field) ((el)->field.tq_next) + +#define TQ_INIT(head) do { \ + TQ_FIRST((head)) = 0; \ + (head)->tq_tail = &TQ_FIRST((head)); \ + } while(0) + +#define TQ_FOR(var, head, field) \ + for((var) = TQ_FIRST((head)); \ + (var); (var) = TQ_NEXT((var), field)) + +#define TQ_ADD(head, xel, field) do { \ + typeof(xel) __el = xel; \ + assert(TQ_NEXT((__el), field) == 0); \ + *(head)->tq_tail = (__el); \ + (head)->tq_tail = &TQ_NEXT((__el), field); \ + } while(0) + +/* + * Remove the first element and return it. + */ +#define TQ_REMOVE(head, field) ({ \ + typeof(TQ_FIRST((head))) __fel; \ + __fel = TQ_FIRST((head)); \ + if(__fel == 0 \ + || (TQ_FIRST((head)) = TQ_NEXT(__fel, field)) \ + == 0) { \ + (head)->tq_tail = &TQ_FIRST((head)); \ + } else { \ + TQ_NEXT(__fel, field) = 0; \ + } \ + __fel; }) + + +#endif /* ASN1_PARSER_LIST_H */ diff --git a/libasn1parser/asn1p_module.c b/libasn1parser/asn1p_module.c new file mode 100644 index 00000000..d430844e --- /dev/null +++ b/libasn1parser/asn1p_module.c @@ -0,0 +1,62 @@ +#include +#include + +#include "asn1parser.h" + +/* + * Construct a new empty module. + */ +asn1p_module_t * +asn1p_module_new() { + asn1p_module_t *mod; + + mod = calloc(1, sizeof *mod); + if(mod) { + TQ_INIT(&(mod->imports)); + TQ_INIT(&(mod->exports)); + TQ_INIT(&(mod->members)); + } + return mod; +} + +/* + * Destroy the module. + */ +void +asn1p_module_free(asn1p_module_t *mod) { + if(mod) { + asn1p_expr_t *expr; + + if(mod->Identifier) + free(mod->Identifier); + + if(mod->module_oid) + asn1p_oid_free(mod->module_oid); + + while((expr = TQ_REMOVE(&(mod->members), next))) + asn1p_expr_free(expr); + + free(mod); + } +} + +asn1p_t * +asn1p_new() { + asn1p_t *asn; + asn = calloc(1, sizeof(*asn)); + if(asn) { + TQ_INIT(&(asn->modules)); + } + return asn; +} + + +void +asn1p_free(asn1p_t *asn) { + if(asn) { + asn1p_module_t *mod; + while((mod = TQ_REMOVE(&(asn->modules), mod_next))) + asn1p_module_free(mod); + free(asn); + } +} diff --git a/libasn1parser/asn1p_module.h b/libasn1parser/asn1p_module.h new file mode 100644 index 00000000..906c784a --- /dev/null +++ b/libasn1parser/asn1p_module.h @@ -0,0 +1,88 @@ +/* + * A Module definition structure used by the ASN.1 parser. + */ +#ifndef ASN1_PARSER_MODULE_H +#define ASN1_PARSER_MODULE_H + +/* + * Flags specific to a module. + */ +typedef enum asn1p_module_flags { + MSF_NOFLAGS, + MSF_EXPLICIT_TAGS = 0x1, + MSF_IMPLICIT_TAGS = 0x2, + MSF_AUTOMATIC_TAGS = 0x4, + MSF_EXTENSIBILITY_IMPLIED = 0x8, +} asn1p_module_flags_e; + +/* + * === EXAMPLE === + * MySyntax DEFINITIONS AUTOMATIC TAGS ::= + * BEGIN + * ... + * END + * === EOF === + */ +typedef struct asn1p_module_s { + + /* + * Name of the source file. + */ + char *source_file_name; + + /* + * Human-readable module identifier. + */ + char *Identifier; /* Module name */ + + /* + * Unique module identifier, OID. + */ + asn1p_oid_t *module_oid; /* Optional OID of the module */ + + /* + * Module flags. + */ + asn1p_module_flags_e module_flags; /* AUTOMATIC TAGS? */ + + /* + * List of everything that this module IMPORTS. + */ + TQ_HEAD(struct asn1p_xports_s) imports; + + /* + * List of everything that this module EXPORTS. + */ + TQ_HEAD(struct asn1p_xports_s) exports; + + /* + * List of everything that this module defines itself. + */ + TQ_HEAD(struct asn1p_expr_s) members; + + /* + * Next module in the list. + */ + TQ_ENTRY(struct asn1p_module_s) + mod_next; + +} asn1p_module_t; + +/* + * Constructor and destructor. + */ +asn1p_module_t *asn1p_module_new(void); +void asn1p_module_free(asn1p_module_t *mod); + +/* + * No more than a container for several modules. + */ +typedef struct asn1p_s { + TQ_HEAD(struct asn1p_module_s) modules; +} asn1p_t; + +asn1p_t *asn1p_new(void); +void asn1p_free(asn1p_t *asn); + + +#endif /* ASN1_PARSER_MODULE_H */ diff --git a/libasn1parser/asn1p_oid.c b/libasn1parser/asn1p_oid.c new file mode 100644 index 00000000..2c22b0fd --- /dev/null +++ b/libasn1parser/asn1p_oid.c @@ -0,0 +1,95 @@ +#include +#include +#include + +#include "asn1parser.h" + +asn1p_oid_t * +asn1p_oid_new() { + return calloc(1, sizeof(asn1p_oid_t)); +} + +int +asn1p_oid_add_arc(asn1p_oid_t *oid, asn1p_oid_arc_t *template) { + void *p; + p = realloc(oid->arcs, (oid->arcs_count + 1) * sizeof(oid->arcs[0])); + if(p) { + oid->arcs = p; + oid->arcs[oid->arcs_count].name + = template->name?strdup(template->name):0; + oid->arcs[oid->arcs_count].number = template->number; + oid->arcs_count++; + return 0; + } else { + return -1; + } +} + +void +asn1p_oid_free(asn1p_oid_t *oid) { + if(oid) { + if(oid->arcs) { + while(oid->arcs_count--) { + if(oid->arcs[oid->arcs_count].name) + free(oid->arcs[oid->arcs_count].name); + } + } + free(oid); + } +} + +asn1p_oid_arc_t * +asn1p_oid_arc_new(const char *optName, asn1_integer_t optNumber /* = -1 */) { + asn1p_oid_arc_t *arc; + + arc = calloc(1, sizeof *arc); + if(arc) { + if(optName) + arc->name = strdup(optName); + arc->number = optNumber; + } + + return arc; +} + +void +asn1p_oid_arc_free(asn1p_oid_arc_t *arc) { + if(arc) { + if(arc->name) + free(arc->name); + free(arc); + } +} + +int +asn1p_oid_compare(asn1p_oid_t *a, asn1p_oid_t *b) { + int i; + + for(i = 0; ; i++) { + asn1_integer_t cmp; + + if(b->arcs_count > i) { + if(a->arcs_count <= i) + return -1; + } else if(a->arcs_count > i) { + if(b->arcs_count <= i) + return 1; + } else if(b->arcs_count <= i && a->arcs_count <= i) { + cmp = b->arcs_count - a->arcs_count; + if(cmp < 0) + return -1; + else if(cmp > 0) + return 1; + return 0; + } + + cmp = b->arcs[i].number - a->arcs[i].number; + if(cmp < 0) + return -1; + else if(cmp > 0) + return 1; + } + +} + + diff --git a/libasn1parser/asn1p_oid.h b/libasn1parser/asn1p_oid.h new file mode 100644 index 00000000..cbb6b079 --- /dev/null +++ b/libasn1parser/asn1p_oid.h @@ -0,0 +1,66 @@ +/* + * Object Identifier definition. + */ +#ifndef ASN1_PARSER_OID_H +#define ASN1_PARSER_OID_H + +/******************************** + * Single Object Identifier Arc * + ********************************/ + +/* + * Object identifier arc (one number in the hierarchy). + */ +typedef struct asn1p_oid_arc_s { + asn1_integer_t number; /* -1 if not yet defined */ + char *name; /* 0 if not defined */ +} asn1p_oid_arc_t; + + +/* + * Arc constructor. + */ +asn1p_oid_arc_t *asn1p_oid_arc_new( + const char *optName, asn1_integer_t optNumber /* = -1 */); +/* + * Arc destructor. + */ +void asn1p_oid_arc_free(asn1p_oid_arc_t *); + + +/************************************************** + * Object Identifier itself, a collection of arcs * + **************************************************/ + +/* + * Object Identifier as a collection of arcs. + */ +typedef struct asn1p_oid_s { + asn1p_oid_arc_t *arcs; + int arcs_count; +} asn1p_oid_t; + +/* + * OID constructor. + */ +asn1p_oid_t *asn1p_oid_new(void); + +/* + * Add another arc using given one as a template + */ +int asn1p_oid_add_arc(asn1p_oid_t *, asn1p_oid_arc_t *template); + +/* + * OID destructor. + */ +void asn1p_oid_free(asn1p_oid_t *); + +/* + * RETURN VALUES: + * 0: The specified OIDs are equal. + * -1 or 1 otherwise. + */ +int asn1p_oid_compare(asn1p_oid_t *a, asn1p_oid_t *b); + + +#endif /* ASN1_PARSER_OID_H */ diff --git a/libasn1parser/asn1p_param.c b/libasn1parser/asn1p_param.c new file mode 100644 index 00000000..f7082241 --- /dev/null +++ b/libasn1parser/asn1p_param.c @@ -0,0 +1,111 @@ +#include +#include +#include +#include +#include + +#include "asn1parser.h" + +/* + * Construct a new empty parameters list. + */ +asn1p_paramlist_t * +asn1p_paramlist_new(int _lineno) { + asn1p_paramlist_t *pl; + + pl = calloc(1, sizeof *pl); + if(pl) { + pl->_lineno = _lineno; + } + + return pl; +} + +void +asn1p_paramlist_free(asn1p_paramlist_t *pl) { + if(pl) { + if(pl->params) { + int i = pl->params_count; + while(i--) { + if(pl->params[i].governor) + asn1p_ref_free(pl->params[i].governor); + if(pl->params[i].argument) + free(pl->params[i].argument); + pl->params[i].governor = 0; + pl->params[i].argument = 0; + } + free(pl->params); + pl->params = 0; + } + + free(pl); + } +} + +int +asn1p_paramlist_add_param(asn1p_paramlist_t *pl, asn1p_ref_t *gov, char *arg) { + + if(!pl || !arg) { + errno = EINVAL; + return -1; + } + + /* + * Make sure there's enough space to insert a new element. + */ + if(pl->params_count == pl->params_size) { + int newsize = pl->params_size?pl->params_size<<2:4; + void *p; + p = realloc(pl->params, + newsize * sizeof(pl->params[0])); + if(p) { + pl->params = p; + pl->params_size = newsize; + } else { + return -1; + } + + } + + if(gov) { + pl->params[pl->params_count].governor = asn1p_ref_clone(gov); + if(pl->params[pl->params_count].governor == NULL) { + return -1; + } + } else { + pl->params[pl->params_count].governor = 0; + } + + pl->params[pl->params_count].argument = strdup(arg); + if(pl->params[pl->params_count].argument) { + pl->params_count++; + return 0; + } else { + if(pl->params[pl->params_count].governor) + asn1p_ref_free(pl->params[pl->params_count].governor); + return -1; + } +} + +asn1p_paramlist_t * +asn1p_paramlist_clone(asn1p_paramlist_t *pl) { + asn1p_paramlist_t *newpl; + + newpl = asn1p_paramlist_new(pl->_lineno); + if(newpl) { + int i; + for(i = 0; i < pl->params_count; i++) { + if(asn1p_paramlist_add_param(newpl, + pl->params[i].governor, + pl->params[i].argument + )) { + asn1p_paramlist_free(newpl); + newpl = NULL; + break; + } + } + } + + return newpl; +} + diff --git a/libasn1parser/asn1p_param.h b/libasn1parser/asn1p_param.h new file mode 100644 index 00000000..c9c20c23 --- /dev/null +++ b/libasn1parser/asn1p_param.h @@ -0,0 +1,30 @@ +/* + * Structures and prototypes related to parametrization + */ +#ifndef ASN1_PARSER_PARAMETRIZATION_H +#define ASN1_PARSER_PARAMETRIZATION_H + +typedef struct asn1p_paramlist_s { + struct asn1p_param_s { + asn1p_ref_t *governor; + char *argument; + } *params; + int params_count; + int params_size; + + int _lineno; +} asn1p_paramlist_t; + +/* + * Constructor and destructor. + */ +asn1p_paramlist_t *asn1p_paramlist_new(int _lineno); +void asn1p_paramlist_free(asn1p_paramlist_t *); + +asn1p_paramlist_t *asn1p_paramlist_clone(asn1p_paramlist_t *ref); + +int asn1p_paramlist_add_param(asn1p_paramlist_t *, + asn1p_ref_t *opt_gov, char *arg); + + +#endif /* ASN1_PARSER_PARAMETRIZATION_H */ diff --git a/libasn1parser/asn1p_ref.c b/libasn1parser/asn1p_ref.c new file mode 100644 index 00000000..4ac2b32d --- /dev/null +++ b/libasn1parser/asn1p_ref.c @@ -0,0 +1,137 @@ +#include +#include +#include +#include +#include + +#include "asn1parser.h" + +/* + * Construct a new empty reference. + */ +asn1p_ref_t * +asn1p_ref_new(int _lineno) { + asn1p_ref_t *ref; + + ref = calloc(1, sizeof *ref); + if(ref) { + ref->_lineno = _lineno; + } + + return ref; +} + +void +asn1p_ref_free(asn1p_ref_t *ref) { + if(ref) { + if(ref->components) { + int i = ref->comp_count; + while(i--) { + if(ref->components[i].name) + free(ref->components[i].name); + ref->components[i].name = 0; + } + free(ref->components); + ref->components = 0; + } + + free(ref); + } +} + +static enum asn1p_ref_lex_type_e +asn1p_ref_name2lextype(char *name) { + enum asn1p_ref_lex_type_e lex_type; + int has_lowercase = 0; + + if(*name == '&') { + if(name[1] >= 'A' && name[1] <= 'Z') { + lex_type = RLT_AmpUppercase; + } else { + lex_type = RLT_Amplowercase; + } + } else if(*name >= 'A' && *name <= 'Z') { + char *p; + + for(p = name; *p; p++) { + if(*p >= 'a' && *p <= 'z') { + has_lowercase = 1; + break; + } + } + + if(has_lowercase) { + lex_type = RLT_Uppercase; + } else { + lex_type = RLT_CAPITALS; + } + } else if(*name == '@') { + if(name[1] == '.') + lex_type = RLT_AtDotlowercase; + else + lex_type = RLT_Atlowercase; + } else { + lex_type = RLT_lowercase; + } + + return lex_type; +} + +int +asn1p_ref_add_component(asn1p_ref_t *ref, char *name, enum asn1p_ref_lex_type_e lex_type) { + + if(!ref || !name || lex_type < RLT_UNKNOWN || lex_type >= RLT_MAX) { + errno = EINVAL; + return -1; + } + + if(ref->comp_count == ref->comp_size) { + int newsize = ref->comp_size?(ref->comp_size<<2):4; + void *p = realloc(ref->components, + newsize * sizeof(ref->components[0])); + if(p) { + ref->components = p; + ref->comp_size = newsize; + } else { + return -1; + } + + } + + if(lex_type == RLT_UNKNOWN) { + lex_type = asn1p_ref_name2lextype(name); + } else { + assert(lex_type == asn1p_ref_name2lextype(name)); + } + + ref->components[ref->comp_count].name = strdup(name); + ref->components[ref->comp_count].lex_type = lex_type; + if(ref->components[ref->comp_count].name) { + ref->comp_count++; + return 0; + } else { + return -1; + } +} + +asn1p_ref_t * +asn1p_ref_clone(asn1p_ref_t *ref) { + asn1p_ref_t *newref; + + newref = asn1p_ref_new(ref->_lineno); + if(newref) { + int i; + for(i = 0; i < ref->comp_count; i++) { + if(asn1p_ref_add_component(newref, + ref->components[i].name, + ref->components[i].lex_type + )) { + asn1p_ref_free(newref); + newref = NULL; + break; + } + } + } + + return newref; +} diff --git a/libasn1parser/asn1p_ref.h b/libasn1parser/asn1p_ref.h new file mode 100644 index 00000000..dc7a7165 --- /dev/null +++ b/libasn1parser/asn1p_ref.h @@ -0,0 +1,62 @@ +/* + * Generic reference to the yet unknown type defined elsewhere. + */ +#ifndef ASN1_PARSER_REFERENCE_H +#define ASN1_PARSER_REFERENCE_H + +typedef struct asn1p_ref_s { + + /* + * A set of reference name components. + * A reference name consists of several components separated by dots: + * "OBJECT-CLASS.&Algorithm.&id" + */ + struct asn1p_ref_component_s { + enum asn1p_ref_lex_type_e { + RLT_UNKNOWN, /* Invalid? */ + /* + * Object class reference "OCLASS1", + * type reference "Type1", + * value reference "id", + * type field reference "&Type1", + * value field reference "&id", + * "OBJECT-CLASS" + */ + RLT_CAPITALS, + RLT_Uppercase, + RLT_lowercase, + RLT_AmpUppercase, + RLT_Amplowercase, + RLT_Atlowercase, + RLT_AtDotlowercase, + RLT_MAX + } lex_type; /* Inferred lexical type of the identifier */ + char *name; /* An identifier */ + } *components; + + int comp_count; /* Number of the components in the reference name. */ + int comp_size; /* Number of allocated structures */ + + int _lineno; /* Number of line in the file */ +} asn1p_ref_t; + +/* + * Constructor and destructor. + */ +asn1p_ref_t *asn1p_ref_new(int _lineno); +void asn1p_ref_free(asn1p_ref_t *); + +asn1p_ref_t *asn1p_ref_clone(asn1p_ref_t *ref); + +/* + * Add a new reference component to the existing reference structure. + * + * RETURN VALUES: + * 0: All clear. + * -1/EINVAL: Invalid arguments + * -1/ENOMEM: Memory allocation failed + */ +int asn1p_ref_add_component(asn1p_ref_t *, + char *name, enum asn1p_ref_lex_type_e); + +#endif /* ASN1_PARSER_REFERENCE_H */ diff --git a/libasn1parser/asn1p_value.c b/libasn1parser/asn1p_value.c new file mode 100644 index 00000000..fb3a9453 --- /dev/null +++ b/libasn1parser/asn1p_value.c @@ -0,0 +1,178 @@ +#include +#include +#include +#include + +#include "asn1parser.h" + + +asn1p_value_t * +asn1p_value_fromref(asn1p_ref_t *ref, int do_copy) { + if(ref) { + asn1p_value_t *v = calloc(1, sizeof *v); + if(v) { + if(do_copy) { + v->value.reference = asn1p_ref_clone(ref); + if(v->value.reference == NULL) { + free(v); + return NULL; + } + } else { + v->value.reference = ref; + } + v->type = ATV_REFERENCED; + } + return v; + } else { + errno = EINVAL; + return NULL; + } +} + +asn1p_value_t * +asn1p_value_frombits(uint8_t *bits, int size_in_bits, int do_copy) { + if(bits) { + asn1p_value_t *v = calloc(1, sizeof *v); + assert(size_in_bits >= 0); + if(v) { + if(do_copy) { + int size = ((size_in_bits + 7) >> 3); + void *p; + p = malloc(size + 1); + if(p) { + memcpy(p, bits, size); + ((char *)p)[size] = '\0'; /* JIC */ + } else { + free(v); + return NULL; + } + v->value.binary_vector.bits = p; + } else { + v->value.binary_vector.bits = (void *)bits; + } + v->value.binary_vector.size_in_bits = size_in_bits; + v->type = ATV_BITVECTOR; + } + return v; + } else { + errno = EINVAL; + return NULL; + } +} +asn1p_value_t * +asn1p_value_frombuf(char *buffer, int size, int do_copy) { + if(buffer) { + asn1p_value_t *v = calloc(1, sizeof *v); + assert(size >= 0); + if(v) { + if(do_copy) { + void *p = malloc(size + 1); + if(p) { + memcpy(p, buffer, size); + ((char *)p)[size] = '\0'; /* JIC */ + } else { + free(v); + return NULL; + } + v->value.string.buf = p; + } else { + v->value.string.buf = buffer; + } + v->value.string.size = size; + v->type = ATV_STRING; + } + return v; + } else { + errno = EINVAL; + return NULL; + } +} + +asn1p_value_t * +asn1p_value_fromdouble(double d) { + asn1p_value_t *v = calloc(1, sizeof *v); + if(v) { + v->value.v_double = d; + v->type = ATV_REAL; + } + return v; +} + +asn1p_value_t * +asn1p_value_fromint(asn1_integer_t i) { + asn1p_value_t *v = calloc(1, sizeof *v); + if(v) { + v->value.v_integer = i; + v->type = ATV_INTEGER; + } + return v; +} + +asn1p_value_t * +asn1p_value_clone(asn1p_value_t *v) { + asn1p_value_t *clone; + if(v) { + switch(v->type) { + case ATV_NOVALUE: + return calloc(1, sizeof(*v)); + case ATV_REFERENCED: + return asn1p_value_fromref(v->value.reference, 1); + case ATV_REAL: + return asn1p_value_fromdouble(v->value.v_double); + case ATV_INTEGER: + case ATV_MIN: + case ATV_MAX: + case ATV_FALSE: + case ATV_TRUE: + clone = asn1p_value_fromint(v->value.v_integer); + if(clone) clone->type = v->type; + return clone; + case ATV_STRING: + clone = asn1p_value_frombuf(v->value.string.buf, + v->value.string.size, 1); + if(clone) clone->type = v->type; + return clone; + case ATV_UNPARSED: + clone = asn1p_value_frombuf(v->value.string.buf, + v->value.string.size, 1); + if(clone) clone->type = ATV_UNPARSED; + return clone; + case ATV_BITVECTOR: + return asn1p_value_frombuf(v->value.binary_vector.bits, + v->value.binary_vector.size_in_bits, 1); + } + } + return v; +} + +void +asn1p_value_free(asn1p_value_t *v) { + if(v) { + switch(v->type) { + case ATV_NOVALUE: + break; + case ATV_REFERENCED: + asn1p_ref_free(v->value.reference); + break; + case ATV_INTEGER: + case ATV_MIN: + case ATV_MAX: + case ATV_FALSE: + case ATV_TRUE: + case ATV_REAL: + /* No freeing necessary */ + break; + case ATV_STRING: + case ATV_UNPARSED: + assert(v->value.string.buf); + free(v->value.string.buf); + break; + case ATV_BITVECTOR: + assert(v->value.binary_vector.bits); + free(v->value.binary_vector.bits); + break; + } + free(v); + } +} + diff --git a/libasn1parser/asn1p_value.h b/libasn1parser/asn1p_value.h new file mode 100644 index 00000000..c9dabfcd --- /dev/null +++ b/libasn1parser/asn1p_value.h @@ -0,0 +1,60 @@ +/* + * A generic value of different syntaxes. + */ +#ifndef ASN1_PARSER_VALUE_H +#define ASN1_PARSER_VALUE_H + +/* + * A wrapper around various kinds of values. + */ +typedef struct asn1p_value_s { + /* + * The value of the element. + */ + enum { + ATV_NOVALUE, + ATV_REFERENCED, + ATV_REAL, + ATV_INTEGER, + ATV_MIN, + ATV_MAX, + ATV_FALSE, + ATV_TRUE, + ATV_STRING, + ATV_UNPARSED, + ATV_BITVECTOR, + } type; /* Value type and location */ + + union { + asn1p_ref_t *reference; + asn1_integer_t v_integer; + double v_double; + /* + * Binary bits vector. + */ + struct { + uint8_t *buf; + int size; + } string; + struct { + uint8_t *bits; + int size_in_bits; + } binary_vector; + } value; +} asn1p_value_t; + +/* + * Constructors and destructor for value. + * If ref, bits or buffer are omitted, the corresponding function returns + * (asn1p_value_t *)0 with errno = EINVAL. + * Allocated value (where applicable) is guaranteed to be NUL-terminated. + */ +asn1p_value_t *asn1p_value_fromref(asn1p_ref_t *ref, int do_copy); +asn1p_value_t *asn1p_value_frombits(uint8_t *bits, int size_in_bits, int dc); +asn1p_value_t *asn1p_value_frombuf(char *buffer, int size, int do_copy); +asn1p_value_t *asn1p_value_fromdouble(double); +asn1p_value_t *asn1p_value_fromint(asn1_integer_t); +asn1p_value_t *asn1p_value_clone(asn1p_value_t *); +void asn1p_value_free(asn1p_value_t *); + +#endif /* ASN1_PARSER_VALUE_H */ diff --git a/libasn1parser/asn1p_xports.c b/libasn1parser/asn1p_xports.c new file mode 100644 index 00000000..cfc9fa4f --- /dev/null +++ b/libasn1parser/asn1p_xports.c @@ -0,0 +1,34 @@ +#include +#include + +#include "asn1parser.h" + +/* + * Construct a new structure that would hold the EXPORTS or IMPORTS + * clause data. + */ +asn1p_xports_t * +asn1p_xports_new() { + asn1p_xports_t *xp; + + xp = calloc(1, sizeof *xp); + if(xp) { + TQ_INIT(&(xp->members)); + } + + return xp; +} + +/* + * Destroy the xports structure. + */ +void +asn1p_xports_free(asn1p_xports_t *xp) { + if(xp) { + if(xp->from) + free(xp->from); + if(xp->from_oid) + asn1p_oid_free(xp->from_oid); + free(xp); + } +} diff --git a/libasn1parser/asn1p_xports.h b/libasn1parser/asn1p_xports.h new file mode 100644 index 00000000..8f4fade3 --- /dev/null +++ b/libasn1parser/asn1p_xports.h @@ -0,0 +1,40 @@ +/* + * Imports and exports structure. + */ +#ifndef ASN1_PARSE_XPORTS_H +#define ASN1_PARSE_XPORTS_H + + +typedef struct asn1p_xports_s { + /* + * Type of the xports structure. + */ + enum asn1p_xports { + XPT_IMPORTS, + XPT_EXPORTS, + } xports_type; + + /* + * Module name and optional OID, occur after FROM. + */ + char *from; /* Name of the module */ + asn1p_oid_t *from_oid; /* Optional OID of the module */ + + /* + * Number of entities to import. + */ + TQ_HEAD(struct asn1p_expr_s) members; + + /* + * Pointer to the next xports structure in whatever list. + */ + TQ_ENTRY(struct asn1p_xports_s) xp_next; +} asn1p_xports_t; + +/* + * Constructor and destructor. + */ +asn1p_xports_t *asn1p_xports_new(void); +void asn1p_xports_free(asn1p_xports_t *); + +#endif /* ASN1_PARSE_XPORTS_H */ diff --git a/libasn1parser/asn1p_y.c b/libasn1parser/asn1p_y.c new file mode 100644 index 00000000..095c9041 --- /dev/null +++ b/libasn1parser/asn1p_y.c @@ -0,0 +1,3484 @@ + +/* A Bison parser, made from asn1p_y.y + by GNU Bison version 1.28 */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define yyparse asn1p_parse +#define yylex asn1p_lex +#define yyerror asn1p_error +#define yylval asn1p_lval +#define yychar asn1p_char +#define yydebug asn1p_debug +#define yynerrs asn1p_nerrs +#define TOK_PPEQ 257 +#define TOK_opaque 258 +#define TOK_bstring 259 +#define TOK_cstring 260 +#define TOK_hstring 261 +#define TOK_identifier 262 +#define TOK_number 263 +#define TOK_number_negative 264 +#define TOK_typereference 265 +#define TOK_objectclassreference 266 +#define TOK_typefieldreference 267 +#define TOK_valuefieldreference 268 +#define TOK_ABSENT 269 +#define TOK_ABSTRACT_SYNTAX 270 +#define TOK_ALL 271 +#define TOK_ANY 272 +#define TOK_APPLICATION 273 +#define TOK_AUTOMATIC 274 +#define TOK_BEGIN 275 +#define TOK_BIT 276 +#define TOK_BMPString 277 +#define TOK_BOOLEAN 278 +#define TOK_BY 279 +#define TOK_CHARACTER 280 +#define TOK_CHOICE 281 +#define TOK_CLASS 282 +#define TOK_COMPONENT 283 +#define TOK_COMPONENTS 284 +#define TOK_CONSTRAINED 285 +#define TOK_CONTAINING 286 +#define TOK_DEFAULT 287 +#define TOK_DEFINITIONS 288 +#define TOK_DEFINED 289 +#define TOK_EMBEDDED 290 +#define TOK_ENCODED 291 +#define TOK_END 292 +#define TOK_ENUMERATED 293 +#define TOK_EXPLICIT 294 +#define TOK_EXPORTS 295 +#define TOK_EXTENSIBILITY 296 +#define TOK_EXTERNAL 297 +#define TOK_FALSE 298 +#define TOK_FROM 299 +#define TOK_GeneralizedTime 300 +#define TOK_GeneralString 301 +#define TOK_GraphicString 302 +#define TOK_IA5String 303 +#define TOK_IDENTIFIER 304 +#define TOK_IMPLICIT 305 +#define TOK_IMPLIED 306 +#define TOK_IMPORTS 307 +#define TOK_INCLUDES 308 +#define TOK_INSTANCE 309 +#define TOK_INTEGER 310 +#define TOK_ISO646String 311 +#define TOK_MAX 312 +#define TOK_MIN 313 +#define TOK_MINUS_INFINITY 314 +#define TOK_NULL 315 +#define TOK_NumericString 316 +#define TOK_OBJECT 317 +#define TOK_ObjectDescriptor 318 +#define TOK_OCTET 319 +#define TOK_OF 320 +#define TOK_OPTIONAL 321 +#define TOK_PATTERN 322 +#define TOK_PDV 323 +#define TOK_PLUS_INFINITY 324 +#define TOK_PRESENT 325 +#define TOK_PrintableString 326 +#define TOK_PRIVATE 327 +#define TOK_REAL 328 +#define TOK_RELATIVE_OID 329 +#define TOK_SEQUENCE 330 +#define TOK_SET 331 +#define TOK_SIZE 332 +#define TOK_STRING 333 +#define TOK_SYNTAX 334 +#define TOK_T61String 335 +#define TOK_TAGS 336 +#define TOK_TeletexString 337 +#define TOK_TRUE 338 +#define TOK_TYPE_IDENTIFIER 339 +#define TOK_UNIQUE 340 +#define TOK_UNIVERSAL 341 +#define TOK_UniversalString 342 +#define TOK_UTCTime 343 +#define TOK_UTF8String 344 +#define TOK_VideotexString 345 +#define TOK_VisibleString 346 +#define TOK_WITH 347 +#define TOK_UNION 348 +#define TOK_INTERSECTION 349 +#define TOK_EXCEPT 350 +#define TOK_TwoDots 351 +#define TOK_ThreeDots 352 +#define TOK_tag 353 + +#line 1 "asn1p_y.y" + + +#include +#include +#include +#include +#include + +#include "asn1parser.h" + +#define YYPARSE_PARAM param +#define YYERROR_VERBOSE + +int yylex(void); +int yyerror(const char *msg); +void asn1p_lexer_hack_push_opaque_state(void); +void asn1p_lexer_hack_enable_with_syntax(void); +#define yylineno asn1p_lineno +extern int asn1p_lineno; + + +static asn1p_value_t * + _convert_bitstring2binary(char *str, int base); + +#define checkmem(ptr) do { \ + if(!(ptr)) \ + return yyerror("Memory failure"); \ + } while(0) + +#define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \ + if(arg1->type != constr_type) { \ + int __ret; \ + root = asn1p_constraint_new(yylineno); \ + checkmem(root); \ + root->type = constr_type; \ + __ret = asn1p_constraint_insert(root, \ + arg1); \ + checkmem(__ret == 0); \ + } else { \ + root = arg1; \ + } \ + if(arg2) { \ + int __ret \ + = asn1p_constraint_insert(root, arg2); \ + checkmem(__ret == 0); \ + } \ + } while(0) + + +#line 57 "asn1p_y.y" +typedef union { + asn1p_t *a_grammar; + asn1p_module_flags_e a_module_flags; + asn1p_module_t *a_module; + asn1p_expr_type_e a_type; /* ASN.1 Type */ + asn1p_expr_t *a_expr; /* Constructed collection */ + asn1p_constraint_t *a_constr; /* Constraint */ + enum asn1p_constraint_type_e a_ctype;/* Constraint type */ + asn1p_xports_t *a_xports; /* IMports/EXports */ + asn1p_oid_t *a_oid; /* Object Identifier */ + asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */ + struct asn1p_type_tag_s a_tag; /* A tag */ + asn1p_ref_t *a_ref; /* Reference to custom type */ + asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */ + asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */ + struct asn1p_ref_component_s a_refcomp; /* Component of a reference */ + asn1p_value_t *a_value; /* Number, DefinedValue, etc */ + struct asn1p_param_s a_parg; /* A parameter argument */ + asn1p_paramlist_t *a_plist; /* A pargs list */ + enum asn1p_expr_marker_e a_marker; /* OPTIONAL/DEFAULT */ + enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */ + asn1_integer_t a_int; + char *tv_str; + struct { + char *buf; + int len; + } tv_opaque; + struct { + char *name; + struct asn1p_type_tag_s tag; + } tv_nametag; +} YYSTYPE; +#include + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 375 +#define YYFLAG -32768 +#define YYNTBASE 113 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 353 ? yytranslate[x] : 211) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 109, 2, 2, 2, 2, 2, 2, 104, + 105, 2, 2, 107, 2, 110, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 108, 106, 111, + 2, 2, 2, 112, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 96, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 102, 94, 103, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 95, 97, 98, + 99, 100, 101 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 4, 7, 16, 17, 19, 23, 26, 28, + 31, 33, 38, 40, 41, 43, 45, 48, 51, 54, + 57, 60, 61, 63, 65, 68, 70, 72, 74, 76, + 78, 80, 84, 87, 89, 92, 97, 99, 103, 105, + 107, 111, 115, 118, 120, 124, 126, 128, 135, 137, + 139, 140, 142, 147, 152, 156, 163, 165, 169, 171, + 175, 179, 181, 185, 187, 189, 191, 195, 201, 202, + 204, 206, 210, 213, 217, 222, 223, 225, 226, 233, + 235, 238, 240, 242, 245, 247, 251, 253, 257, 261, + 263, 265, 267, 272, 274, 278, 280, 284, 288, 290, + 294, 296, 300, 302, 304, 306, 308, 313, 314, 318, + 320, 322, 324, 326, 328, 330, 334, 336, 339, 341, + 343, 345, 347, 350, 353, 355, 357, 360, 363, 365, + 367, 369, 371, 374, 376, 379, 381, 383, 385, 387, + 389, 391, 393, 395, 397, 399, 401, 403, 405, 407, + 412, 417, 422, 427, 432, 434, 439, 440, 442, 444, + 446, 448, 450, 452, 457, 459, 462, 466, 468, 472, + 478, 480, 484, 486, 488, 492, 494, 498, 500, 504, + 506, 510, 515, 517, 519, 521, 524, 527, 531, 533, + 535, 537, 539, 541, 543, 545, 547, 549, 555, 557, + 561, 563, 567, 568, 570, 572, 574, 576, 578, 580, + 584, 589, 591, 595, 598, 602, 604, 608, 609, 611, + 613, 616, 618, 620, 621, 625, 628, 632, 634, 638, + 640, 645, 650, 652, 654, 656, 658, 659, 661, 663, + 666, 669, 671, 673, 675, 677, 679 +}; + +static const short yyrhs[] = { 114, + 0, 115, 0, 114, 115, 0, 207, 116, 34, 120, + 3, 21, 123, 38, 0, 0, 117, 0, 102, 118, + 103, 0, 102, 103, 0, 119, 0, 118, 119, 0, + 209, 0, 209, 104, 9, 105, 0, 9, 0, 0, + 121, 0, 122, 0, 121, 122, 0, 40, 82, 0, + 51, 82, 0, 20, 82, 0, 42, 52, 0, 0, + 124, 0, 125, 0, 124, 125, 0, 126, 0, 131, + 0, 137, 0, 161, 0, 134, 0, 169, 0, 53, + 127, 106, 0, 53, 45, 0, 128, 0, 127, 128, + 0, 129, 45, 207, 116, 0, 130, 0, 129, 107, + 130, 0, 207, 0, 209, 0, 41, 132, 106, 0, + 41, 17, 106, 0, 41, 106, 0, 133, 0, 132, + 107, 133, 0, 207, 0, 209, 0, 207, 135, 3, + 102, 136, 103, 0, 156, 0, 166, 0, 0, 177, + 0, 207, 3, 205, 85, 0, 207, 3, 205, 153, + 0, 207, 3, 143, 0, 207, 102, 138, 103, 3, + 153, 0, 139, 0, 138, 107, 139, 0, 207, 0, + 207, 108, 209, 0, 166, 108, 209, 0, 141, 0, + 140, 107, 141, 0, 155, 0, 209, 0, 152, 0, + 142, 107, 152, 0, 28, 102, 145, 103, 147, 0, + 0, 86, 0, 146, 0, 145, 107, 146, 0, 159, + 197, 0, 159, 153, 144, 0, 159, 159, 197, 144, + 0, 0, 148, 0, 0, 93, 80, 102, 149, 150, + 103, 0, 151, 0, 150, 151, 0, 4, 0, 159, + 0, 210, 153, 0, 154, 0, 155, 171, 197, 0, + 100, 0, 100, 109, 164, 0, 100, 109, 204, 0, + 168, 0, 169, 0, 170, 0, 207, 102, 140, 103, + 0, 156, 0, 55, 66, 156, 0, 11, 0, 11, + 110, 207, 0, 11, 110, 209, 0, 208, 0, 208, + 110, 157, 0, 158, 0, 157, 110, 158, 0, 160, + 0, 160, 0, 13, 0, 14, 0, 209, 135, 3, + 162, 0, 0, 102, 163, 165, 0, 5, 0, 7, + 0, 6, 0, 204, 0, 164, 0, 209, 0, 207, + 110, 209, 0, 4, 0, 165, 4, 0, 24, 0, + 61, 0, 74, 0, 167, 0, 65, 79, 0, 63, + 50, 0, 75, 0, 43, 0, 36, 69, 0, 26, + 79, 0, 89, 0, 46, 0, 56, 0, 39, 0, + 22, 79, 0, 166, 0, 167, 201, 0, 23, 0, + 47, 0, 48, 0, 49, 0, 57, 0, 62, 0, + 72, 0, 81, 0, 83, 0, 88, 0, 90, 0, + 91, 0, 92, 0, 64, 0, 27, 102, 142, 103, + 0, 76, 102, 142, 103, 0, 77, 102, 142, 103, + 0, 76, 171, 66, 155, 0, 77, 171, 66, 155, + 0, 18, 0, 18, 35, 25, 209, 0, 0, 175, + 0, 94, 0, 95, 0, 96, 0, 97, 0, 98, + 0, 78, 104, 177, 105, 0, 176, 0, 175, 176, + 0, 104, 177, 105, 0, 178, 0, 178, 107, 100, + 0, 178, 107, 100, 107, 178, 0, 100, 0, 100, + 107, 178, 0, 179, 0, 180, 0, 179, 172, 180, + 0, 181, 0, 180, 173, 181, 0, 182, 0, 181, + 174, 182, 0, 185, 0, 185, 183, 185, 0, 184, + 104, 177, 105, 0, 191, 0, 186, 0, 99, 0, + 99, 111, 0, 111, 99, 0, 111, 99, 111, 0, + 78, 0, 45, 0, 204, 0, 209, 0, 6, 0, + 59, 0, 58, 0, 44, 0, 84, 0, 93, 30, + 102, 187, 103, 0, 188, 0, 187, 107, 188, 0, + 100, 0, 209, 171, 189, 0, 0, 190, 0, 71, + 0, 15, 0, 67, 0, 192, 0, 193, 0, 102, + 207, 103, 0, 192, 102, 194, 103, 0, 195, 0, + 194, 107, 195, 0, 112, 196, 0, 112, 110, 196, + 0, 209, 0, 196, 110, 209, 0, 0, 198, 0, + 67, 0, 33, 199, 0, 185, 0, 166, 0, 0, + 102, 200, 165, 0, 102, 103, 0, 102, 202, 103, + 0, 203, 0, 202, 107, 203, 0, 209, 0, 209, + 104, 204, 105, 0, 209, 104, 164, 105, 0, 204, + 0, 100, 0, 9, 0, 10, 0, 0, 206, 0, + 101, 0, 101, 51, 0, 101, 40, 0, 11, 0, + 12, 0, 12, 0, 8, 0, 209, 0, 209, 206, + 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 297, 303, 309, 325, 350, 352, 355, 359, 364, 371, + 379, 384, 388, 397, 399, 407, 411, 419, 423, 426, + 429, 437, 439, 448, 452, 477, 481, 490, 497, 510, + 521, 534, 541, 546, 552, 558, 567, 573, 579, 586, + 594, 598, 601, 608, 614, 620, 627, 636, 646, 654, + 662, 664, 676, 688, 695, 711, 721, 731, 741, 746, + 753, 763, 769, 775, 779, 791, 797, 803, 813, 815, + 818, 826, 832, 841, 846, 863, 865, 870, 874, 879, + 884, 890, 894, 919, 926, 931, 939, 948, 957, 968, + 972, 978, 986, 1010, 1017, 1031, 1040, 1050, 1060, 1068, + 1089, 1098, 1107, 1108, 1110, 1117, 1129, 1139, 1141, 1146, + 1150, 1154, 1158, 1161, 1166, 1178, 1194, 1205, 1219, 1221, + 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, + 1237, 1239, 1240, 1243, 1250, 1262, 1264, 1268, 1272, 1273, + 1274, 1275, 1276, 1280, 1281, 1282, 1283, 1287, 1288, 1291, + 1298, 1304, 1310, 1318, 1326, 1332, 1348, 1350, 1353, 1353, + 1354, 1354, 1355, 1357, 1370, 1373, 1378, 1384, 1388, 1395, + 1403, 1408, 1417, 1419, 1421, 1426, 1428, 1434, 1436, 1441, + 1448, 1455, 1463, 1466, 1471, 1473, 1474, 1475, 1478, 1482, + 1487, 1491, 1502, 1506, 1511, 1516, 1521, 1528, 1534, 1538, + 1543, 1549, 1561, 1563, 1566, 1570, 1573, 1578, 1582, 1590, + 1605, 1611,