mirror of
				https://github.com/open-quantum-safe/liboqs.git
				synced 2025-11-04 00:02:35 -05:00 
			
		
		
		
	* liboqs crosscompiles for android * andriod compilation cleanup * andriod compilation cleanup wip * cc working, TODO: merge back what was removed.. * put back error output * renamed android-build.sh to configure-android * android compilation done * removed the use of generic SIDH implementation if optimizied version was available * added correct CFLAGS for android * added ARM64 assembly optimizations for sidh * sidh arm assembly opitimizations wip * ARM64 optimimizations for SIDH done * added android build documentation * fixed prettyprint issue * removed asm opimizations for darwin
		
			
				
	
	
		
			57 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/bash
 | 
						|
 | 
						|
HOST="aarch64-linux-android"
 | 
						|
ANDROID_NDK_TOOLCHAIN_DIR=""
 | 
						|
 | 
						|
#parse arguments
 | 
						|
for arg in "$@"
 | 
						|
do
 | 
						|
  case $arg in
 | 
						|
    -h=*|--host=*)
 | 
						|
      HOST="${arg#*=}"
 | 
						|
      shift
 | 
						|
      ;;
 | 
						|
    -t=*|--toolchain=*)
 | 
						|
      ANDROID_NDK_TOOLCHAIN_DIR="${arg#*=}"
 | 
						|
      shift
 | 
						|
      ;;
 | 
						|
  esac
 | 
						|
done
 | 
						|
 | 
						|
#validate arguments
 | 
						|
 | 
						|
function print_help {
 | 
						|
cat << EOF
 | 
						|
Usage: $0 [OPTION]... [VAR=VALUE]...
 | 
						|
 | 
						|
  --host=HOST         cross-compile to build programs to run on HOST [default: aarch64-linux-android]
 | 
						|
  --toolchain=DIR     Android NDK standalone toolchain
 | 
						|
 | 
						|
Example usage: $0 --host=aarch64-linux-android --toolchain=/ram/arm
 | 
						|
 | 
						|
EOF
 | 
						|
  exit 0
 | 
						|
}
 | 
						|
 | 
						|
if [[ ! -d $ANDROID_NDK_TOOLCHAIN_DIR ]]; then
 | 
						|
  print_help
 | 
						|
fi
 | 
						|
 | 
						|
# configure
 | 
						|
 | 
						|
ANDROID_NDK_ROOT=${ANDROID_NDK_TOOLCHAIN_DIR}
 | 
						|
ANDROID_NDK_BIN="${ANDROID_NDK_ROOT}/bin"
 | 
						|
ANDROID_SYSROOT_DIR="${ANDROID_NDK_ROOT}/sysroot"
 | 
						|
 | 
						|
COMPILER_PREFIX=$HOST
 | 
						|
export CC=${ANDROID_NDK_BIN}/${COMPILER_PREFIX}-gcc
 | 
						|
export CPP=${ANDROID_NDK_BIN}/${COMPILER_PREFIX}-cpp
 | 
						|
export CXX=${ANDROID_NDK_BIN}/${COMPILER_PREFIX}-g++
 | 
						|
export LD=${ANDROID_NDK_BIN}/${COMPILER_PREFIX}-ld
 | 
						|
export AR=${ANDROID_NDK_BIN}/${COMPILER_PREFIX}-ar
 | 
						|
export RANLIB=${ANDROID_NDK_BIN}/${COMPILER_PREFIX}-ranlib
 | 
						|
export STRIP=${ANDROID_NDK_BIN}/${COMPILER_PREFIX}-strip
 | 
						|
 | 
						|
./configure --host="${COMPILER_PREFIX}" --disable-aes-ni --with-sysroot="${ANDROID_SYSROOT_DIR}"
 | 
						|
 |