Fix masm build

- Fix masm operators and comments
- Add -DOPENSSL_NO_ASM only if not 64 bit build
- Add -DCMAKE_INSTALL_PREFIX to avoid build error
This commit is contained in:
kinichiro 2019-05-19 13:20:06 +09:00 committed by Brent Cook
parent c6f8ca2bc6
commit bbb662b69c
4 changed files with 19 additions and 5 deletions

View File

@ -289,7 +289,7 @@ if(ENABLE_ASM)
endif()
elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
set(HOST_ASM_MACOSX_X86_64 true)
elseif(MSVC AND "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "AMD64")
elseif(MSVC AND "${CMAKE_GENERATOR}" MATCHES "Win64")
# XXX Disabled for now, CMake's MASM support seems to either never
# build supply ASM or build it with the C compiler in a mode where it
# does not parse correctly. It might be easier to get NASM support working.

View File

@ -34,7 +34,7 @@ before_build:
- bash autogen.sh
- mkdir build
- cd build
- cmake .. -G "%GENERATOR%" -DBUILD_SHARED_LIBS=%SHARED_LIBS%
- cmake .. -G "%GENERATOR%" -DBUILD_SHARED_LIBS=%SHARED_LIBS% -DCMAKE_INSTALL_PREFIX=../local
build_script:
- cmake --build . --config %CONFIG%

View File

@ -920,7 +920,11 @@ endif()
if(NOT ENABLE_ASM)
add_definitions(-DOPENSSL_NO_ASM)
else()
if(WIN32)
if(MSVC)
if(NOT "${CMAKE_GENERATOR}" MATCHES "Win64")
add_definitions(-DOPENSSL_NO_ASM)
endif()
elseif(WIN32)
add_definitions(-DOPENSSL_NO_ASM)
endif()
endif()

View File

@ -168,7 +168,12 @@ gen_asm_stdout() {
#endif
EOF
if [ $1 = "masm" ]; then
cpp -I./crypto $3.tmp > $3
cpp -I./crypto $3.tmp \
| sed -e 's/^#/;/' \
| sed -e 's/|/OR/g' \
| sed -e 's/~/NOT/g' \
| sed -e 's/1 << \([0-9]*\)/1 SHL \1/g' \
> $3
else
$MV $3.tmp $3
fi
@ -181,7 +186,12 @@ gen_asm() {
#endif
EOF
if [ $1 = "masm" ]; then
cpp -I./crypto $3.tmp > $3
cpp -I./crypto $3.tmp \
| sed -e 's/^#/;/' \
| sed -e 's/|/OR/g' \
| sed -e 's/~/NOT/g' \
| sed -e 's/1 << \([0-9]*\)/1 SHL \1/g' \
> $3
else
$MV $3.tmp $3
fi