diff options
Diffstat (limited to 'x11-servers/XFree86-4-Server-snap/scripts/configure')
-rw-r--r-- | x11-servers/XFree86-4-Server-snap/scripts/configure | 373 |
1 files changed, 68 insertions, 305 deletions
diff --git a/x11-servers/XFree86-4-Server-snap/scripts/configure b/x11-servers/XFree86-4-Server-snap/scripts/configure index 1bcad7213802..9c1ae0818a6f 100644 --- a/x11-servers/XFree86-4-Server-snap/scripts/configure +++ b/x11-servers/XFree86-4-Server-snap/scripts/configure @@ -1,332 +1,95 @@ #!/bin/sh -answset () { - if [ -n "$NO_INPUT" ]; then - echo "$2 [$1]" - answ=$1 - else - answ=X - fi -} +# This scripts work as following: +# (1) cp current xf86site.def (it may be created by imake-4 ports) +# to ${WRKDIR}/xc/config/cf. +# this means this ports use imake-4's config defaultly. +# (2) Generate temporal config for compiling. +# Some configs, such as `ForceNormalLib', `FreeBSDBuildXprog', are +# used for compiling this ports localy. so these configs will be generated +# this scripts. these configs will be stored to `host.def' file. +# but this host.def will never install. use local only. + +ORIGDEF=$PREFIX/lib/X11/config/xf86site.def +DESTDEF=$WRKDIR/xc/config/cf/xf86site.def +ORIGHOSTDEF=$PREFIX/lib/X11/config/host.def +LOCALDEF=$WRKDIR/.config +HOSTDEF=$WRKDIR/xc/config/cf/host.def -yesno () { - answset YES "$1" - while [ $answ = X ]; do - echo -n "$1 [YES] " - 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 -} -noyes() { - answset NO "$1" - while [ $answ = X ]; do - echo -n "$1 [NO] " - read answ - if [ X$answ = X ]; then answ="NO"; 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 + # Use original host.def as initial config file + rm -f $LOCALDEF + grep -v '#define.*ProjectRoot' $ORIGHOSTDEF >> $LOCALDEF + echo "#define ProjectRoot $PREFIX" >> $LOCALDEF -# Tk detection -tkversion= -for v in 42 80 81 82 83 42jp 80jp; 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 - ;; - 42jp) - tclversion=76jp - tclLversion=7.6jp - tkLversion=4.2jp - ;; - 80jp) - tclversion=80jp - tclLversion=8.0jp - tkLversion=8.0jp - ;; - 81) - tclversion=81 - tclLversion=8.1 - tkLversion=8.1 - ;; - 82) - tclversion=82 - tclLversion=8.2 - tkLversion=8.2 - ;; - 83) - tclversion=83 - tclLversion=8.3 - tkLversion=8.3 - ;; - esac - fi -done -if [ X$tkversion != X ]; then - case $tkversion in - *jp) - echo "Using Japanized tk-$jptkLversion" - if [ X"${MACHINE}" = X"pc98" ]; then - echo "#define HasJpTk YES" >>$F - echo "#define JpTkLibDir /usr/local/lib" >>$F - echo "#define JpTkIncDir /usr/local/include/tk$tkLversion" >>$F - echo "#define JpTkLibName tk$tkversion" >>$F - echo "#define HasJpTcl YES" >>$F - echo "#define JpTclLibDir /usr/local/lib" >>$F - echo "#define JpTclIncDir /usr/local/include/tcl$tclLversion" >>$F - echo "#define JpTclLibName tcl$tclversion" >>$F - else - 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 + if [ X$ExtendedInputDevices = "X" ]; then + ExtendedInputDevices=YES fi - ;; - *) - 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 - ;; - esac -else -cat <<EOF -*** I don't see the static library for tk version $tkversion in /usr/local/lib. -*** XF86Setup will not be installed. If you want to build this program -*** install tk 4.2 or 8.x first. - -EOF -fi -cat >> $F <<END + # disable some configs: there are not used this ports + for i in BuildFonts \ + Build75DpiFonts \ + Build100DpiFonts \ + BuildSpeedoFonts \ + BuildType1Fonts \ + BuildCIDFonts \ + BuildCyrillicFonts \ + BuildLatin2Fonts \ + XnestServer \ + BuildFontServer \ + XVirtualFramebufferServer \ + XprtServer \ + LibHeaders \ + ForceNormalLib \ + XTrueTypeInstallCConvHeaders + do \ + echo "#define $i NO" >> $LOCALDEF + done + echo "#define BuildServer YES" >> $LOCALDEF + echo "#define XF86Server YES" >> $LOCALDEF + echo "#define BuildServersOnly YES" >> $LOCALDEF + cat >> $LOCALDEF <<END #define XF86CardDrivers mga glint nv tga s3virge sis rendition \ neomagic i740 tdfx \ cirrus tseng trident chips apm \ GlideDriver fbdev \ ati r128 vga XF86ExtraCardDrivers END - -cat <<END - Do you want to install the default system config files? This will overwrite - and files that you may be currently using. This would only be required - on a first time build. -END -yesno "Install xdm config?" -if [ $answ = YES ]; then - echo "#define InstallXdmConfig $answ" >> $F -fi -yesno "Install xinit config?" -if [ $answ = YES ]; then - echo "#define InstallXinitConfig $answ" >> $F -fi - -yesno "Do you want to include support for the FontServer?" -if [ $answ = YES ]; then - echo "#define BuildFontServer $answ" >>$F - yesno "Install xfs config?" - if [ $answ = YES ]; then - echo "#define InstallFSConfig $answ" >> $F + if [ $ExtendedInputDevices != "YES" ]; then + echo "#define XInputDrivers mouse" >> $LOCALDEF + else + echo "#define XInputDrivers mouse dynapro elo2300 elographics \ + magellan microtouch \ + mutouch spaceorb wacom" >> $LOCALDEF fi -else - echo "#define BuildFontServer $answ" >>$F - echo "#define InstallFSConfig $answ" >> $F -fi - + echo "#define FreeBSDBuildXxserv YES" >> $LOCALDEF -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?" -echo "#define BuildFonts $answ" >> $F -if [ $answ = YES ]; then - yesno "Build/install the 75dpi fonts?" - echo "#define Build75DpiFonts $answ" >> $F - yesno "Build/install the 100dpi fonts?" - echo "#define Build100DpiFonts $answ" >> $F - yesno "Build/install the Speedo fonts?" - echo "#define BuildSpeedoFonts $answ" >> $F - yesno "Build/install the Type1 fonts?" - echo "#define BuildType1Fonts $answ" >> $F - yesno "Build/install the CID fonts?" - echo "#define BuildCIDFonts $answ" >> $F - yesno "Build/install the Cyrillic fonts?" - echo "#define BuildCyrillicFonts $answ" >> $F - yesno "Build/install the Latin2 fonts?" - echo "#define BuildLatin2Fonts $answ" >> $F -fi - -yesno "Build the servers with Extended input devices?" -if [ $answ = NO ]; then - echo "#define XInputDrivers mouse" >> $F -else - echo "#define XInputDrivers mouse dynapro elo2300 elographics magellan microtouch \ - mutouch spaceorb wacom" >> $F -# XXX broken in 3.9.18 -# if [ X${MACHINE} != X"alpha" ]; then -# echo "#define JoystickSupport YES" >> $F -# fi -fi - -yesno "Build PEX?" -if [ $answ = NO ]; then - echo "#define BuildPexExt NO" >> $F -fi -yesno "Build Xinerama?" -echo "#define BuildXinerama $answ" >> $F - -yesno "Build XIE?" -if [ $answ = NO ]; then - echo "#define BuildXIE NO" >> $F -fi -echo - -yesno "Install application defaults files?" -if [ $answ = NO ]; then - echo "#define InstallAppDefFiles NO" >> $F -fi - -yesno "Build static libraries in addition to shared libraries?" -if [ $answ = YES ]; then - echo "#define ForceNormalLib YES" >> $F -fi -# ELF detection -if [ `sysctl -n kern.osreldate` -ge 300004 -a X`objformat` = Xelf ]; then - ELF=yes -cat <<'END' - - Some programs still require a.out X libraries. Most noteable amongst - these is Nestcape, but it is reported to work best with older X libraries. - You can build a.out libraries here, using the lastest sources and - compiler, or you can use the XFree86-aoutlibs port, which installs older - a.out compatibility libraries. - - If you decide to build the libraries here they will not be uninstalled by - this port, and they will be overwritten by the XFree86-aoutlibs port, if - for some reason you install it. - -END - noyes "Do you want to build and install a.out compatibility libraries?" - if [ $answ = YES ]; then - echo "#define BuildAoutLibraries YES" >> $F - fi -else - ELF=no -fi - -if [ ${OSVERSION} -ge 300000 ]; 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?" -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?" -cpwh=NO -if [ $answ = YES ]; then + # Check Wraphelp.c WH=$WRKDIR/xc/lib/Xdmcp/Wraphelp.c - + cpwh=NO if [ -f $WH ] ; then - echo "==> $WH found in source distribution." + cpwh=SOURCE 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 + echo "==> Warnning: Wraphelp.c not found, DES support NOT enabled." + fi + if [ X$cpwh != XNO -a X$cpwh != XSOURCE ]; then + tr -d '\r' < $cpwh > $WH fi -fi -if [ $cpwh != NO ]; then - echo "#define HasXdmAuth $answ" >> $F -fi -echo -yesno "Do you want to compile with PAM support?" -if [ $answ = YES ]; then - echo "#define HasPam YES" >> $F -else - echo "#define HasPam NO" >> $F -fi + # Copy ORIGDEF to DESTDEF + rm -f $DESTDEF + if [ $cpwh = NO ] ; then + grep -v '#define.*HasXdmAuth' $ORIGDEF >> $DESTDEF + echo "#define HasXdmAuth NO" >> $DESTDEF + else + cp -f $ORIGDEF $DESTDEF + fi -echo -echo -echo "End of configuration questions. No more user input required" -echo + # copy generated config to host.def + cp -f $LOCALDEF $HOSTDEF } configure - -if [ X$cpwh != XNO ]; then - tr -d '\r' < $cpwh > $WH -fi - -cat $F >> $WRKDIR/xc/config/cf/xf86site.def - exit 0 |