Commit 6e6cd7d9 authored by Jose Fonseca's avatar Jose Fonseca Committed by Marge Bot
Browse files

scons: Remove.

Part-of: <!9720>
parent 85c17700
Pipeline #287543 waiting for manual action with stages
in 2 minutes and 3 seconds
......@@ -13,17 +13,12 @@ matrix:
include:
- env:
- BUILD=meson
- env:
- BUILD=scons
before_install:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install expat gettext
- if test "x$BUILD" = xmeson; then
HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja;
fi
- if test "x$BUILD" = xscons; then
HOMEBREW_NO_AUTO_UPDATE=1 brew install scons;
fi
# Set PATH for homebrew pip3 installs
- PYTHON_VERSION=$(python3 -V | awk '{print $2}' | cut -d. -f1-2)
......@@ -47,9 +42,6 @@ install:
pip3 install --user meson;
pip3 install --user mako;
fi
- if test "x$BUILD" = xscons; then
pip2 install --user mako;
fi
script:
- if test "x$BUILD" = xmeson; then
......@@ -58,7 +50,3 @@ script:
ninja -C _build test || travis_terminate 1;
ninja -C _build install || travis_terminate 1;
fi
- if test "x$BUILD" = xscons; then
scons force_scons=1 || travis_terminate 1;
scons force_scons=1 check || travis_terminate 1;
fi
......@@ -67,11 +67,6 @@ GALLIUM TARGETS
R: Emil Velikov <emil.l.velikov@gmail.com>
F: src/gallium/targets/
SCONS BUILD
F: scons/
F: */SConscript*
F: */Makefile.sources
ANDROID BUILD
R: Emil Velikov <emil.l.velikov@gmail.com>
R: Rob Herring <robh@kernel.org>
......
#######################################################################
# Top-level SConstruct
#
# For example, invoke scons as
#
# scons build=debug llvm=yes machine=x86
#
# to set configuration variables. Or you can write those options to a file
# named config.py:
#
# # config.py
# build='debug'
# llvm=True
# machine='x86'
#
# Invoke
#
# scons -h
#
# to get the full list of options. See scons manpage for more info.
#
from __future__ import print_function
import os
import os.path
import sys
import SCons.Util
import common
#######################################################################
# Minimal scons version
EnsureSConsVersion(2, 4)
EnsurePythonVersion(2, 7)
#######################################################################
# Configuration options
opts = Variables('config.py')
common.AddOptions(opts)
env = Environment(
options = opts,
tools = ['gallium'],
toolpath = ['#scons'],
ENV = os.environ,
)
# XXX: This creates a many problems as it saves...
#opts.Save('config.py', env)
# Backwards compatability with old target configuration variable
try:
targets = ARGUMENTS['targets']
except KeyError:
pass
else:
targets = targets.split(',')
print('scons: warning: targets option is deprecated; pass the targets on their own such as')
print()
print(' scons %s' % ' '.join(targets))
print()
COMMAND_LINE_TARGETS.append(targets)
Help(opts.GenerateHelpText(env))
#######################################################################
# Print a deprecation warning for using scons on non-windows
if common.host_platform != 'windows' and env['platform'] != 'windows':
if env['force_scons']:
print("WARNING: Scons is deprecated for non-windows platforms (including cygwin) "
"please use meson instead.", file=sys.stderr)
else:
print("ERROR: Scons is deprecated for non-windows platforms (including cygwin) "
"please use meson instead. If you really need to use scons you "
"can add `force_scons=1` to the scons command line.", file=sys.stderr)
sys.exit(1)
else:
print("WARNING: Scons support is in the process of being deprecated on "
"on windows platforms (including mingw). If you haven't already "
"please try using meson for windows builds. Be sure to report any "
"issues you run into", file=sys.stderr)
#######################################################################
# Environment setup
with open("VERSION") as f:
mesa_version = f.read().strip()
env.Append(CPPDEFINES = [
('PACKAGE_VERSION', '\\"%s\\"' % mesa_version),
('PACKAGE_BUGREPORT', '\\"https://gitlab.freedesktop.org/mesa/mesa/-/issues\\"'),
])
# Includes
env.Prepend(CPPPATH = [
'#/include',
])
env.Append(CPPPATH = [
'#/src/gallium/include',
'#/src/gallium/auxiliary',
'#/src/gallium/drivers',
'#/src/gallium/winsys',
])
# for debugging
#print env.Dump()
# Add a check target for running tests
check = env.Alias('check')
env.AlwaysBuild(check)
#######################################################################
# Invoke host SConscripts
#
# For things that are meant to be run on the native host build machine, instead
# of the target machine.
#
# Create host environent
if env['crosscompile'] and not env['embedded']:
host_env = Environment(
options = opts,
# no tool used
tools = [],
toolpath = ['#scons'],
ENV = os.environ,
)
# Override options
host_env['platform'] = common.host_platform
host_env['machine'] = common.host_machine
host_env['toolchain'] = 'default'
host_env['llvm'] = False
host_env.Tool('gallium')
host_env['hostonly'] = True
assert host_env['crosscompile'] == False
target_env = env
env = host_env
Export('env')
SConscript(
'src/SConscript',
variant_dir = host_env['build_dir'],
duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
env = target_env
Export('env')
#######################################################################
# Invoke SConscripts
# TODO: Build several variants at the same time?
# http://www.scons.org/wiki/SimultaneousVariantBuilds
SConscript(
'src/SConscript',
variant_dir = env['build_dir'],
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
########################################################################
# List all aliases
try:
from SCons.Node.Alias import default_ans
except ImportError:
pass
else:
aliases = sorted(default_ans.keys())
env.Help('\n')
env.Help('Recognized targets:\n')
for alias in aliases:
env.Help(' %s\n' % alias)
#######################################################################
# Common SCons code
import os
import os.path
import re
import subprocess
import sys
import platform as _platform
import SCons.Script.SConscript
#######################################################################
# Defaults
host_platform = _platform.system().lower()
if host_platform.startswith('cygwin'):
host_platform = 'cygwin'
# MSYS2 default platform selection.
if host_platform.startswith('mingw'):
host_platform = 'windows'
# Search sys.argv[] for a "platform=foo" argument since we don't have
# an 'env' variable at this point.
if 'platform' in SCons.Script.ARGUMENTS:
target_platform = SCons.Script.ARGUMENTS['platform']
else:
target_platform = host_platform
_machine_map = {
'x86': 'x86',
'i386': 'x86',
'i486': 'x86',
'i586': 'x86',
'i686': 'x86',
'BePC': 'x86',
'Intel': 'x86',
'ppc': 'ppc',
'BeBox': 'ppc',
'BeMac': 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
'sparc': 'sparc',
'sun4u': 'sparc',
}
# find host_machine value
if 'PROCESSOR_ARCHITECTURE' in os.environ:
host_machine = os.environ['PROCESSOR_ARCHITECTURE']
else:
host_machine = _platform.machine()
host_machine = _machine_map.get(host_machine, 'generic')
# MSYS2 default machine selection.
if _platform.system().lower().startswith('mingw') and 'MSYSTEM' in os.environ:
if os.environ['MSYSTEM'] == 'MINGW32':
host_machine = 'x86'
if os.environ['MSYSTEM'] == 'MINGW64':
host_machine = 'x86_64'
default_machine = host_machine
default_toolchain = 'default'
# MSYS2 default toolchain selection.
if _platform.system().lower().startswith('mingw'):
default_toolchain = 'mingw'
if target_platform == 'windows' and host_platform != 'windows':
default_machine = 'x86'
default_toolchain = 'crossmingw'
# find default_llvm value
if 'LLVM' in os.environ or 'LLVM_CONFIG' in os.environ:
default_llvm = 'yes'
else:
default_llvm = 'no'
try:
if target_platform != 'windows' and \
subprocess.call(['llvm-config', '--version'],
stdout=subprocess.PIPE) == 0:
default_llvm = 'yes'
except:
pass
#######################################################################
# Common options
def AddOptions(opts):
try:
from SCons.Variables.BoolVariable import BoolVariable as BoolOption
except ImportError:
from SCons.Options.BoolOption import BoolOption
try:
from SCons.Variables.EnumVariable import EnumVariable as EnumOption
except ImportError:
from SCons.Options.EnumOption import EnumOption
opts.Add(EnumOption('build', 'build type', 'debug',
allowed_values=('debug', 'checked', 'profile',
'release')))
opts.Add(BoolOption('verbose', 'verbose output', 'no'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code',
default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('cygwin', 'darwin', 'freebsd', 'haiku',
'linux', 'sunos', 'windows')))
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add(BoolOption('analyze',
'enable static code analysis where available', 'no'))
opts.Add(BoolOption('asan', 'enable Address Sanitizer', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
opts.Add(BoolOption('force_scons', 'Force enable scons on deprecated platforms', 'false'))
opts.Add(BoolOption('openmp', 'EXPERIMENTAL: compile with openmp (swrast)',
'no'))
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
opts.Add(BoolOption('swr', 'Build OpenSWR', 'no'))
if host_platform == 'windows':
opts.Add('MSVC_VERSION', 'Microsoft Visual C/C++ version')
opts.Add('MSVC_USE_SCRIPT', 'Microsoft Visual C/C++ vcvarsall script', True)
File: docs/README.WIN32
Last updated: 21 June 2013
Quick Start
----- -----
Windows drivers are build with SCons. Makefiles or Visual Studio projects are
no longer shipped or supported.
Run
scons libgl-gdi
to build gallium based GDI driver.
This will work both with MSVS or Mingw.
Windows Drivers
------- -------
At this time, only the gallium GDI driver is known to work.
Source code also exists in the tree for other drivers in
src/mesa/drivers/windows, but the status of this code is unknown.
Recipe
------
Building on windows requires several open-source packages. These are
steps that work as of this writing.
- install python 2.7
- install scons (latest)
- install mingw, flex, and bison
- install pywin32 from here: http://www.lfd.uci.edu/~gohlke/pythonlibs
get pywin32-218.4.win-amd64-py2.7.exe
- install git
- download mesa from git
see https://www.mesa3d.org/repository.html
- run scons
General
-------
After building, you can copy the above DLL files to a place in your
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
in a system directory, place them in the same directory as the
executable(s). Be careful about accidentially overwriting files of
the same name in the SYSTEM32 directory.
The DLL files are built so that the external entry points use the
stdcall calling convention.
Static LIB files are not built. The LIB files that are built with are
the linker import files associated with the DLL files.
The si-glu sources are used to build the GLU libs. This was done
mainly to get the better tessellator code.
If you have a Windows-related build problem or question, please post
to the mesa-dev or mesa-users list.
......@@ -14,7 +14,7 @@ modified and thus is unreliable).
The CI runs a number of tests, from trivial build-testing to complex GPU rendering:
- Build testing for a number of build systems, configurations and platforms
- Sanity checks (``meson test`` & ``scons check``)
- Sanity checks (``meson test``)
- Some drivers (softpipe, llvmpipe, freedreno and panfrost) are also tested
using `VK-GL-CTS <https://github.com/KhronosGroup/VK-GL-CTS>`__
- Replay of application traces
......
......@@ -8,7 +8,7 @@ with debugging. If ``MESA_DEBUG`` is defined, a message will be printed
to stdout whenever an error occurs.
More extensive error checking is done in DEBUG builds
(``--buildtype debug`` for Meson, ``build=debug`` for SCons).
(``--buildtype debug`` for Meson).
In your debugger you can set a breakpoint in ``_mesa_error()`` to trap
Mesa errors.
......
......@@ -68,18 +68,10 @@ Requirements
You can build only the x86 target by passing
``-DLLVM_TARGETS_TO_BUILD=X86`` to cmake.
- scons (optional)
Building
--------
To build everything on Linux invoke scons as:
.. code-block:: console
scons build=debug libgl-xlib
Alternatively, you can build it with meson with:
To build everything on Linux invoke meson as:
.. code-block:: console
......@@ -88,12 +80,6 @@ Alternatively, you can build it with meson with:
meson -D glx=gallium-xlib -D gallium-drivers=swrast
ninja
but the rest of these instructions assume that scons is used. For
Windows the procedure is similar except the target:
.. code-block:: console
scons platform=windows build=debug libgl-gdi
Using
-----
......@@ -116,9 +102,6 @@ or
To use it set the ``LD_LIBRARY_PATH`` environment variable accordingly.
For performance evaluation pass ``build=release`` to scons, and use the
corresponding lib directory without the ``-debug`` suffix.
Windows
~~~~~~~
......@@ -156,15 +139,6 @@ on systems without any OpenGL drivers):
Profiling
---------
To profile llvmpipe you should build as
::
scons build=profile <same-as-before>
This will ensure that frame pointers are used both in C and JIT
functions, and that no tail call optimizations are done by gcc.
Linux perf integration
~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -219,7 +219,6 @@ Most of the testing should already be done during the
:ref:`cherry-pick <pickntest>` So we do a quick 'touch test'
- meson dist
- scons (from release tarball)
- the produced binaries work
Here is one solution:
......
......@@ -980,7 +980,7 @@ elif host_machine.system() == 'windows'
pre_args += [
'-D_WINDOWS', '-D_WIN32_WINNT=0x0A00', '-DWINVER=0x0A00',
'-DPIPE_SUBSYSTEM_WINDOWS_USER',
'-D_USE_MATH_DEFINES', # XXX: scons doesn't use this for mingw
'-D_USE_MATH_DEFINES', # XXX: scons didn't use this for mingw
]
if cc.get_id() == 'msvc'
pre_args += [
......
"""SCons.Tool.gcc
Tool-specific initialization for MinGW (http://www.mingw.org/)
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
See also http://www.scons.org/wiki/CrossCompilingMingw
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
import os
import os.path
import string
import SCons.Action
import SCons.Builder
import SCons.Tool
import SCons.Util
# These are the mingw toolchain prefixes we search for:
# (We only search for the mingw-w64 toolchain, and not the mingw.org one.)
prefixes32 = SCons.Util.Split("""
i686-w64-mingw32-
""")
prefixes64 = SCons.Util.Split("""
x86_64-w64-mingw32-
""")
def find(env):
if env['machine'] == 'x86_64':
prefixes = prefixes64
else:
prefixes = prefixes32
for prefix in prefixes:
# First search in the SCons path and then the OS path:
if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'):
return prefix
return ''
def shlib_generator(target, source, env, for_signature):
cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS'])
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
if dll: cmd.extend(['-o', dll])
cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])
implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature))
def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
if def_target: cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature))
return [cmd]
def shlib_emitter(target, source, env):
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
no_import_lib = env.get('no_import_lib', 0)
if not dll:
raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX"))
if not no_import_lib and \
not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):
# Append an import library to the list of targets.
target.append(env.ReplaceIxes(dll,
'SHLIBPREFIX', 'SHLIBSUFFIX',
'LIBPREFIX', 'LIBSUFFIX'))
# Append a def file target if there isn't already a def file target
# or a def file source. There is no option to disable def file
# target emitting, because I can't figure out why someone would ever
# want to turn it off.
def_source = env.FindIxes(source, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
if not def_source and not def_target:
target.append(env.ReplaceIxes(dll,
'SHLIBPREFIX', 'SHLIBSUFFIX',
'WIN32DEFPREFIX', 'WIN32DEFSUFFIX'))
return (target, source)