diff --git a/compiler2/makefile.c b/compiler2/makefile.c index 858faf548cc80f420b3be2c2a835c06586d9b80e..bb86ec88021172e6a6dcd4dae9b771c5cd20e64d 100644 --- a/compiler2/makefile.c +++ b/compiler2/makefile.c @@ -271,6 +271,7 @@ struct makefile_struct { boolean ignore_untagged_on_top_union; boolean disable_predef_ext_folder; boolean enable_legacy_encoding; + boolean disable_userinfo; struct string_list* solspeclibraries; /* not owned */ struct string_list* sol8speclibraries; /* not owned */ struct string_list* linuxspeclibraries; /* not owned */ @@ -341,6 +342,7 @@ static void init_makefile_struct(struct makefile_struct *makefile) makefile->ignore_untagged_on_top_union = FALSE; makefile->disable_predef_ext_folder = FALSE; makefile->enable_legacy_encoding = FALSE; + makefile->disable_userinfo = FALSE; makefile->solspeclibraries = NULL; makefile->sol8speclibraries = NULL; makefile->linuxspeclibraries = NULL; @@ -2231,7 +2233,7 @@ static void print_makefile(struct makefile_struct *makefile) "AR = ar\n" "ARFLAGS = \n\n" "# Flags for the TTCN-3 and ASN.1 compiler:\n" - "COMPILER_FLAGS =%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n\n" + "COMPILER_FLAGS =%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n\n" "# Execution mode: (either ttcn3 or ttcn3-parallel)\n" "TTCN3_LIB = ttcn3%s%s%s\n\n" #ifdef LICENSE @@ -2275,6 +2277,7 @@ static void print_makefile(struct makefile_struct *makefile) (makefile->enable_legacy_encoding ? " -e" : ""), (makefile->tcov_file_name ? makefile->tcov_file_name : ""), (makefile->profiled_file_list ? " -z $(PROFILED_FILE_LIST)" : ""), + (makefile->disable_userinfo ? " -D" : ""), /* end of COMPILER FLAGS */ (makefile->use_runtime_2 ? "-rt2" : ""), /* TTCN3_LIB */ (makefile->single_mode ? "" : "-parallel"), @@ -4654,7 +4657,7 @@ static void generate_makefile(size_t n_arguments, char *arguments[], boolean disablexer, boolean disablejson, boolean disableoer, 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, boolean enable_legacy_encoding, + boolean ignore_untagged_on_top_union, boolean disable_predef_ext_folder, boolean enable_legacy_encoding, boolean disable_userinfo, 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, @@ -4711,6 +4714,7 @@ static void generate_makefile(size_t n_arguments, char *arguments[], 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.disable_userinfo = disable_userinfo; makefile.solspeclibraries = solspeclibraries; makefile.sol8speclibraries = sol8speclibraries; makefile.linuxspeclibraries = linuxspeclibraries; @@ -4931,7 +4935,7 @@ int main(int argc, char *argv[]) Sflag = FALSE, Vflag = FALSE, Dflag = FALSE, Wflag = FALSE, djflag = FALSE, doerflag = FALSE, Zflag = FALSE, Hflag = FALSE, Mflag = FALSE, diflag = FALSE, zflag = FALSE, Eflag = FALSE, nflag = FALSE, - Nflag = FALSE, Gflag = FALSE; + Nflag = FALSE, Gflag = FALSE, duflag = FALSE; boolean error_flag = FALSE; char *output_file = NULL; char *ets_name = NULL; @@ -5371,7 +5375,7 @@ 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, &doerflag, &fxflag, &doflag, &gfflag, &lnflag, &isflag, - &asflag, &temp_wflag, &Yflag, &Mflag, &Eflag, &nflag, &Nflag, &diflag, &Gflag, + &asflag, &temp_wflag, &Yflag, &Mflag, &Eflag, &nflag, &Nflag, &diflag, &Gflag, &duflag, 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); @@ -5420,7 +5424,7 @@ int main(int argc, char *argv[]) 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, doerflag, fxflag, doflag, gfflag, lnflag, isflag, asflag, wflag, Yflag, Mflag, Eflag, nflag, Nflag, diflag, - Gflag, solspeclibraries, sol8speclibraries, linuxspeclibraries, + Gflag, duflag, solspeclibraries, sol8speclibraries, linuxspeclibraries, freebsdspeclibraries, win32speclibraries, ttcn3prep, linkerlibraries, additionalObjects, linkerlibsearchpath, generatorCommandOutput, target_placement_list); if (makefileScript != NULL) { diff --git a/compiler2/xpather.cc b/compiler2/xpather.cc index 7c3da621dd8ff948f773792875ef5dc811dedf03..7c0f0bc5bca3e960bc8d03462350998d33524865 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_doerflag, 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, boolean* p_enable_legacy_encoding, struct string_list* solspeclibs, struct string_list* sol8speclibs, + boolean* p_diflag, boolean* p_enable_legacy_encoding, boolean* p_disable_userinfo, 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_doerflag, 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, boolean* p_enable_legacy_encoding, struct string_list* solspeclibs, struct string_list* sol8speclibs, + boolean* p_diflag, boolean* p_enable_legacy_encoding, boolean* p_disable_userinfo, 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_doerflag, 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, p_enable_legacy_encoding, solspeclibs, sol8speclibs, + p_diflag, p_enable_legacy_encoding, p_disable_userinfo, 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_doerflag, 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, p_enable_legacy_encoding, solspeclibs, sol8speclibs, + p_diflag, p_enable_legacy_encoding, p_disable_userinfo, 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_doerflag, 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, boolean* p_enable_legacy_encoding, struct string_list* solspeclibs, struct string_list* sol8speclibs, + boolean* p_diflag, boolean* p_enable_legacy_encoding, boolean* p_disable_userinfo, 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, @@ -2059,6 +2059,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c xsdbool2boolean(xpathCtx, actcfg, "disablePredefinedExternalFolder", p_diflag); xsdbool2boolean(xpathCtx, actcfg, "ignoreUntaggedOnTopLevelUnion", p_Nflag); xsdbool2boolean(xpathCtx, actcfg, "enableLegacyEncoding", p_enable_legacy_encoding); + xsdbool2boolean(xpathCtx, actcfg, "disableUserInformation", p_disable_userinfo); projDesc = projGenHelper.getTargetOfProject(*p_project_name); if (projDesc) projDesc->setLinkingStrategy(*p_lflag); @@ -2950,7 +2951,8 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c my_gfflag = 0, my_lnflag = 0, my_isflag = 0, my_asflag = 0, my_swflag = 0, my_Yflag = 0, my_Mflag = *p_Mflag, my_Eflag = 0, my_nflag = *p_nflag, my_Nflag = 0, - my_diflag = *p_diflag; + my_diflag = *p_diflag, + my_duflag = 0; boolean my_enable_legacy_encoding = 0; char *my_ets = NULL; @@ -3004,7 +3006,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_doerflag, &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, - &my_enable_legacy_encoding, solspeclibs, sol8speclibs, linuxspeclibs, freebsdspeclibs, win32speclibs, + &my_enable_legacy_encoding, &my_duflag, 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 ac68e20bcd44f0ecd04ed5bd8f42b470c23b0e1f..0e1c7c75e0c885fb613a2d7c152cb45044737a9c 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 *disableoer, 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, boolean* enable_legacy_encoding, struct string_list* solspeclibs, struct string_list* sol8speclibs, + boolean *disable_predef_exp_folder, boolean* enable_legacy_encoding, boolean* disable_userinfo, 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 7eb9ecc86953d7e06bca2884cc33f345351169df..2e38bea543819077a74ebb5d627aada14601dd4c 100644 --- a/etc/xsd/TPD.xsd +++ b/etc/xsd/TPD.xsd @@ -135,6 +135,7 @@ <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="disableUserInformation" 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/mfgen-tpd/Makefile b/regression_test/compileonly/mfgen-tpd/Makefile index d4bf30c5276fcae0a275608dfd01b0911740619b..31b1ac989db07636e0bfa6a8d3d830733a41c3ed 100644 --- a/regression_test/compileonly/mfgen-tpd/Makefile +++ b/regression_test/compileonly/mfgen-tpd/Makefile @@ -32,7 +32,8 @@ 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 enable_legacy_encoding disable_oer + makefileScript diff_tpd_name_error enable_legacy_encoding disable_oer \ + disableUserInformation ifdef DYN DIRS += required_config_v3 splitting compile_once diff --git a/regression_test/compileonly/mfgen-tpd/disableUserInformation/.gitignore b/regression_test/compileonly/mfgen-tpd/disableUserInformation/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f6fc81065bc4adef1cf0824a65310d53348e079c --- /dev/null +++ b/regression_test/compileonly/mfgen-tpd/disableUserInformation/.gitignore @@ -0,0 +1,3 @@ +bin/ +bin2/ +bin3/ diff --git a/regression_test/compileonly/mfgen-tpd/disableUserInformation/Makefile b/regression_test/compileonly/mfgen-tpd/disableUserInformation/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..69362e4ea90be39ccb95ba2b4da8a50dab0ca00c --- /dev/null +++ b/regression_test/compileonly/mfgen-tpd/disableUserInformation/Makefile @@ -0,0 +1,64 @@ +############################################################################## +# Copyright (c) 2018 Semihalf sp. z o.o. +# 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: +# Klimkowicz, Jacek +# +############################################################################## +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: CheckTpd CheckTpdTrue CheckTpdFalse + +BuildTpd: + $(TTCN3_DIR)/bin/ttcn3_makefilegen -f $(MFGEN_FLAGS) $(COVERAGE_FLAG) \ + -t a.tpd + +CheckTpd: BuildTpd + if [ ! -f "./bin/Makefile" ] \ + || [ `grep -c "COMPILER_FLAGS =.*-D" ./bin/Makefile` -ne 0 ]; \ + then echo "Makefilegen disableUserInformation test: Overall verdict: fail" && exit 1; fi + +BuildTpdTrue: + $(TTCN3_DIR)/bin/ttcn3_makefilegen -f $(MFGEN_FLAGS) $(COVERAGE_FLAG) \ + -t a.tpd -b True + +CheckTpdTrue: BuildTpdTrue + if [ ! -f "./bin2/Makefile" ] \ + || [ `grep -c "COMPILER_FLAGS =.*-D" ./bin2/Makefile` -ne 1 ]; \ + then echo "Makefilegen disableUserInformation 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 "./bin3/Makefile" ] \ + || [ `grep -c "COMPILER_FLAGS =.*-D" ./bin3/Makefile` -ne 0 ]; \ + then echo "Makefilegen disableUserInformation test: Overall verdict: fail" && exit 1; fi + + + +clean: + -rm -rf bin bin2 bin3 + +distclean: clean + -rm -f *.out + +.PHONY: all clean distclean CheckTpd CheckTpdTrue CheckTpdFalse BuildTpd BuildTpdTrue BuildTpdFalse + diff --git a/regression_test/compileonly/mfgen-tpd/disableUserInformation/a.tpd b/regression_test/compileonly/mfgen-tpd/disableUserInformation/a.tpd new file mode 100644 index 0000000000000000000000000000000000000000..86356625a5f7428d3a1d38ff4620807c6718faeb --- /dev/null +++ b/regression_test/compileonly/mfgen-tpd/disableUserInformation/a.tpd @@ -0,0 +1,51 @@ +<!-- + Copyright (c) 2018 Semihalf sp. z o.o. + 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: + Klimkowicz, Jacek +--> +<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> + </MakefileSettings> + <LocalBuildSettings> + <workingDirectory>bin</workingDirectory> + </LocalBuildSettings> + </ProjectProperties> + </Configuration> + <Configuration name="True"> + <ProjectProperties> + <MakefileSettings> + <GNUMake>true</GNUMake> + <targetExecutable>bin2</targetExecutable> + <disableUserInformation>true</disableUserInformation> + </MakefileSettings> + <LocalBuildSettings> + <workingDirectory>bin2</workingDirectory> + </LocalBuildSettings> + </ProjectProperties> + </Configuration> + <Configuration name="False"> + <ProjectProperties> + <MakefileSettings> + <GNUMake>true</GNUMake> + <targetExecutable>bin3</targetExecutable> + <disableUserInformation>false</disableUserInformation> + </MakefileSettings> + <LocalBuildSettings> + <workingDirectory>bin3</workingDirectory> + </LocalBuildSettings> + </ProjectProperties> + </Configuration> + </Configurations> +</TITAN_Project_File_Information>