ports

morpheus ports
git clone git://git.2f30.org/ports
Log | Files | Refs | LICENSE

openssl.mk (2252B)


      1 # TODO: update to 1.0.1h
      2 LIB = openssl
      3 DEPS = zlib
      4 INSTALL_LIB = libcrypto.a libssl.a
      5 INSTALL_OTHER1 = `{ls include/openssl/*.h}
      6 INSTALL_OTHER1_DIR = /include/openssl
      7 # NOTE: requires atleast perl and patch as make dependencies.
      8 
      9 <$mkbuild/mk.common
     10 
     11 openssl:QV:
     12 	# disable fips in the build
     13 	# make sure the man pages are suffixed #302165
     14 	# don't bother building man pages if they're disabled
     15 	sed -i \
     16 		-e '/DIRS/s: fips : :g' \
     17 		-e '/^MANSUFFIX/s:=.*:=ssl:' \
     18 		-e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
     19 		-e '/^MANDIR=/s:=.*:=/share/man:' \
     20 		Makefile.org
     21 	# show the actual commands in the log
     22 	sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
     23 	#
     24 	sed -i '1s,^:$,#!/usr/bin/perl,' Configure #141906
     25 	#
     26 	sed -i 's/-DTERMIO/-DTERMIOS/g' Configure
     27 	sed -i 's/defined(linux)/0/' crypto/ui/ui_openssl.c
     28 	# this is asm generated by perl (asm/cast-586.pl) which will cause textrel's that
     29 	# will require musl's dynlinker to mprotect(PROT_EXEC), which is not allowed by grsec.
     30 	sed -i 's@cast-586.o:@c_enc.o:@' Configure
     31 	#
     32 	export CFLAGS="-fPIC -Wa,--noexecstack -fno-strict-aliasing -D_GNU_SOURCE -Wl,-Bsymbolic \
     33 		$optcflags $DEPS_CFLAGS"
     34 	export LDFLAGS="$optldflags $DEPS_LDFLAGS"
     35 	# guess arch
     36 	# NOTE: guess logic in ./config script is weird so set arch here and call
     37 	#       Configure directly.
     38 	sslarch="linux-generic32" # default
     39 	case "$arch" in
     40 	x86_64)
     41 		sslarch="linux-generic64"
     42 		;;
     43 	arm)
     44 		sslarch="linux-armv4"
     45 		;;
     46 	esac
     47 	./Configure "${sslarch}" \
     48 		--prefix="$PREFIX" --openssldir="$PREFIX"/etc/ssl \
     49 		--libdir="$PREFIX"/lib no-dso no-asm zlib enable-md2 $CFLAGS
     50 	# Clean out hardcoded flags that openssl uses
     51 	CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
     52 		-e 's:^CFLAG=::' \
     53 		-e 's:-fomit-frame-pointer ::g' \
     54 		-e 's:-O[0-9] ::g' \
     55 		-e 's:-march=[-a-z0-9]* ::g' \
     56 		-e 's:-mcpu=[-a-z0-9]* ::g' \
     57 		-e 's:-m[a-z0-9]* ::g' \
     58 	)
     59 	for mak in Makefile ; do
     60 	sed -i \
     61 		-e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS} ${INCLUDES}|" \
     62 		-e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
     63 		"$mak"
     64 	done
     65 	cp crypto/cast/Makefile crypto/cast/Makefile.backup
     66 	# second part of our cast-586 fix: CFLAGS need to be picked up by the makefile.
     67 	sed -i 's@CFLAG=-g@CFLAG=${CFLAG} ${CFLAGS}@' crypto/cast/Makefile
     68 	make -j$nprocs depend
     69 	make -j$nprocs build_libs