diff --git a/compiler2/makefile.c b/compiler2/makefile.c index fd73d975954dec295e46f6007f93d9a9dd8bc75f..ebf6c074f4ec541115bf0f2f47e323dd8f274ed3 100644 --- a/compiler2/makefile.c +++ b/compiler2/makefile.c @@ -269,6 +269,7 @@ struct makefile_struct { boolean activate_debugger; boolean ignore_untagged_on_top_union; boolean disable_predef_ext_folder; + boolean enable_legacy_encoding; struct string_list* solspeclibraries; /* not owned */ struct string_list* sol8speclibraries; /* not owned */ struct string_list* linuxspeclibraries; /* not owned */ @@ -338,6 +339,7 @@ static void init_makefile_struct(struct makefile_struct *makefile) makefile->activate_debugger = FALSE; makefile->ignore_untagged_on_top_union = FALSE; makefile->disable_predef_ext_folder = FALSE; + makefile->enable_legacy_encoding = FALSE; makefile->solspeclibraries = NULL; makefile->sol8speclibraries = NULL; makefile->linuxspeclibraries = NULL; @@ -2266,6 +2268,7 @@ static void print_makefile(struct makefile_struct *makefile) (makefile->warnings_for_bad_variants ? " -E" : ""), (makefile->activate_debugger ? " -n" : ""), (makefile->ignore_untagged_on_top_union ? " -N" : ""), + (makefile->enable_legacy_encoding ? " -e" : ""), (makefile->tcov_file_name ? makefile->tcov_file_name : ""), (makefile->profiled_file_list ? " -z $(PROFILED_FILE_LIST)" : ""), /* end of COMPILER FLAGS */ @@ -4647,8 +4650,9 @@ static void generate_makefile(size_t n_arguments, char *arguments[], boolean disablexer, boolean disablejson, boolean forcexerinasn, boolean defaultasomit, boolean gccmsgformat, boolean linenumbersonlymsg, boolean includesourceinfo, boolean addsourcelineinfo, boolean suppresswarnings, boolean outparamboundness, boolean omit_in_value_list, boolean warnings_for_bad_variants, boolean activate_debugger, - boolean ignore_untagged_on_top_union, boolean disable_predef_ext_folder, struct string_list* solspeclibraries, - struct string_list* sol8speclibraries, struct string_list* linuxspeclibraries, struct string_list* freebsdspeclibraries, + boolean ignore_untagged_on_top_union, boolean disable_predef_ext_folder, boolean enable_legacy_encoding, + struct string_list* solspeclibraries, struct string_list* sol8speclibraries, + struct string_list* linuxspeclibraries, struct string_list* freebsdspeclibraries, struct string_list* win32speclibraries, const char* ttcn3preprocessor, struct string_list* linkerlibraries, struct string_list* additionalObjects, struct string_list* linkerlibsearchpath, char* generatorCommandOutput, struct string2_list* target_placement_list) @@ -4701,6 +4705,7 @@ static void generate_makefile(size_t n_arguments, char *arguments[], makefile.activate_debugger = activate_debugger; makefile.ignore_untagged_on_top_union = ignore_untagged_on_top_union; makefile.disable_predef_ext_folder = disable_predef_ext_folder; + makefile.enable_legacy_encoding = enable_legacy_encoding; makefile.solspeclibraries = solspeclibraries; makefile.sol8speclibraries = sol8speclibraries; makefile.linuxspeclibraries = linuxspeclibraries; @@ -4921,6 +4926,7 @@ int main(int argc, char *argv[]) djflag = FALSE, Zflag = FALSE, Hflag = FALSE, Mflag = FALSE, diflag = FALSE, zflag = FALSE, Eflag = FALSE, nflag = FALSE, Nflag = FALSE; + boolean enable_legacy_encoding = FALSE; boolean error_flag = FALSE; char *output_file = NULL; char *ets_name = NULL; @@ -5357,7 +5363,8 @@ int main(int argc, char *argv[]) &Rflag, &lflag, &mflag, &Pflag, &Lflag, rflag, Fflag, Tflag, output_file, &abs_work_dir, sub_project_dirs, program_name, prj_graph_fp, create_symlink_list, ttcn3_prep_includes, ttcn3_prep_defines, ttcn3_prep_undefines, prep_includes, prep_defines, prep_undefines, &csmode, &quflag, &dsflag, &cxxcompiler, &optlevel, &optflags, &dbflag, &drflag, &dtflag, &dxflag, &djflag, &fxflag, &doflag, &gfflag, &lnflag, &isflag, - &asflag, &temp_wflag, &Yflag, &Mflag, &Eflag, &nflag, &Nflag, &diflag, solspeclibraries, sol8speclibraries, linuxspeclibraries, freebsdspeclibraries, win32speclibraries, &ttcn3prep, + &asflag, &temp_wflag, &Yflag, &Mflag, &Eflag, &nflag, &Nflag, &diflag, &enable_legacy_encoding, + solspeclibraries, sol8speclibraries, linuxspeclibraries, freebsdspeclibraries, win32speclibraries, &ttcn3prep, linkerlibraries, additionalObjects, linkerlibsearchpath, Vflag, Dflag, &Zflag, &Hflag, &generatorCommandOutput, target_placement_list, Wflag, run_command_list, required_configs, &profiled_file_list, search_paths, n_search_paths, &makefileScript); @@ -5404,8 +5411,9 @@ int main(int argc, char *argv[]) Rflag, lflag, mflag, Cflag, code_splitting_mode, tcov_file_name, profiled_file_list, file_list_file_name, Lflag, Zflag, Hflag, rflag ? sub_project_dirs : NULL, ttcn3_prep_includes, ttcn3_prep_defines, ttcn3_prep_undefines, prep_includes, prep_defines, prep_undefines, csmode, quflag, dsflag, cxxcompiler, optlevel, optflags, dbflag, - drflag, dtflag, dxflag, djflag, fxflag, doflag, gfflag, lnflag, isflag, asflag, wflag, Yflag, Mflag, Eflag, nflag, Nflag, diflag, solspeclibraries, - sol8speclibraries, linuxspeclibraries, freebsdspeclibraries, win32speclibraries, ttcn3prep, linkerlibraries, additionalObjects, + drflag, dtflag, dxflag, djflag, fxflag, doflag, gfflag, lnflag, isflag, asflag, wflag, Yflag, Mflag, Eflag, nflag, Nflag, diflag, + enable_legacy_encoding, solspeclibraries, sol8speclibraries, linuxspeclibraries, + freebsdspeclibraries, win32speclibraries, ttcn3prep, linkerlibraries, additionalObjects, linkerlibsearchpath, generatorCommandOutput, target_placement_list); if (makefileScript != NULL) { executeMakefileScript(makefileScript, output_file); diff --git a/compiler2/xpather.cc b/compiler2/xpather.cc index 6a31d7be105763aade03cfe89bd42c47ccd7899f..9caff3af1e157bad93865dcec3774835ad27a5f3 100644 --- a/compiler2/xpather.cc +++ b/compiler2/xpather.cc @@ -1269,7 +1269,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char* tpdName, c char** cxxcompiler, char** optlevel, char** optflags, boolean* p_dbflag, boolean* p_drflag, boolean* p_dtflag, boolean* p_dxflag, boolean* p_djflag, boolean* p_fxflag, boolean* p_doflag, boolean* p_gfflag, boolean* p_lnflag, boolean* p_isflag, boolean* p_asflag, boolean* p_swflag, boolean* p_Yflag, boolean* p_Mflag, boolean *p_Eflag, boolean* p_nflag, boolean* p_Nflag, - boolean* p_diflag, struct string_list* solspeclibs, struct string_list* sol8speclibs, + boolean* p_diflag, boolean* p_enable_legacy_encoding, struct string_list* solspeclibs, struct string_list* sol8speclibs, struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, char** ttcn3prep, struct string_list* linkerlibs, struct string_list* additionalObjects, struct string_list* linkerlibsearchp, boolean Vflag, boolean Dflag, boolean *p_Zflag, boolean *p_Hflag, char** generatorCommandOutput, struct string2_list* target_placement_list, boolean prefix_workdir, @@ -1289,7 +1289,7 @@ extern "C" tpd_result process_tpd(const char **p_tpd_name, const char *actcfg, char** cxxcompiler, char** optlevel, char** optflags, boolean* p_dbflag, boolean* p_drflag, boolean* p_dtflag, boolean* p_dxflag, boolean* p_djflag, boolean* p_fxflag, boolean* p_doflag, boolean* p_gfflag, boolean* p_lnflag, boolean* p_isflag, boolean* p_asflag, boolean* p_swflag, boolean* p_Yflag, boolean* p_Mflag, boolean* p_Eflag, boolean* p_nflag, boolean* p_Nflag, - boolean* p_diflag, struct string_list* solspeclibs, struct string_list* sol8speclibs, + boolean* p_diflag, boolean* p_enable_legacy_encoding, struct string_list* solspeclibs, struct string_list* sol8speclibs, struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, char** ttcn3prep, string_list* linkerlibs, string_list* additionalObjects, string_list* linkerlibsearchp, boolean Vflag, boolean Dflag, boolean *p_Zflag, boolean *p_Hflag, char** generatorCommandOutput, struct string2_list* target_placement_list, boolean prefix_workdir, @@ -1319,7 +1319,7 @@ extern "C" tpd_result process_tpd(const char **p_tpd_name, const char *actcfg, optlevel, optflags, p_dbflag, p_drflag, p_dtflag, p_dxflag, p_djflag, p_fxflag, p_doflag, p_gfflag, p_lnflag, p_isflag, p_asflag, p_swflag, p_Yflag, p_Mflag, p_Eflag, p_nflag, p_Nflag, - p_diflag, solspeclibs, sol8speclibs, + p_diflag, p_enable_legacy_encoding, solspeclibs, sol8speclibs, linuxspeclibs, freebsdspeclibs, win32speclibs, ttcn3prep, linkerlibs, additionalObjects, linkerlibsearchp, Vflag, Dflag, p_Zflag, p_Hflag, generatorCommandOutput, target_placement_list, prefix_workdir, @@ -1348,7 +1348,7 @@ extern "C" tpd_result process_tpd(const char **p_tpd_name, const char *actcfg, optlevel, optflags, p_dbflag, p_drflag, p_dtflag, p_dxflag, p_djflag, p_fxflag, p_doflag, p_gfflag, p_lnflag, p_isflag, p_asflag, p_swflag, p_Yflag, p_Mflag, p_Eflag, p_nflag, p_Nflag, - p_diflag, solspeclibs, sol8speclibs, + p_diflag, p_enable_legacy_encoding, solspeclibs, sol8speclibs, linuxspeclibs, freebsdspeclibs, win32speclibs, ttcn3prep, linkerlibs, additionalObjects, linkerlibsearchp, Vflag, Dflag, p_Zflag, p_Hflag, generatorCommandOutput, target_placement_list, prefix_workdir, @@ -1452,7 +1452,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c char** cxxcompiler, char** optlevel, char** optflags, boolean* p_dbflag, boolean* p_drflag, boolean* p_dtflag, boolean* p_dxflag, boolean* p_djflag, boolean* p_fxflag, boolean* p_doflag, boolean* p_gfflag, boolean* p_lnflag, boolean* p_isflag, boolean* p_asflag, boolean* p_swflag, boolean* p_Yflag, boolean* p_Mflag, boolean* p_Eflag, boolean* p_nflag, boolean* p_Nflag, - boolean* p_diflag, struct string_list* solspeclibs, struct string_list* sol8speclibs, + boolean* p_diflag, boolean* p_enable_legacy_encoding, struct string_list* solspeclibs, struct string_list* sol8speclibs, struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, char** ttcn3prep, string_list* linkerlibs, string_list* additionalObjects, string_list* linkerlibsearchp, boolean Vflag, boolean Dflag, boolean *p_Zflag, boolean *p_Hflag, char** generatorCommandOutput, struct string2_list* target_placement_list, boolean prefix_workdir, @@ -2057,6 +2057,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c xsdbool2boolean(xpathCtx, actcfg, "activateDebugger", p_nflag); xsdbool2boolean(xpathCtx, actcfg, "disablePredefinedExternalFolder", p_diflag); xsdbool2boolean(xpathCtx, actcfg, "ignoreUntaggedOnTopLevelUnion", p_Nflag); + xsdbool2boolean(xpathCtx, actcfg, "enableLegacyEncoding", p_enable_legacy_encoding); projDesc = projGenHelper.getTargetOfProject(*p_project_name); if (projDesc) projDesc->setLinkingStrategy(*p_lflag); @@ -2949,6 +2950,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c my_swflag = 0, my_Yflag = 0, my_Mflag = *p_Mflag, my_Eflag = 0, my_nflag = *p_nflag, my_Nflag = 0, my_diflag = *p_diflag; + boolean my_enable_legacy_encoding = 0; char *my_ets = NULL; char *my_proj_name = NULL; @@ -3001,7 +3003,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c &my_quflag, &my_dsflag, cxxcompiler, optlevel, optflags, &my_dbflag, &my_drflag, &my_dtflag, &my_dxflag, &my_djflag, &my_fxflag, &my_doflag, &my_gfflag, &my_lnflag, &my_isflag, &my_asflag, &my_swflag, &my_Yflag, &my_Mflag, &my_Eflag, &my_nflag, &my_Nflag, &my_diflag, - solspeclibs, sol8speclibs, linuxspeclibs, freebsdspeclibs, win32speclibs, + &my_enable_legacy_encoding, solspeclibs, sol8speclibs, linuxspeclibs, freebsdspeclibs, win32speclibs, ttcn3prep, linkerlibs, additionalObjects, linkerlibsearchp, Vflag, FALSE, &my_Zflag, &my_Hflag, NULL, NULL, prefix_workdir, run_command_list, seen_tpd_files, required_configs, profiled_file_list, search_paths, n_search_paths, makefileScript, all_configs); diff --git a/compiler2/xpather.h b/compiler2/xpather.h index 6a30d0b07c71781db228bc0bcc7f7f72516b4a50..813636d046703ba721d4e73e7d969d38437da9fd 100644 --- a/compiler2/xpather.h +++ b/compiler2/xpather.h @@ -287,7 +287,7 @@ tpd_result process_tpd(const char **p_tpd_name, const char *actcfg, boolean *disablejson, boolean *forcexerinasn, boolean *defaultasomit, boolean *gccmessageformat, boolean *linenumber, boolean *includesourceinfo, boolean *addsourcelineinfo, boolean *suppresswarnings, boolean *outparamboundness, boolean *omit_in_value_list, boolean *warnings_for_bad_variants, boolean *activate_debugger, boolean* ignore_untagged_union, - boolean *disable_predef_exp_folder, struct string_list* solspeclibs, struct string_list* sol8speclibs, + boolean *disable_predef_exp_folder, boolean* enable_legacy_encoding, struct string_list* solspeclibs, struct string_list* sol8speclibs, struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, char** ttcn3preprocessor, struct string_list* linkerlibs, struct string_list* additionalObjects, struct string_list* linkerlibsearchpath, boolean Vflag, boolean Dflag, boolean *Zflag, boolean *Hflag, char** generatorCommandOutput, struct string2_list* target_placement_list, boolean prefix_workdir, struct string2_list* run_command_list, diff --git a/etc/xsd/TPD.xsd b/etc/xsd/TPD.xsd index 22291759f58a713870d09b5f0b25379b0fbd5d91..3a8704a46d61b961aa5481b56b4b17701aa78305 100644 --- a/etc/xsd/TPD.xsd +++ b/etc/xsd/TPD.xsd @@ -133,6 +133,7 @@ <xs:element name="ignoreUntaggedOnTopLevelUnion" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="activateDebugger" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="quietly" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="enableLegacyEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="namingRules" minOccurs="0" maxOccurs="1" type="xs:normalizedString" /> <xs:element name="disableSubtypeChecking" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="CxxCompiler" minOccurs="0" maxOccurs="1" type="xs:normalizedString" /> diff --git a/regression_test/compileonly/languageSpec/.gitignore b/regression_test/compileonly/languageSpec/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0edf227b396face748ff50f28df7a2f13a0c10f2 --- /dev/null +++ b/regression_test/compileonly/languageSpec/.gitignore @@ -0,0 +1,7 @@ +*.o +compile +LanguageSpec.exe +LanguageSpec +LanguageSpec*.cc +LanguageSpec*.hh +bin/ diff --git a/regression_test/compileonly/mfgen-tpd/Makefile b/regression_test/compileonly/mfgen-tpd/Makefile index 51ec56f6086bffecfc242d32a2bf9569eb090a42..0381b6184471de5b669cdfe3fbaf77a9cbbba125 100644 --- a/regression_test/compileonly/mfgen-tpd/Makefile +++ b/regression_test/compileonly/mfgen-tpd/Makefile @@ -32,7 +32,7 @@ MAKEPROG := ${MAKE} DIRLIST := buildconfig_param invalid_buildconfig_param invalid_buildconfig_tpd \ HP79745 HQ56829 HQ56834 HQ56848 library HR30356 flagTest HR30365 dependency_check \ required_config required_config_v2 disablePredefinedExternalFolder \ - makefileScript diff_tpd_name_error + makefileScript diff_tpd_name_error enable_legacy_encoding ifdef DYN DIRS += required_config_v3 splitting compile_once diff --git a/regression_test/compileonly/mfgen-tpd/enable_legacy_encoding/.gitignore b/regression_test/compileonly/mfgen-tpd/enable_legacy_encoding/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f6fc81065bc4adef1cf0824a65310d53348e079c --- /dev/null +++ b/regression_test/compileonly/mfgen-tpd/enable_legacy_encoding/.gitignore @@ -0,0 +1,3 @@ +bin/ +bin2/ +bin3/ diff --git a/regression_test/compileonly/mfgen-tpd/enable_legacy_encoding/Makefile b/regression_test/compileonly/mfgen-tpd/enable_legacy_encoding/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..6c4ea2a265043ff0eb233944f74180dacadcd50d --- /dev/null +++ b/regression_test/compileonly/mfgen-tpd/enable_legacy_encoding/Makefile @@ -0,0 +1,62 @@ +############################################################################## +# Copyright (c) 2000-2017 Ericsson Telecom AB +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Szabo, Bence Janos +# +############################################################################## +TOPDIR := ../../.. +include $(TOPDIR)/Makefile.regression + +ifdef LCOV +COVERAGE_FLAG := -C +endif + +# ${MAKEPROG} has the same content as the built-in ${MAKE}, +# except the special handling of ${MAKE} does not apply. +# If we used ${MAKE} in the rules below, 'make -n' would succeed once, +# then fail on every subsequent invocation until a 'make clean' is done. + +MAKEPROG := ${MAKE} + +all: CheckTpdTrue CheckTpdFalse CheckTpdMissing + +BuildTpdTrue: + $(TTCN3_DIR)/bin/ttcn3_makefilegen -f $(MFGEN_FLAGS) $(COVERAGE_FLAG) \ + -t a.tpd + +CheckTpdTrue: BuildTpdTrue + if [ ! -f "./bin/Makefile" ] \ + || [ `grep -c "COMPILER_FLAGS = -L -e" ./bin/Makefile` -ne 1 ]; \ + then echo "Makefilegen enable_legacy_encoding test: Overall verdict: fail" && exit 1; fi + +BuildTpdFalse: + $(TTCN3_DIR)/bin/ttcn3_makefilegen -f $(MFGEN_FLAGS) $(COVERAGE_FLAG) \ + -t a.tpd -b False + +CheckTpdFalse: BuildTpdFalse + if [ ! -f "./bin2/Makefile" ] \ + || [ `grep -c "COMPILER_FLAGS = -L -e" ./bin2/Makefile` -ne 0 ]; \ + then echo "Makefilegen enable_legacy_encoding test: Overall verdict: fail" && exit 1; fi + +BuildTpdMissing: + $(TTCN3_DIR)/bin/ttcn3_makefilegen -f $(MFGEN_FLAGS) $(COVERAGE_FLAG) \ + -t a.tpd -b Missing + +CheckTpdMissing: BuildTpdMissing + if [ ! -f "./bin3/Makefile" ] \ + || [ `grep -c "COMPILER_FLAGS = -L -e" ./bin3/Makefile` -ne 0 ]; \ + then echo "Makefilegen enable_legacy_encoding test: Overall verdict: fail" && exit 1; fi + +clean: + -rm -rf bin bin2 bin3 + +distclean: clean + -rm -f *.out + +.PHONY: all clean distclean CheckTpdTrue CheckTpdFalse CheckTpdMissing BuildTpdTrue BuildTpdFalse BuildTpdMissing + diff --git a/regression_test/compileonly/mfgen-tpd/enable_legacy_encoding/a.tpd b/regression_test/compileonly/mfgen-tpd/enable_legacy_encoding/a.tpd new file mode 100644 index 0000000000000000000000000000000000000000..aed5bd7d920f439ae64f50dca51fbe13a2d80775 --- /dev/null +++ b/regression_test/compileonly/mfgen-tpd/enable_legacy_encoding/a.tpd @@ -0,0 +1,51 @@ +<!-- + Copyright (c) 2000-2017 Ericsson Telecom AB + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Public License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html + + Contributors: + Szabo, Bence Janos – initial implementation +--> +<TITAN_Project_File_Information version="1.0"> + <ProjectName>a</ProjectName> + <ActiveConfiguration>Default</ActiveConfiguration> + <Configurations> + <Configuration name="Default"> + <ProjectProperties> + <MakefileSettings> + <GNUMake>true</GNUMake> + <targetExecutable>bin</targetExecutable> + <enableLegacyEncoding>true</enableLegacyEncoding> + </MakefileSettings> + <LocalBuildSettings> + <workingDirectory>bin</workingDirectory> + </LocalBuildSettings> + </ProjectProperties> + </Configuration> + <Configuration name="False"> + <ProjectProperties> + <MakefileSettings> + <GNUMake>true</GNUMake> + <targetExecutable>bin2</targetExecutable> + <enableLegacyEncoding>false</enableLegacyEncoding> + </MakefileSettings> + <LocalBuildSettings> + <workingDirectory>bin2</workingDirectory> + </LocalBuildSettings> + </ProjectProperties> + </Configuration> + <Configuration name="Missing"> + <ProjectProperties> + <MakefileSettings> + <GNUMake>true</GNUMake> + <targetExecutable>bin3</targetExecutable> + </MakefileSettings> + <LocalBuildSettings> + <workingDirectory>bin3</workingDirectory> + </LocalBuildSettings> + </ProjectProperties> + </Configuration> + </Configurations> +</TITAN_Project_File_Information> diff --git a/usrguide/referenceguide.doc b/usrguide/referenceguide.doc index cbb5552312f874141151ce7f0f92d61abd22f49c..265ceb3979ed8de9c9639320e5b4bde3b1d7ba8a 100644 Binary files a/usrguide/referenceguide.doc and b/usrguide/referenceguide.doc differ