mirror of
https://git.freebsd.org/ports.git
synced 2025-06-03 11:56:28 -04:00
[2] Make the ports respect CFLAGS better. Now CFLAGS (and CC/CXX) are set for the build during the configure stage. PR: [2] 40271, 43369
122 lines
4.1 KiB
Bash
122 lines
4.1 KiB
Bash
#!/bin/sh
|
|
|
|
# This script does the following:
|
|
# (1) cp current xf86site.def (it is created by the imake-4 port)
|
|
# to ${WRKDIR}/xc/config/cf.
|
|
# this means this port uses imake-4's config for defaults.
|
|
# (2) Generate temporal config for compiling.
|
|
# Some configs, such as `ForceNormalLib', `FreeBSDBuildXprog', are
|
|
# used locally for compiling this port, so these configs will be generated
|
|
# by this script. These configs will be stored to the `host.def' file,
|
|
# but this host.def will never be installed.
|
|
|
|
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 NO" >> $LOCALDEF
|
|
echo "#define HasGlide3 ${HasGlide3}" >> $LOCALDEF
|
|
echo "#define Glide3IncDir glide3" >> $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
|
|
echo "#define UseInstalledPrograms YES" >> $LOCALDEF
|
|
echo "#define StandardIncludes -I${PREFIX}/include" >> $LOCALDEF
|
|
echo "#define FreeBSDCC ${CC}" >> $LOCALDEF
|
|
echo "#define FreeBSDCXX ${CXX}" >> $LOCALDEF
|
|
echo "#define FreeBSDCFLAGS ${CFLAGS}" >> $LOCALDEF
|
|
|
|
# More of the i386 drivers could probably move to XF86CardDrivers.
|
|
# Is fbdev driver useful to us?
|
|
# GlideDriver was left out because we have no Glide2 package.
|
|
cat >> $LOCALDEF <<END
|
|
#ifndef XF86CardDrivers
|
|
#ifdef i386Architecture
|
|
#define ArchSpecificDrivers apm ark chips cirrus cyrix fbdev i740 \
|
|
i128 i810 neomagic sis trident tseng \
|
|
vesa vmware
|
|
#define DriDrivers gamma tdfx mga i810 i830 r128 radeon sis
|
|
#elif defined(AlphaArchitecture)
|
|
#define ArchSpecificDrivers
|
|
#define DriDrivers gamma tdfx mga r128 radeon
|
|
#endif
|
|
#define XF86CardDrivers ati glint mga nv rendition s3 s3virge \
|
|
savage siliconmotion tdfx tga vga \
|
|
ArchSpecificDrivers DevelDrivers \
|
|
XF86OSCardDrivers XF86ExtraCardDrivers
|
|
#endif
|
|
END
|
|
|
|
echo "#define BuildThreadStubLibrary YES" >> $LOCALDEF
|
|
echo "#define FreeBSDBuildXxserv YES" >> $LOCALDEF
|
|
|
|
# Copy ORIGDEF to DESTDEF
|
|
rm -f $DESTDEF
|
|
cp -f $ORIGDEF $DESTDEF
|
|
|
|
# copy generated config to host.def
|
|
cp -f $LOCALDEF $HOSTDEF
|
|
}
|
|
|
|
cp ${X11BASE}/lib/X11/config/version.def ${WRKSRC}/config/cf
|
|
configure
|
|
exit 0
|