summaryrefslogtreecommitdiffstats
path: root/x11-servers/XFree86-4-Server-snap/scripts/configure
blob: 501dcebd2d8cd216a44abcf0ecedd593040c6a27 (plain)
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
#!/bin/sh

# 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

configure () {
    # Use original host.def as initial config file
    rm -f $LOCALDEF
    grep -v '#define.*ProjectRoot' $ORIGHOSTDEF >> $LOCALDEF
    echo "#define ProjectRoot $PREFIX" >> $LOCALDEF

    # It's good for FreeBSD ports/packages system.
    echo "#define NothingOutsideProjectRoot YES" >> $LOCALDEF

    # Now, We can use this configuration.
    # Thanks, Trevor Johnson <trevor@jpj.net>
    echo "#define InstallXserverSetUID NO" >> $LOCALDEF

    # User Config.
    if [ X$HasSecureRPC != XDEFAULT -a X$HasSecureRPC != X ]; then
	echo "#define HasSecureRPC $HasSecureRPC" >> $LOCALDEF
    fi
    if [ X$HasPam != XDEFAULT -a X$HasPam != X ]; then
	echo "#define HasPam $HasPam" >> $LOCALDEF
    fi
    if [ X$ExtendedInputDevices = XDEFAULT -o X$ExtendedInputDevices = XYES ]; then
	echo "#define XInputDrivers mouse digitaledge dynapro elo2300 \
				elographics magellan \
				microtouch mutouch spaceorb summa \
				wacom void citron" >> $LOCALDEF
        echo "#define JoystickSupport YES" >> $LOCALDEF
    else
	echo "#define XInputDrivers mouse" >> $LOCALDEF	
    fi
    echo "#define BuildXF86DRI ${BuildXF86DRI}" >> $LOCALDEF
    echo "#define BuildXF86DRM ${BuildXF86DRM}" >> $LOCALDEF

    # Matrox driver support
    echo "#define HaveMatroxHal $HaveMatroxHal" >> $LOCALDEF

    # disable some configs: there are not used this ports
    for i in \
	BuildFonts \
	Build75DpiFonts \
	Build100DpiFonts \
	BuildSpeedoFonts \
	BuildType1Fonts \
	BuildCIDFonts \
	BuildCyrillicFonts \
	XnestServer \
	BuildFontServer \
	XVirtualFramebufferServer \
	XprtServer \
	LibHeaders \
	LibInstall \
	ForceNormalLib \
	XTrueTypeInstallCConvHeaders
    do \
	echo "#define $i NO" >> $LOCALDEF
    done
    echo "#define BuildServer YES" >> $LOCALDEF
    echo "#define LibInstallBuild YES" >> $LOCALDEF
    echo "#define ModInstall YES" >> $LOCALDEF
    echo "#define XF86Server YES" >> $LOCALDEF
    echo "#define BuildServersOnly YES" >> $LOCALDEF
    echo "#define BuildXFree86ConfigTools YES" >> $LOCALDEF
    cat >> $LOCALDEF <<END
#ifndef XF86CardDrivers
#ifdef i386Architecture
#define XF86CardDrivers         mga glint nv tga s3virge sis rendition \
                                neomagic i740 tdfx savage \
                                cirrus vmware tseng trident chips apm \
                                GlideDriver fbdev i128 \
                                ati AgpGartDrivers DevelDrivers ark cyrix \
				siliconmotion \
				vesa vga XF86OSCardDrivers XF86ExtraCardDrivers
#else
#ifdef AlphaArchitecture
#define XF86CardDrivers         mga tdfx glint s3virge rendition tga \
				savage nv DevelDrivers siliconmotion vga \
				XF86OSCardDrivers XF86ExtraCardDrivers
#endif
#endif
#endif
END
    echo "#define BuildThreadStubLibrary YES" >> $LOCALDEF
    echo "#define FreeBSDBuildXxserv YES" >> $LOCALDEF

    # Check Wraphelp.c
    WH=$WRKDIR/xc/lib/Xdmcp/Wraphelp.c
    cpwh=NO
    if [ -f $WH ] ; then
	cpwh=SOURCE
    elif [ -f $DISTDIR/xc/Wraphelp.c ] ; then
	cpwh=$DISTDIR/xc/Wraphelp.c
    else
	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

    # Copy ORIGDEF to DESTDEF
    rm -f $DESTDEF
    if [ $cpwh = NO ] ; then
	grep -v '#define.*HasXdmAuth' $ORIGDEF >> $DESTDEF
	echo "#define HasXdmAuth NO" >> $DESTDEF
    else
	if [ X$HasXdmAuth != XDEFAULT -a X$HasXdmAuth != X ]; then
	    echo "#define HasXdmAuth $HasXdmAuth" >> $LOCALDEF
        fi
	cp -f $ORIGDEF $DESTDEF
    fi

    # copy generated config to host.def
    cp -f $LOCALDEF $HOSTDEF
}

cp ${X11BASE}/lib/X11/config/version.def ${WRKSRC}/config/cf
configure
exit 0
OpenPOWER on IntegriCloud