HOSTCPUDIR=`uname -p`

function hook_preconfigure {
# in case the default so-path does not cover the libcrypto and libssl.
	export LD_LIBRARY_PATH=${USE_ROOT_nto}/${HOSTCPUDIR}/usr/local/lib:$LD_LIBRARY_PATH;

# --with-ssl-hlib: the directory contains the OpenSSL library for this build host. 
# --with-ssl-tlib: the directory contains the OpenSSL library for the target.
# --with-ssl-inc:  the directory contains the include headers for OpenSSL.

	configure_opts="${configure_opts} --with-cppflags=-I${USE_ROOT_nto}/usr/include"
#zlib
	configure_opts="${configure_opts} --with-zlib-hlib=${USE_ROOT_nto}/${HOSTCPUDIR}/usr"
	configure_opts="${configure_opts} --with-zlib-tlib=${USE_ROOT_nto}/${cpudir}/usr/lib" 
#openssl
	configure_opts="${configure_opts} --with-ssl-hlib=${USE_ROOT_nto}/${HOSTCPUDIR}/usr/local"
	confiugre_opts="${configure_opts} --with-ssl-inc=${USE_ROOT_nto}/${HOSTCPUDIR}/usr/local"
	configure_opts="${configure_opts} --with-ssl-tlib=${USE_ROOT_nto}/${cpudir}/usr/local/lib" 
	configure_opts="${configure_opts} --disable-vi --enable-history=simple --disable-lastlog"
}

function hook_premake {
	if [ ${SYSNAME} = nto ]; then
	    make_CC="${make_CC} -DHAVE_CONFIG_H -DOPENSSL_NO_RC5 -DOPENSSL_NO_IDEA"
	fi
	strip_r_switch
}

function hook_pinfo {
	if [ ${SYSNAME} = nto ]; then
		loc="bin";
	elif [ ${SYSNAME} = win32 ]; then
		loc="usr/bin";
	else
		loc="usr/bin";
	fi
	gen_pinfo -e sshd ${loc} USE=../sshd.use DESCRIPTION="OPENSSH" 
	gen_pinfo -e ssh  ${loc} USE=../ssh.use  DESCRIPTION="OPENSSH" 
	gen_pinfo -e sftp ${loc} USE=../sftp.use DESCRIPTION="OPENSSH" 
	gen_pinfo -e scp  ${loc} USE=../scp.use  DESCRIPTION="OPENSSH" 
	gen_pinfo -e ssh-add ${loc} USE=../ssh-add.use DESCRIPTION="OPENSSH"
	gen_pinfo -e ssh-agent ${loc} USE=../ssh-agent.use DESCRIPTION="OPENSSH"
	gen_pinfo -e ssh-keygen ${loc} USE=../ssh-keygen.use DESCRIPTION="OPENSSH"
}

