Look for system OpenSSL in the usual places; if not found recommend installing.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@188 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Matt Chapman 2002-09-24 07:27:43 +00:00
parent f418fe1a5c
commit c0c6d24d16
2 changed files with 90 additions and 45 deletions

View File

@ -8,8 +8,7 @@
CC = cc
CFLAGS = -O2 -DKEYMAP_PATH=\"$(KEYMAP_PATH)\"
INCLUDES = -I$(X11DIR)/include
LDFLAGS = -L$(X11DIR)/lib -lX11 -lXext
LDFLAGS =
prefix = /usr/local
exec_prefix = $(prefix)
@ -86,5 +85,5 @@ dist:
.SUFFIXES: .c .o
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -o $@ -c $<
$(CC) $(CFLAGS) -o $@ -c $<

130
configure vendored
View File

@ -8,44 +8,11 @@
echo "# Generated by $0 $*" >Makeconf
# Choose gcc if available
if `which gcc >/dev/null`; then
echo "CC = gcc" >>Makeconf
fi
# Find X installation
xdirs="/usr/X11 /usr/X11R6 /usr/openwin /usr /usr/local/X11 /usr/local/X11R6 /usr/local"
for dir in $xdirs; do
if [ -f $dir/include/X11/Xlib.h ]; then
xdir=$dir
break
fi
done
if [ -z $xdir ]; then
echo "ERROR: could not find X installation"
echo "(searched for include/X11/Xlib.h in $xdirs)"
exit 1
fi
echo "X11DIR = $xdir" >> Makeconf
# Add platform-specific options
case `uname -s` in
SunOS)
echo "LDFLAGS += -R$(X11DIR)/lib -lsocket -lnsl" >>Makeconf
;;
esac
# Process command line options
cflags=
ldflags=
for arg in $*; do
optarg=`echo $arg | sed 's/[-a-z]*=//'`
case $arg in
@ -65,17 +32,14 @@ case $arg in
echo "datadir = $optarg" >>Makeconf
;;
--with-openssl*)
echo "CFLAGS += -DWITH_OPENSSL" >>Makeconf
echo "LDFLAGS += -lcrypto" >>Makeconf
echo "CRYPTOBJ =" >>Makeconf
;;
--without-openssl*)
;;
--with-debug)
echo "CFLAGS += -g -DWITH_DEBUG" >>Makeconf
cflags="$cflags -g -DWITH_DEBUG"
;;
--with-debug-kbd)
echo "CFLAGS += -g -DWITH_DEBUG_KBD" >>Makeconf
cflags="$cflags -g -DWITH_DEBUG_KBD"
;;
--without-debug*)
;;
@ -90,7 +54,6 @@ case $arg in
echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]"
echo
echo "Build configuration:"
echo " --with-openssl use system OpenSSL libraries for crypto"
echo " --with-debug enable protocol debugging output"
echo " --with-debug-kbd enable debugging of keyboard handling"
echo
@ -100,4 +63,87 @@ case $arg in
esac
done
# Platform-specific options
need_runpath=no
case `uname -s` in
SunOS)
ldflags="$ldflags -lsocket -lnsl"
need_runpath=yes
;;
esac
# Find X installation
xdirs="/usr /usr/X11R6 /usr/X11 /usr/openwin /usr/local /usr/local/X11R6 /usr/local/X11"
for dir in $xdirs; do
if [ -f $dir/include/X11/Xlib.h ]; then
xdir=$dir
break
fi
done
if [ -z "$xdir" ]; then
echo "ERROR: could not find X Window System headers"
echo "(searched for include/X11/Xlib.h in $xdirs)"
# additional helpful information for Linux users
if [ -f /etc/redhat_release ]; then
echo You probably need to install the XFree86-devel package
elif [ -f /etc/debian_version ]; then
echo You probably need to install the xlibs-dev package
fi
exit 1
fi
if [ $xdir != "/usr" ]; then
cflags="$cflags -I$xdir/include"
ldflags="$ldflags -L$xdir/lib"
if [ $need_runpath = "yes" ]; then
ldflags="$ldflags -R$xdir/lib"
fi
fi
ldflags="$ldflags -lX11"
# Find OpenSSL installation if available
ssldirs="/usr /usr/openssl /usr/ssl /usr/local /usr/local/openssl /usr/local/ssl"
for dir in $ssldirs; do
if [ -f $dir/include/openssl/rc4.h ]; then
ssldir=$dir
break
fi
done
if [ -z "$ssldir" ]; then
echo "WARNING: could not find OpenSSL headers"
echo "(searched for include/openssl/rc4.h in $ssldirs)"
echo "Using in-tree crypto; installing OpenSSL is recommended."
echo
else
echo "CRYPTOBJ =" >>Makeconf
if [ $ssldir != "/usr" ]; then
cflags="$cflags -I$ssldir/include"
ldflags="$ldflags -L$ssldir/lib"
if [ $need_runpath = "yes" ]; then
ldflags="$ldflags -R$ssldir/lib"
fi
fi
cflags="$cflags -DWITH_OPENSSL"
ldflags="$ldflags -lcrypto"
fi
echo "CFLAGS += $cflags" >>Makeconf
echo "LDFLAGS += $ldflags" >>Makeconf
echo "configure complete - now run make"