aboutsummaryrefslogtreecommitdiffstats
path: root/x11-servers/XFree86-4-Server-snap/scripts/configure
blob: 76a31a32c37bbe4dc10dd88c33a9e50d0bbf7043 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
#!/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 1 2 3 4; do
  if [ -f /usr/local/lib/libtk4$v.a ]; then
    tkversion=$v
  fi
done
if [ X$tkversion != X ]; then
  echo "Using tk-4.$tkversion"
  echo "#define HasTk           YES" >>$F
  echo "#define TkLibDir        /usr/local/lib" >>$F
  echo "#define TkIncDir        /usr/local/include" >>$F
  echo "#define TkLibName       tk4$tkversion" >>$F
  echo "#define HasTcl          YES" >>$F
  echo "#define TclLibDir       /usr/lib" >>$F
  echo "#define TclIncDir       /usr/include" >>$F
  echo "#define TclLibName      tcl75" >>$F
fi
cat <<END
 Which servers do you wish to build, you can save a lot of disk space
 by only compiling the server you will be using.  It will also save you
 considerable compile time.
END
servers="SVGA VGA16 VGA16Dual Mono MonoDual S3 S3V I8514 Mach8 Mach32 Mach64 P9000 AGX  W32 I128"
for i in $servers; do
  yesno "Do you want to build the $i server? [YES] "
  echo "#undef XF86${i}Server"           >>$F
  echo "#define XF86${i}Server   $answ"  >>$F
done

echo
echo -n "default server to install. [none] "
read answ
if [ X$answ = X ]; then answ=none; fi
if [ $answ != none ]; then
  echo "#define ServerToInstall     XF86_$answ" >>$F
fi

echo
yesno "Do you want to build Xvfb? [YES] "
echo "#define XVirtualFramebufferServer $answ" >>$F

cat >> $F <<END
#define XF86SvgaDrivers     nv et4000 et3000 pvga1 gvga ati sis tvga8900 \
                cirrus ncr77c22 mga oak al2101 ali cl64xx \
                video7 chips ark mx realtek apm generic

#define XF86Vga16Drivers    et4000 et3000 ncr77c22 ati sis tvga8900 oak \
                cl64xx generic 

#define XF86Vga2Drivers     et4000 et3000 pvga1 gvga ati sis tvga8900 \
                cirrus ncr77c22 oak cl64xx generic

#define XF86MonoDrivers     hgc1280 sigma apollo

#define XF86W32Drivers      et4000w32

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? [YES] "
if [ $answ = YES ]; then
  echo "#define InstallXdmConfig    $answ" >> $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

echo "Build static libraries in addition to shared libraries? [YES] "
if [ $answ = YES ]; then
  echo "#define ForceNormalLib      YES" >> $F
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 contined 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/Wraphelp.c ] ; then
    echo "==> Wraphelp.c found in DISTDIR directory, copying to source tree."
    cpwh=$DISTDIR/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

echo
echo "End of configuration questions. No more user input required"
echo
}

configure

if [ X$cpwh != XNO ]; then
  cp $cpwh $WH
fi

cat $F >>  $WRKSRC/config/cf/xf86site.def

cd $WRKSRC/config/cf/ || exit 1;

version=`uname -r`
set `echo $version|sed -e 's/\./ /g' -e 's/-/ /g'`
mv FreeBSD.cf FreeBSD.cf.old
sed -e "s/2.1.5/$version/"                       \
    -e "s/#define OSMajorVersion.*2/#define OSMajorVersion $1/"  \
    -e "s/#define OSMinorVersion.*1/#define OSMinorVersion $2/"  \
    -e "s/#define OSTeenyVersion.*5/#define OSTeenyVersion $3/"  \
    <FreeBSD.cf.old >FreeBSD.cf

exit 0