baseten / PostgreSQL / build-openssl.sh

. "$SRCROOT"/PostgreSQL/defines.sh
openssl_source_file=openssl-0.9.8h.tar.gz
openssl_dir=openssl-0.9.8h
openssl_root="$my_build_dir"/"$openssl_dir"


function extract
{
	# Extract the sources
	if [ ! -d "$openssl_root" ]
	then
    	if [ -e "$openssl_root" ]
    	then
        	echo "A file named ${openssl_root} exists and is not a folder. Exiting."
        	exit 1
    	fi

		gnutar -zxf "$openssl_source_file" -C "$my_build_dir"
		exit_on_error
		patch -p1 -d "$openssl_root" < "$SRCROOT"/PostgreSQL/openssl.patch
		exit_on_error
		
		pushd "$my_build_dir"
		ln -s "$openssl_dir" openssl
		popd
	fi
}


echo -n "Checking whether to build OpenSSL for architecture arm... "
if [ ! -e "$openssl_root"/libssl.a ] || \
   [ ! -e "$openssl_root"/libcrypto.a ]
then
    echo "yes."

	export CC="${PLATFORM_DEVELOPER_BIN_DIR}/gcc-4.0"
	mkdir -p "$my_build_dir"
	
	pushd "$SRCROOT"/Contrib/OpenSSL
	extract
	popd
	
	## Make tells that jobserver is unavailable and that -j may not be used.
	pushd "$openssl_root"
	make distclean
	./Configure darwin-arm-gcc
	exit_on_error
	make
	exit_on_error
	popd
else
    echo "already built."
fi
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.