Commit Graph

24 Commits

Author SHA1 Message Date
Michel Zou 3f92d17894 scons: add py3 support
SCons 3.1 has moved to python 3, requiring this fix
to continue supporting scons builds.

Closes: #944
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Eric Engestrom <eric@engestrom.ch>
Tested-by: Eric Engestrom <eric@engestrom.ch>
2019-09-28 16:53:08 +00:00
pal1000 7f89fd17ed scons: Compatibility with Scons development version string
This ensures Mesa3D build doesn't fail in this case as encountered when
bisecting Scons source code while regression testing
https://bugs.freedesktop.org/show_bug.cgi?id=109443
and when testing 3.0.5.a.2

Technical details:
Scons version string has consistently been in this format:
MajorVersion.MinorVersion.Patch[.alpha/beta.yyyymmdd]
so these formulas should strip alpha/beta flags and return Scons version:

- as string - `'.'.join(SCons.__version__.split('.')[:3])`
- as tuple of integers - `tuple(map(int, SCons.__version__.split('.')[:3]))`

- v2: Fixed Scons version retrieval formulas as string and tuple of integers.
- v3: Fixed Scons version string format description.

Cc: "19.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2019-03-12 14:22:34 +00:00
Eric Engestrom e361047568 scons: use python3-compatible lists
These changes were generated using python's `2to3` tool.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-09-25 12:05:44 +01:00
Tim Rowley 8b66d18a3b scons: allow .inl file extension
Intended for header files which are not meant to be included directly.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
2017-06-30 13:26:19 -05:00
George Kyriazis 2da28dbd11 scons: ignore .hpp files in parse_source_list()
Drivers that contain C++ .hpp files need to ignore them too, along
with .h files, when building source file lists.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-21 12:44:46 -06:00
Jose Fonseca b12606b693 scons: Fix the Python dependency scanner.
modulefinder wasn't searching for dependencies in the script dir.

It's not capable of detecting the sys.path manipulations scripts do
internally neither.

This change fixes the first issue, and hacks around the second.

Honestly, I've come to the conclusion that automatic Python dependency it will always be
too brittle.   I think we should start manually typing the dependencies
like we do in automake.  At very least it will enable any person to
eyeball and spot/fix missing dependencies, without dig into SCons internals.
2016-10-14 16:52:13 +01:00
Giuseppe Bilotta 1b62b47f6f scons: support 2.5.0
The get_implicit_deps changed in SCons 2.5, expecting a callable rather
than a path as third argument. Detect the SCons versions and set the
argument appropriately to support both 2.5 and earlier versions.

This closes #95211.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95211
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-25 12:23:12 -06:00
Jose Fonseca c521f2d737 scons: Improve Python module dependency discovery.
Several NIR scripts were using `from ... import ...` syntax, which wasn't
supported.

Using Python standard libary's modulefinder solves the problem with less
effort and hacks.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-09 14:19:24 +01:00
Jose Fonseca d4a1f3fd27 scons: do not include headers from the sources lists
The SCons documentation is not explicit on the topic yet building mesa
with SCons and MSVC is known to have problems when headers are listed.
So be safe just drop them for now.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82534
Tested-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-14 15:38:04 +01:00
José Fonseca 8771285054 s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008.  Leaving the
old copyright name is creating unnecessary confusion, hence this change.

This was the sed script I used:

    $ cat tg2vmw.sed
    # Run as:
    #
    #   git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
    #

    # Rename copyrights
    s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
    /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
    s/TUNGSTEN GRAPHICS/VMWARE/g

    # Rename emails
    s/alanh@tungstengraphics.com/alanh@vmware.com/
    s/jens@tungstengraphics.com/jowen@vmware.com/g
    s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
    s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
    s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
    s/michel@tungstengraphics.com/daenzer@vmware.com/g
    s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
    s/zack@tungstengraphics.com/zackr@vmware.com/

    # Remove dead links
    s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g

    # C string src/gallium/state_trackers/vega/api_misc.c
    s/"Tungsten Graphics, Inc"/"VMware, Inc"/

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 20:00:32 +00:00
José Fonseca 0aca2c6b60 scons: Fix implicit python dependency discovery on Windows.
Probably due to CRLF endings, the discovery of python import statements
was not working on Windows builds, causing incremental builds to often
fail unless one wiped out the build directory.

NOTE: This is a candidate for stable branches.
2013-06-08 08:55:06 +01:00
José Fonseca 0642437606 scons: Fix source lists parsing on Windows.
/ vs \ mismatch was causing .objs to be put in the source tree, causing
breakeage when doing different build types in the same tree (eg., debug
vs release).

Fix this by normalizing everything to / slashes.

It's probably a good idea to purge all .objs from source tree to prevent
issues completely.
2013-01-23 12:11:53 +00:00
José Fonseca 50dec63790 scons: Fix MinGW cross compilation.
Compensate for the recent changes and assumptions added to
Makefiles.sources
2012-08-16 17:21:52 +01:00
José Fonseca ea8dcfc90d scons: Populate top_srcdir and top_builddir variables when reading Makefiles.sources.
This is not entirely correct, as scons doesn't put binaries in a
"src" subdirectory, but doesn't seem to be a problem for now.
2012-08-14 12:19:56 +01:00
José Fonseca 2470e918cc scons: Require same pkg-config versions as configure. 2012-02-07 11:41:08 +00:00
José Fonseca f8aeb1c990 scons: MacOSX build fixes. 2011-09-20 20:41:57 +01:00
Chia-I Wu 582b5d869c scons: add ParseSourceList method
ParseSourceList() can be used to parse a source list file and returns
the source files defined in it.  It is supposed to be used like this

  # get the list of source files from C_SOURCES in Makefile.sources
  sources = env.ParseSourceList('Makefile.sources', 'C_SOURCES')

The syntax of a source list file is compatible with GNU Make.  This
effectively allows SConscript and Makefile to share the source lists.

Acked-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Chad Versace <chad@chad-versace.us>
2011-08-23 09:11:58 +08:00
José Fonseca 235225ec93 scons: Expose pkg-config in a simpler manner. 2011-06-30 17:36:37 +01:00
José Fonseca c7bd0fa485 scons: Accept verbose=yes instead of quiet=no.
'verbose' is affirmative, and much more common name for this sort of option.
2011-06-17 20:13:16 +01:00
José Fonseca 37058c3497 scons: Add a few more human friendly messages. 2011-05-04 14:10:24 +01:00
José Fonseca 54d8c5e3c2 scons: Add human friendlier build messages for lex/yacc. 2011-03-03 15:42:58 +00:00
José Fonseca 2311e2adf0 scons: User friendly message for code generated files 2010-02-10 22:32:50 +00:00
José Fonseca 2104cbb694 scons: Remove duplicated code. 2010-01-02 00:01:42 +00:00
José Fonseca 97e2c5ac0b scons: Expose convienience libraries to the host environment.
This fixes MinGW cross compilation build, recently broken due to the use
of convenience libraries in the GLSL preprocessor.
2010-01-01 11:00:58 +00:00