Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 06cea20

Browse files
adeas31OpenModelica-Hudson
authored andcommitted
configure option for encryption
Belonging to [master]: - #2197
1 parent 081af3b commit 06cea20

File tree

5 files changed

+32
-8
lines changed

5 files changed

+32
-8
lines changed

Compiler/Script/CevalScriptBackend.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3471,7 +3471,7 @@ algorithm
34713471
pd := System.pathDelimiter();
34723472
str1 := if System.os() == "Windows_NT" then ".exe" else "";
34733473
// create the path till packagetool
3474-
str2 := stringAppendList({omhome,pd,"bin",pd,"packagetool",str1});
3474+
str2 := stringAppendList({omhome,pd,"lib",pd,"omc",pd,"SEMLA",pd,"packagetool",str1});
34753475
if System.regularFileExists(str2) then
34763476
// create the list of arguments for packagetool
34773477
str3 := "-librarypath \"" + System.dirname(fileName) + "\" -version \"1.0\" -language \"3.2\" -encrypt \"true\"";
@@ -3492,7 +3492,7 @@ algorithm
34923492
commandOutput := System.readFile(logFile);
34933493
end if;
34943494
else
3495-
Error.addMessage(Error.FILE_NOT_FOUND_ERROR, {str2});
3495+
Error.addMessage(Error.ENCRYPTION_NOT_SUPPORTED, {str2});
34963496
commandOutput := "";
34973497
success := false;
34983498
end if;

Compiler/Util/Error.mo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,8 @@ public constant Message DEPRECATED_API_CALL = MESSAGE(7016, SCRIPTING(), WARNING
10661066
Util.gettext("'%1' is deprecated. It is recommended to use '%2' instead."));
10671067
public constant Message CONFLICTING_ALIAS_SET = MESSAGE(7017, SYMBOLIC(), WARNING(),
10681068
Util.gettext("The model contains alias variables with conflicting start and/or nominal values. It is recommended to resolve the conflicts, because otherwise the system could be hard to solve. To print the conflicting alias sets and the chosen candidates please use -d=aliasConflicts."));
1069+
public constant Message ENCRYPTION_NOT_SUPPORTED = MESSAGE(7018, SCRIPTING(), ERROR(),
1070+
Util.gettext("File not Found: %s. Compile OpenModelica with Encryption support."));
10691071

10701072
protected import ErrorExt;
10711073

Makefile.common

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,23 @@ INSTALL_LOCALEDIR = ${DESTDIR}${datadir}/locale
2727

2828
.PHONY : interactive omc release all mkbuilddirs fmi test install-dirs susan susan_all susgen sustst install-openturns runtimeCPPinstall CMinpack metis Cdaskr boehm-gc libzmq $(MINGW_EXTRA_LIBS)
2929

30-
ifeq ($(OMENCRYPTION),ON)
31-
.PHONY : semla
30+
ifeq ($(OMENCRYPTION),yes)
31+
.PHONY : semla semla-clean
3232
CPPFLAGS=-DOMENCRYPTION
3333

3434
semla: mkbuilddirs
3535
mkdir -p ../SEMLA/build
3636
(cd ../SEMLA/build && test -f Makefile || $(CMAKE) -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DCMAKE_INSTALL_PREFIX:String=../install ../src -G $(CMAKE_TARGET))
3737
(cd ../SEMLA/build && $(CMAKE) --build .)
3838
(cd ../SEMLA/build && $(CMAKE) --build . --target install)
39-
cp -pPR ../SEMLA/install/bin/* $(builddir_bin)
40-
cp -pPR ../SEMLA/install/lib/* $(builddir_lib_omc)
41-
mkdir -p $(builddir_bin)/LVE
42-
mv $(builddir_bin)/lve.exe $(builddir_bin)/LVE/lve_win64.exe
39+
mkdir -p $(builddir_lib)/omc/SEMLA/LVE
40+
cp -pPR ../SEMLA/install/bin/* $(builddir_lib)/omc/SEMLA
41+
cp -pPR ../SEMLA/install/lib/* $(builddir_lib)/omc/SEMLA
42+
mv $(builddir_lib)/omc/SEMLA/lve$(EXE) $(builddir_lib)/omc/SEMLA/LVE/lve_$(LVE_EXE_SUFFIX)$(EXE)
43+
44+
semla-clean:
45+
#rm -rf ../SEMLA/build
46+
#rm -rf ../SEMLA/install
4347
endif # end of OMENCRYPTION
4448

4549
mkbuilddirs:

Makefile.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ LIBMODELICASTANDARDTABLES=@OMBUILDDIR@/lib/@host_short@/omc/libModelicaStandardT
6666
LIBMODELICAZLIB=@OMBUILDDIR@/lib/@host_short@/omc/libzlib@SHREXT@
6767
LIBMODELICAIO=@OMBUILDDIR@/lib/@host_short@/omc/libModelicaIO@SHREXT@
6868
LIBMODELICAMATIO=@OMBUILDDIR@/lib/@host_short@/omc/libModelicaMatIO@SHREXT@
69+
OMENCRYPTION=@OMENCRYPTION@
70+
LVE_EXE_SUFFIX=@MODELICA_SPEC_PLATFORM@
6971

7072
SUITESPARSE_LIBS = -DKLU_LIBRARY="libklu$(SHREXT)" -DAMD_LIBRARY="libamd$(SHREXT)" -DCOLAMD_LIBRARY="libcolamd$(SHREXT)" -DBTF_LIBRARY="libbtf$(SHREXT)"
7173

@@ -75,7 +77,11 @@ include Makefile.common
7577
.testvariables:
7678
settings:
7779

80+
ifeq ($(OMENCRYPTION),yes)
81+
omc: omc-bootstrapped semla
82+
else
7883
omc: omc-bootstrapped
84+
endif
7985

8086
boehm-gc-lib: @LIBGC@
8187
$(OMBUILDDIR)/$(LIB_OMC)/libomcgc.so: 3rdParty/gc/.libs/libomcgc.so

configure.ac

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ AC_SUBST(LIBDL)
9494
AC_SUBST(BOOST_INCLUDE)
9595
AC_SUBST(LDFLAGS_LIBSTDCXX)
9696
AC_SUBST(CPP_RUNTIME_ARGS)
97+
AC_SUBST(OMENCRYPTION)
9798

9899
FINAL_MESSAGES="\nConfigured OpenModelica successfully using the following options:"
99100

@@ -780,6 +781,17 @@ AC_ARG_WITH(PATOH, [ --with-PATOH=DIR Compile with PATOH hyperg
780781
USE_PATOH=0;
781782
])
782783

784+
AC_ARG_WITH(ENCRYPTION, [ --with-ENCRYPTION Compile SEMLA and link omc to it],
785+
[
786+
if test "$withval" = "yes"; then
787+
OMENCRYPTION=yes
788+
else
789+
OMENCRYPTION=no
790+
fi
791+
], [
792+
OMENCRYPTION=no
793+
])
794+
783795
m4_include([common/m4/semver.m4])
784796

785797
SOURCE_REVISION="$SOURCE_REVISION$NON_FREE_VERSION"

0 commit comments

Comments
 (0)