diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/build-data/cc/msvc.txt | 18 | ||||
-rw-r--r-- | src/build-data/innosetup.in | 61 | ||||
-rw-r--r-- | src/build-data/makefile/nmake.in | 17 | ||||
-rw-r--r-- | src/build-data/makefile/unix.in | 32 | ||||
-rw-r--r-- | src/build-data/makefile/unix_shr.in | 32 | ||||
-rw-r--r-- | src/engine/simd_engine/simd_engine.cpp | 4 | ||||
-rw-r--r-- | src/hash/sha1_sse2/sha1_sse2.h | 2 | ||||
-rw-r--r-- | src/utils/simd_32/simd_altivec.h | 2 | ||||
-rw-r--r-- | src/utils/simd_32/simd_scalar.h | 2 | ||||
-rw-r--r-- | src/utils/simd_32/simd_sse.h | 2 |
10 files changed, 96 insertions, 76 deletions
diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt index 278aaadf4..892e80c4b 100644 --- a/src/build-data/cc/msvc.txt +++ b/src/build-data/cc/msvc.txt @@ -1,6 +1,6 @@ macro_name MSVC -binary_name cl.exe +binary_name cl compile_option "/nologo /c " output_to_option "/Fo" @@ -8,17 +8,16 @@ add_include_dir_option "/I" add_lib_dir_option -L add_lib_option "" -lib_opt_flags "/O2" -shared_flags "/DBOTAN_DLL=__declspec(dllexport)" -check_opt_flags "/O2" -debug_flags "/Zi" -no_debug_flags "" -lang_flags "/EHsc /GR /D_CONSOLE" +no_debug_flags "/O2" +debug_flags "/Od /Zi /DDEBUG" +check_opt_flags "/O2 /D_CONSOLE" +lang_flags "/EHsc /GR" warning_flags "" +shared_flags "/DBOTAN_DLL=__declspec(dllexport)" dll_import_flags "__declspec(dllimport)" -ar_command "lib" +ar_command lib makefile_style nmake @@ -27,5 +26,6 @@ default -> "$(CXX) /LD" </so_link_flags> <mach_abi_linking> -all -> "/MD" +all -> "/MD" +all-debug -> "/MDd" </mach_abi_linking> diff --git a/src/build-data/innosetup.in b/src/build-data/innosetup.in index ffe780979..228ab4e97 100644 --- a/src/build-data/innosetup.in +++ b/src/build-data/innosetup.in @@ -5,10 +5,15 @@ AppName=Botan AppVerName=Botan %{version} AppPublisher=Jack Lloyd -AppCopyright=Copyright (C) 1999-2009 Jack Lloyd and others AppPublisherURL=http://botan.randombit.net/ AppVersion=%{version} +VersionInfoCopyright=Copyright (C) 1999-2009 Jack Lloyd and others +VersionInfoVersion=%{version}.0 + +; Require at least Windows 98 or 2000 +MinVersion=4.1,5.0 + DefaultDirName={pf}\botan DefaultGroupName=botan @@ -17,9 +22,53 @@ SolidCompression=yes OutputDir=. OutputBaseFilename=botan-%{version} +[Types] +Name: "user"; Description: "User" +Name: "devel"; Description: "Developer" +Name: "custom"; Description: "Custom"; Flags: iscustom + +[Components] +name: "dll"; Description: "Runtime DLLs"; Types: user devel custom; Flags: fixed +name: "implib"; Description: "Import Library"; Types: devel +name: "includes"; Description: "Include Files"; Types: devel +name: "docs"; Description: "Developer Documentation"; Types: devel + [Files] -Source: "..\botan.dll"; DestDir: "{app}" -Source: "..\botan.dll.manifest"; DestDir: "{app}" -Source: "..\botan.exp"; DestDir: "{app}" -Source: "..\botan.lib"; DestDir: "{app}" -Source: "include\botan\*"; DestDir: "{app}\include\botan" +; DLL and license file is always included +Source: "..\doc\license.txt"; DestDir: "{app}"; Components: dll; AfterInstall: ConvertLineEndings +Source: "..\botan.dll"; DestDir: "{app}"; Components: dll +Source: "..\botan.dll.manifest"; DestDir: "{app}"; Components: dll + +Source: "include\botan\*"; DestDir: "{app}\include\botan"; Components: includes; AfterInstall: ConvertLineEndings + +Source: "..\readme.txt"; DestDir: "{app}\doc"; Components: docs; AfterInstall: ConvertLineEndings +Source: "..\doc\log.txt"; DestDir: "{app}\doc"; Components: docs; AfterInstall: ConvertLineEndings + +Source: "..\doc\examples\*.cpp"; DestDir: "{app}\doc\examples"; Components: docs; AfterInstall: ConvertLineEndings + +Source: "..\botan.exp"; DestDir: "{app}"; Components: implib +Source: "..\botan.lib"; DestDir: "{app}"; Components: implib + +Source: "..\doc\api.pdf"; DestDir: "{app}\doc"; Components: docs; Flags: skipifsourcedoesntexist +Source: "..\doc\tutorial.pdf"; DestDir: "{app}\doc"; Components: docs; Flags: skipifsourcedoesntexist + +[Code] +const + LF = #10; + CR = #13; + CRLF = CR + LF; + +procedure ConvertLineEndings(); + var + FilePath : String; + FileContents : String; +begin + FilePath := ExpandConstant(CurrentFileName) + + if ExtractFileName(CurrentFileName) <> 'build.h' then + begin + LoadStringFromFile(FilePath, FileContents); + StringChangeEx(FileContents, LF, CRLF, False); + SaveStringToFile(FilePath, FileContents, False); + end; +end; diff --git a/src/build-data/makefile/nmake.in b/src/build-data/makefile/nmake.in index 2604a3459..79b80745c 100644 --- a/src/build-data/makefile/nmake.in +++ b/src/build-data/makefile/nmake.in @@ -6,7 +6,7 @@ MACH_OPT = %{mach_opt} LANG_FLAGS = %{lang_flags} WARN_FLAGS = %{warn_flags} SO_OBJ_FLAGS = %{shared_flags} -SO_LINK_CMD = %{so_link} +LIB_LINK_CMD = %{so_link} LINK_TO = %{link_to} ### Version Numbers @@ -45,11 +45,12 @@ CHECKOBJS = %{check_objs} LIB_FLAGS = $(LIB_OPT) $(MACH_OPT) $(LANG_FLAGS) $(WARN_FLAGS) $(SO_OBJ_FLAGS) CHECK_FLAGS = $(CHECK_OPT) $(LANG_FLAGS) $(WARN_FLAGS) -LIBRARIES = $(DLL) - LIBNAME = botan -DLL = $(LIBNAME).%{so_suffix} -STATIC_LIB = $(LIBNAME).%{static_suffix} + +LIBRARIES = $(BOTAN_LIB) + +# This will be either a static lib or the DLL import lib +BOTAN_LIB = $(LIBNAME).%{static_suffix} all: $(LIBRARIES) @@ -60,10 +61,10 @@ all: $(LIBRARIES) ### Link Commands $(CHECK): $(LIBRARIES) $(CHECKOBJS) - $(CXX) /Fe$@ $(CHECKOBJS) $(STATIC_LIB) $(LINK_TO) + $(CXX) /Fe$@ $(CHECKOBJS) $(BOTAN_LIB) $(LINK_TO) -$(DLL): $(LIBOBJS) - $(SO_LINK_CMD) /Febotan $(LIBOBJS) $(LINK_TO) +$(BOTAN_LIB): $(LIBOBJS) + $(LIB_LINK_CMD) /Fe$(LIBNAME) $(LIBOBJS) $(LINK_TO) ### Fake Targets clean: diff --git a/src/build-data/makefile/unix.in b/src/build-data/makefile/unix.in index 8e0e35b87..22ff919cc 100644 --- a/src/build-data/makefile/unix.in +++ b/src/build-data/makefile/unix.in @@ -1,6 +1,4 @@ -################################################## -# Compiler Options # -################################################## +# Compiler Options CXX = %{cc} LIB_OPT = %{lib_opt} CHECK_OPT = %{check_opt} @@ -9,14 +7,10 @@ LANG_FLAGS = %{lang_flags} WARN_FLAGS = %{warn_flags} LINK_TO = %{link_to} -################################################## -# Version Numbers # -################################################## +# Version Numbers VERSION = %{version} -################################################## -# Installation Settings # -################################################## +# Installation Settings DESTDIR = %{prefix} BINDIR = $(DESTDIR)/bin @@ -28,9 +22,7 @@ PKGCONF_DIR = $(LIBDIR)/pkgconfig CONFIG_SCRIPT = %{botan_config} PKGCONFIG = %{botan_pkgconfig} -################################################## -# Aliases for Common Programs # -################################################## +# Aliases for Common Programs AR = %{ar_command} CD = @cd ECHO = @echo @@ -43,9 +35,7 @@ RANLIB = %{ranlib_command} RM = @rm -f RM_R = @rm -rf -################################################## -# File Lists # -################################################## +# File Lists CHECK = %{check_prefix}check DOCS = %{doc_files} @@ -66,16 +56,12 @@ STATIC_LIB = $(LIBNAME).a all: $(LIBRARIES) -################################################## -# Build Commands # -################################################## +# Build Commands %{lib_build_cmds} %{check_build_cmds} -################################################## -# Link Commands # -################################################## +# Link Commands $(CHECK): $(LIBRARIES) $(CHECKOBJS) $(CXX) $(CHECKOBJS) -L. libbotan.a $(LINK_TO) -o $(CHECK) @@ -84,9 +70,7 @@ $(STATIC_LIB): $(LIBOBJS) $(AR) $(STATIC_LIB) $(LIBOBJS) $(RANLIB) $(STATIC_LIB) -################################################## -# Fake Targets # -################################################## +# Fake Targets .PHONY = doxygen clean distclean install static static: $(STATIC_LIB) diff --git a/src/build-data/makefile/unix_shr.in b/src/build-data/makefile/unix_shr.in index cfc8e3223..499b7eb92 100644 --- a/src/build-data/makefile/unix_shr.in +++ b/src/build-data/makefile/unix_shr.in @@ -1,6 +1,4 @@ -################################################## -# Compiler Options # -################################################## +# Compiler Options CXX = %{cc} LIB_OPT = %{lib_opt} CHECK_OPT = %{check_opt} @@ -11,15 +9,11 @@ SO_OBJ_FLAGS = %{shared_flags} SO_LINK_CMD = %{so_link} LINK_TO = %{link_to} -################################################## -# Version Numbers # -################################################## +# Version Numbers VERSION = %{version} SO_VERSION = %{so_version} -################################################## -# Installation Settings # -################################################## +# Installation Settings DESTDIR = %{prefix} BINDIR = $(DESTDIR)/bin @@ -31,9 +25,7 @@ PKGCONF_DIR = $(LIBDIR)/pkgconfig CONFIG_SCRIPT = %{botan_config} PKGCONFIG = %{botan_pkgconfig} -################################################## -# Aliases for Common Programs # -################################################## +# Aliases for Common Programs AR = %{ar_command} CD = @cd ECHO = @echo @@ -46,9 +38,7 @@ RANLIB = %{ranlib_command} RM = @rm -f RM_R = @rm -rf -################################################## -# File Lists # -################################################## +# File Lists CHECK = %{check_prefix}check DOCS = %{doc_files} @@ -74,16 +64,12 @@ SYMLINK = libbotan.%{so_suffix} all: $(LIBRARIES) -################################################## -# Build Commands # -################################################## +# Build Commands %{lib_build_cmds} %{check_build_cmds} -################################################## -# Link Commands # -################################################## +# Link Commands $(CHECK): $(LIBRARIES) $(CHECKOBJS) $(CXX) $(LDFLAGS) $(CHECKOBJS) -o $(CHECK) -L. -lbotan-%{so_version} $(LINK_TO) @@ -96,9 +82,7 @@ $(SHARED_LIB): $(LIBOBJS) $(SO_LINK_CMD) $(LDFLAGS) $(LIBOBJS) -o $(SHARED_LIB) $(LINK_TO) $(LN) $(SHARED_LIB) $(SYMLINK) -################################################## -# Fake Targets # -################################################## +# Fake Targets .PHONY = doxygen clean distclean install static shared static: $(STATIC_LIB) diff --git a/src/engine/simd_engine/simd_engine.cpp b/src/engine/simd_engine/simd_engine.cpp index 7e15f9ec1..fdb1644d0 100644 --- a/src/engine/simd_engine/simd_engine.cpp +++ b/src/engine/simd_engine/simd_engine.cpp @@ -6,6 +6,7 @@ */ #include <botan/simd_engine.h> +#include <botan/simd_32.h> #include <botan/cpuid.h> #if defined(BOTAN_HAS_SERPENT_SIMD) @@ -26,6 +27,9 @@ BlockCipher* SIMD_Engine::find_block_cipher(const SCAN_Name& request, Algorithm_Factory&) const { + if(!SIMD_32::enabled()) + return 0; + #if defined(BOTAN_HAS_SERPENT_SIMD) if(request.algo_name() == "Serpent") return new Serpent_SIMD; diff --git a/src/hash/sha1_sse2/sha1_sse2.h b/src/hash/sha1_sse2/sha1_sse2.h index 0f8eebee9..1c4b4cca7 100644 --- a/src/hash/sha1_sse2/sha1_sse2.h +++ b/src/hash/sha1_sse2/sha1_sse2.h @@ -24,8 +24,6 @@ class BOTAN_DLL SHA_160_SSE2 : public SHA_160 void compress_n(const byte[], u32bit blocks); }; -extern "C" void botan_sha1_sse2_compress(u32bit[5], const u32bit*); - } #endif diff --git a/src/utils/simd_32/simd_altivec.h b/src/utils/simd_32/simd_altivec.h index 3e784a8c4..e1704e76c 100644 --- a/src/utils/simd_32/simd_altivec.h +++ b/src/utils/simd_32/simd_altivec.h @@ -20,7 +20,7 @@ namespace Botan { class SIMD_Altivec { public: - bool enabled() const { return CPUID::has_altivec(); } + static bool enabled() { return CPUID::has_altivec(); } SIMD_Altivec(const u32bit B[4]) { diff --git a/src/utils/simd_32/simd_scalar.h b/src/utils/simd_32/simd_scalar.h index 398503d33..148b76c35 100644 --- a/src/utils/simd_32/simd_scalar.h +++ b/src/utils/simd_32/simd_scalar.h @@ -16,7 +16,7 @@ namespace Botan { class SIMD_Scalar { public: - bool enabled() const { return true; } + static bool enabled() { return true; } SIMD_Scalar(const u32bit B[4]) { diff --git a/src/utils/simd_32/simd_sse.h b/src/utils/simd_32/simd_sse.h index 81d8afe75..9f03b3733 100644 --- a/src/utils/simd_32/simd_sse.h +++ b/src/utils/simd_32/simd_sse.h @@ -17,7 +17,7 @@ namespace Botan { class SIMD_SSE2 { public: - bool enabled() const { return CPUID::has_sse2(); } + static bool enabled() { return CPUID::has_sse2(); } SIMD_SSE2(const u32bit B[4]) { |