summaryrefslogtreecommitdiff
path: root/x11/XFree86/scripts/configure
blob: f45e2e3b0ceb18b8e0df727035f69313f7d42e5b (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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
#!/bin/sh

yesno () {
  answ=X;
  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() {
  answ=X;
  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

# Tk detection
tkversion=
for v in 42 80 81 82 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
        ;;
    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
    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 <<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
if [ X$tkversion != X ]; then
  echo "*** If you want to use XF86Setup to set the INITIAL configuration,"
  echo "*** then you must build the VGA server"
fi
# force the compilation of the EGC server for pc98.
if [ X"${MACHINE}" = X"pc98" ]; then
    echo "#define BuildPC98Servers	YES"  >>$F
    echo "#undef XF98EGCServer"           >>$F
    echo "#define XF98EGCServer     YES"  >>$F
    servers="GA968 GANBWAP NEC480 NKVNEC WABS WABEP WSNA TGUI MGA SVGA NECS3 PWSKB PWLB"
    selected=EGC
    for i in $servers; do
	yesno "Do you want to build the $i server?"
	if [ $answ = YES ]; then selected="$selected $i"; fi
	echo "#undef XF98${i}Server"           >>$F
	echo "#define XF98${i}Server   $answ"  >>$F
    done
    echo "#undef XF86SVGAServer"           >>$F
    echo "#define XF86SVGAServer     NO"  >>$F
    servers="VGA16 VGA16Dual Mono MonoDual S3 S3V I8514 Mach8 Mach32 Mach64 P9000 AGX  W32 I128 GLINT"
    for i in $servers; do
	echo "#undef XF86${i}Server"           >>$F
    echo "#define XF86${i}Server   NO"  >>$F
    done
elif [ X"${MACHINE}" = X"alpha" ]; then
# force the compilation of the SVGA server.
    echo "#undef XF86SVGAServer"           >>$F
    echo "#define XF86SVGAServer     YES"  >>$F
    servers="Mono S3 S3V Mach64 P9000 I128 GLINT TGA"
    selected=SVGA
    for i in $servers; do
	yesno "Do you want to build the $i server?"
	if [ $answ = YES ]; then selected="$selected $i"; fi
	echo "#undef XF86${i}Server"           >>$F
	echo "#define XF86${i}Server   $answ"  >>$F
    done
else
# force the compilation of the SVGA server.
    echo "#undef XF86SVGAServer"           >>$F
    echo "#define XF86SVGAServer     YES"  >>$F
    servers="VGA16 VGA16Dual Mono MonoDual S3 S3V I8514 Mach8 Mach32 Mach64 P9000 AGX  W32 I128 GLINT"
    selected=SVGA
    for i in $servers; do
	yesno "Do you want to build the $i server?"
	if [ $answ = YES ]; then selected="$selected $i"; fi
	echo "#undef XF86${i}Server"           >>$F
	echo "#define XF86${i}Server   $answ"  >>$F
    done
fi

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  
      if [ X"${MACHINE}" = X"pc98" ]; then
      echo "#define ServerToInstall		XF98_$answ" >>$F
      else
      echo "#define ServerToInstall		XF86_$answ" >>$F
      fi
      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?"
echo "#define XVirtualFramebufferServer $answ" >>$F

if [ X"${MACHINE}" != X"pc98" ]; then
if [ X"${MACHINE}" = X"alpha" ]; then
cat >> $F <<END
#define XF86SvgaDrivers         nv mga s3v generic

#define XF86MonoDrivers		hgc1280 sigma apollo hercules
END
else
cat >> $F <<END
#define XF86SvgaDrivers         nv et4000 et3000 pvga1 gvga ati sis tvga8900 \
                                cirrus ncr77c22 compaq mga oak al2101 ali \
                                cl64xx video7 ark mx realtek apm s3_savage s3v \
                                s3_svga neo chips cyrix rendition p9x00 \
				spc8110 i740 tdfx 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 hercules

#define XF86W32Drivers		et4000w32

END
fi
fi


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 "Install xfs config?"
if [ $answ = YES ]; then
  echo "#define InstallFSConfig $answ" >> $F
fi

yesno "Do you want to include support for the FontServer?"
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?"
if [ $answ = NO ]; then
  echo "#define BuildFonts		NO" >> $F
fi
yesno "Build the servers with Extended input devices?"
if [ $answ = NO ]; then
  echo "#undef BuildXInputExt" >> $F
  echo "#define BuildXInputExt		NO" >> $F
else
  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 XIE?"
if [ $answ = NO ]; then
  echo "#define BuildXIE		NO" >> $F
fi
echo

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
  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
    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?"
cpkb=NO
if [ $answ = YES ]; then
    if [ $ELF = yes ]; then
      LIBKRB=/usr/lib/libkrb.a
    elif [ -d /usr/lib/aout ]; then
      LIBKRB=/usr/lib/aout/libkrb.a
    else
      LIBKRB=/usr/lib/libkrb.a
    fi
    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
yesno "Do you want to compile with threads support? (experimental)"
if [ $answ = YES ]; then
    THREADS_PATCH=$FILESDIR/BSD-threads.diff
else
    THREADS_PATCH=
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
if [ X$THREADS_PATCH != X ]; then
    echo "===>  Applying threads patches"
    patch -s -d $WRKDIR  -E -p0 <  $THREADS_PATCH
fi

cat $F >>  $WRKDIR/xc/config/cf/xf86site.def

exit 0