#!/bin/sh yesno () { answ=X; while [ $answ = X ]; do echo -n "$1" read answ if [ X$answ = X ]; then answ="YES"; fi case $answ in y|yes|Y|YES) answ=YES;; n|no|N|NO) answ=NO;; *) echo invalid answer answ=X ;; esac done } F=$WRKDIR/.config configure () { rm -f $F # Tk detection tkversion= for v in 42 80; do if [ -f /usr/local/lib/libtk$v.a ]; then tkversion=$v case $tkversion in 42) tclversion=76 tclLversion=7.6 tkLversion=4.2 ;; 80) tclversion=80 tclLversion=8.0 tkLversion=8.0 ;; esac fi done if [ X$tkversion != X ]; then echo "Using tk-$tkLversion" echo "#define HasTk YES" >>$F echo "#define TkLibDir /usr/local/lib" >>$F echo "#define TkIncDir /usr/local/include/tk$tkLversion" >>$F echo "#define TkLibName tk$tkversion" >>$F echo "#define HasTcl YES" >>$F echo "#define TclLibDir /usr/local/lib" >>$F echo "#define TclIncDir /usr/local/include/tcl$tclLversion" >>$F echo "#define TclLibName tcl$tclversion" >>$F else cat <>$F echo "#define XF86SVGAServer YES" >>$F servers="VGA16 VGA16Dual Mono MonoDual S3 S3V I8514 Mach8 Mach32 Mach64 P9000 AGX W32 I128" selected=SVGA for i in $servers; do yesno "Do you want to build the $i server? [YES] " if [ $answ = YES ]; then selected="$selected $i"; fi echo "#undef XF86${i}Server" >>$F echo "#define XF86${i}Server $answ" >>$F done echo ok=0 while [ $ok != 1 ]; do echo -n "default server to install. [none] " read answ if [ X$answ = X ]; then answ=none; ok=1; fi if [ $answ != none ]; then for i in $selected; do if [ $i = $answ ]; then ok=1 echo "#define ServerToInstall XF86_$answ" >>$F fi done fi if [ $ok = 0 ]; then echo you must choose a server among $selected; fi done echo yesno "Do you want to build Xvfb? [YES] " echo "#define XVirtualFramebufferServer $answ" >>$F cat >> $F <> $F fi yesno "Install xinit config? [YES] " if [ $answ = YES ]; then echo "#define InstallXinitConfig $answ" >> $F fi yesno "Install xfs config? [YES] " if [ $answ = YES ]; then echo "#define InstallFSConfig $answ" >> $F fi yesno "Do you want to include support for the FontServer? [YES] " echo "#undef BuildFontServer" >>$F echo "#define BuildFontServer $answ" >>$F echo "#undef InstallFSConfig" >>$F echo "#define InstallFSConfig $answ" >>$F cat <<'END' Do you want to Build Fonts (Usually you only want to build and install fonts once, if this is a first time install you will want to build the fonts) END yesno "Build fonts? [YES] " if [ $answ = NO ]; then echo "#define BuildFonts NO" >> $F fi yesno "Build the servers with Extended input devices? [YES] " if [ $answ = NO ]; then echo "#undef BuildXInputExt" >> $F echo "#define BuildXInputExt NO" >> $F else echo "#define JoystickSupport YES" >> $F fi yesno "Build PEX? [YES] " if [ $answ = NO ]; then echo "#define BuildPexExt NO" >> $F fi yesno "Build XIE? [YES] " if [ $answ = NO ]; then echo "#define BuildXIE NO" >> $F fi echo yesno "Build static libraries in addition to shared libraries? [YES] " if [ $answ = YES ]; then echo "#define ForceNormalLib YES" >> $F fi if [ ! `uname -r|grep ^2` ]; then cat <<'END' FreeBSD-3.x has support for Secure RPC. While this scheme is not used for general purpose encryption, some countries restrict the use of strong cryptography. END yesno "Build with Secure RPC? [YES] " if [ $answ = YES ]; then echo "#define HasSecureRPC YES" >> $F fi fi cat <<'END' MIT supplies an authentication mechanism that relies upon DES, this is called XDM-AUTHORIZATION-1. Source code for this authentication mechanism may not be exported from the United States, however, there are compatible replacements for this mechanism available elsewhere. Also, while this scheme is not used for general purpose encryption, some countries restrict the use of strong cryptography. If you have aquired a copy of "Wraphelp.c" and it currently resides in the same location as the XFree86 source or in the ports "files" subdirectory, it will be copied into the right place in the X11 source distribution and support for this feature will be enabled if you answer YES to the following question. If you do not have a copy of this file, even if you answer YES to this question, support will not be enabled. If you wish to change this later, the option controling this is contained the file xc/config/cf/xf86site.def. END yesno "Do you want to enable XDM-AUTHORIZATION-1 support? [YES] " cpwh=NO if [ $answ = YES ]; then WH=$WRKDIR/xc/lib/Xdmcp/Wraphelp.c if [ -f $WH ] ; then echo "==> $WH found in source distribution." elif [ -f $DISTDIR/xc/Wraphelp.c ] ; then echo "==> Wraphelp.c found in DISTDIR directory, copying to source tree." cpwh=$DISTDIR/xc/Wraphelp.c elif [ -f $FILESDIR/Wraphelp.c ] ; then echo "==> Wraphelp.c found in files directory, copying to source tree." cpwh=$FILESDIR/Wraphelp.c else echo "==> Wraphelp.c not found, DES support NOT enabled." cpwh=NO fi fi if [ $cpwh != NO ]; then echo "#define HasXdmAuth $answ" >> $F fi cat <<'END' XDM can be built so that it will get a KerberosIV TGT for your users when they log in. This requires that you have Kerberos on your system when you do this build. Source code for this authentication mechanism may not be exported from the United States, however, there are compatible replacements for this mechanism available elsewhere. Also, while this scheme is not used for general purpose encryption, some countries restrict the use of strong cryptography. Even if you answer YES to the following question, KerberosIV support will not be enabled if the kerberos libraries are unavailable. END yesno "Do you want to enable KerberosIV support? [YES] " cpkb=NO if [ $answ = YES ]; then LIBKRB=/usr/lib/libkrb.a K4PATCH=$FILESDIR/kerberos4.diffs K4XDM="$FILESDIR/krb4auth.c $FILESDIR/krb4auth.h" XDMDIR=$WRKDIR/xc/programs/xdm/ if [ -f $LIBKRB ] ; then echo "==> KerberosIV found in system libraries." cpkb=YES else echo "==> Kerberos libraries not found on system." echo "==> KerberosIV support NOT enabled." cpkb=NO fi fi if [ $cpkb != NO ]; then echo "#define HasKrb4 $answ" >> $F fi echo echo "End of configuration questions. No more user input required" echo } configure if [ X$cpwh != XNO ]; then cp $cpwh $WH fi if [ X$cpkb != XNO ]; then cp $K4XDM $XDMDIR echo "===> Applying KerberosIV patches" patch -s -d $WRKDIR/xc -E -p0 < $K4PATCH fi cat $F >> $WRKDIR/xc/config/cf/xf86site.def exit 0