Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mesa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
virgl-es
mesa
Commits
41750107
Commit
41750107
authored
Jun 17, 2011
by
José Fonseca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scons: make embedding orthogonal to the platform
To enable embedding in platforms other than linux.
parent
fc8c4a3a
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
56 additions
and
83 deletions
+56
-83
SConstruct
SConstruct
+1
-18
common.py
common.py
+2
-1
scons/gallium.py
scons/gallium.py
+4
-2
src/gallium/SConscript
src/gallium/SConscript
+37
-37
src/gallium/auxiliary/os/os_memory.h
src/gallium/auxiliary/os/os_memory.h
+1
-1
src/gallium/auxiliary/os/os_misc.h
src/gallium/auxiliary/os/os_misc.h
+0
-4
src/gallium/auxiliary/os/os_thread.h
src/gallium/auxiliary/os/os_thread.h
+6
-6
src/gallium/auxiliary/os/os_time.c
src/gallium/auxiliary/os/os_time.c
+0
-5
src/gallium/auxiliary/util/u_debug.c
src/gallium/auxiliary/util/u_debug.c
+1
-1
src/gallium/drivers/llvmpipe/SConscript
src/gallium/drivers/llvmpipe/SConscript
+1
-1
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
+1
-1
src/gallium/include/pipe/p_config.h
src/gallium/include/pipe/p_config.h
+0
-4
src/glsl/SConscript
src/glsl/SConscript
+2
-2
No files found.
SConstruct
View file @
41750107
...
...
@@ -80,23 +80,6 @@ env.Append(CPPPATH = [
if
env
[
'msvc'
]:
env
.
Append
(
CPPPATH
=
[
'#include/c99'
])
# Embedded
if
env
[
'platform'
]
==
'embedded'
:
env
.
Append
(
CPPDEFINES
=
[
'_POSIX_SOURCE'
,
(
'_POSIX_C_SOURCE'
,
'199309L'
),
'_SVID_SOURCE'
,
'_BSD_SOURCE'
,
'_GNU_SOURCE'
,
'PTHREADS'
,
])
env
.
Append
(
LIBS
=
[
'm'
,
'pthread'
,
'dl'
,
])
# Posix
if
env
[
'platform'
]
in
(
'posix'
,
'linux'
,
'freebsd'
,
'darwin'
):
env
.
Append
(
CPPDEFINES
=
[
...
...
@@ -130,7 +113,7 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
#
# Create host environent
if
env
[
'crosscompile'
]
and
env
[
'platform'
]
!=
'embedded'
:
if
env
[
'crosscompile'
]
and
not
env
[
'embedded'
]
:
host_env
=
Environment
(
options
=
opts
,
# no tool used
...
...
common.py
View file @
41750107
...
...
@@ -83,7 +83,8 @@ def AddOptions(opts):
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
=
(
'linux'
,
'cell'
,
'windows'
,
'winddk'
,
'wince'
,
'darwin'
,
'embedded'
,
'cygwin'
,
'sunos'
,
'freebsd8'
)))
allowed_values
=
(
'linux'
,
'cell'
,
'windows'
,
'winddk'
,
'wince'
,
'darwin'
,
'cygwin'
,
'sunos'
,
'freebsd8'
)))
opts
.
Add
(
BoolOption
(
'embedded'
,
'embedded build'
,
'no'
))
opts
.
Add
(
'toolchain'
,
'compiler toolchain'
,
default_toolchain
)
opts
.
Add
(
BoolOption
(
'gles'
,
'EXPERIMENTAL: enable OpenGL ES support'
,
'no'
))
opts
.
Add
(
BoolOption
(
'llvm'
,
'use LLVM'
,
default_llvm
))
...
...
scons/gallium.py
View file @
41750107
...
...
@@ -247,6 +247,8 @@ def generate(env):
# configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
build_topdir
=
'build'
build_subdir
=
env
[
'platform'
]
if
env
[
'embedded'
]:
build_subdir
=
'embedded-'
+
build_subdir
if
env
[
'machine'
]
!=
'generic'
:
build_subdir
+=
'-'
+
env
[
'machine'
]
if
env
[
'build'
]
!=
'release'
:
...
...
@@ -349,8 +351,8 @@ def generate(env):
if
platform
==
'wince'
:
cppdefines
+=
[
'PIPE_SUBSYSTEM_WINDOWS_CE'
]
cppdefines
+=
[
'PIPE_SUBSYSTEM_WINDOWS_CE_OGL'
]
if
platform
==
'embedded'
:
cppdefines
+=
[
'PIPE_
OS
_EMBEDDED'
]
if
env
[
'embedded'
]
:
cppdefines
+=
[
'PIPE_
SUBSYSTEM
_EMBEDDED'
]
env
.
Append
(
CPPDEFINES
=
cppdefines
)
# C compiler options
...
...
src/gallium/SConscript
View file @
41750107
...
...
@@ -53,7 +53,7 @@ if env['drm']:
# Needed by some state trackers
SConscript
(
'winsys/sw/null/SConscript'
)
if
env
[
'platform'
]
!=
'embedded'
:
if
not
env
[
'embedded'
]
:
SConscript
(
'state_trackers/vega/SConscript'
)
SConscript
(
'state_trackers/egl/SConscript'
)
...
...
@@ -66,8 +66,8 @@ if env['platform'] != 'embedded':
if
env
[
'dri'
]
and
env
[
'xorg'
]:
SConscript
(
'state_trackers/xorg/SConscript'
)
if
env
[
'platform'
]
==
'windows'
:
SConscript
(
'state_trackers/wgl/SConscript'
)
if
env
[
'platform'
]
==
'windows'
:
SConscript
(
'state_trackers/wgl/SConscript'
)
#
# Winsys
...
...
@@ -83,55 +83,55 @@ SConscript([
'targets/graw-null/SConscript'
,
])
if
env
[
'platform'
]
!=
'embedded'
:
if
not
env
[
'embedded'
]
:
SConscript
([
'targets/egl-static/SConscript'
])
if
env
[
'x11'
]:
SConscript
([
'targets/graw-xlib/SConscript'
,
'targets/libgl-xlib/SConscript'
,
])
if
env
[
'x11'
]:
SConscript
([
'targets/graw-xlib/SConscript'
,
'targets/libgl-xlib/SConscript'
,
])
if
env
[
'platform'
]
==
'windows'
:
SConscript
([
'targets/graw-gdi/SConscript'
,
'targets/libgl-gdi/SConscript'
,
])
if
env
[
'platform'
]
==
'windows'
:
SConscript
([
'targets/graw-gdi/SConscript'
,
'targets/libgl-gdi/SConscript'
,
])
if
env
[
'dri'
]:
SConscript
([
'targets/SConscript.dri'
,
'targets/dri-swrast/SConscript'
,
'targets/dri-vmwgfx/SConscript'
,
#'targets/dri-nouveau/SConscript',
])
if
env
[
'drm_intel'
]:
if
env
[
'dri'
]:
SConscript
([
'targets/dri-i915/SConscript'
,
'targets/dri-i965/SConscript'
,
'targets/SConscript.dri'
,
'targets/dri-swrast/SConscript'
,
'targets/dri-vmwgfx/SConscript'
,
#'targets/dri-nouveau/SConscript',
])
if
env
[
'drm_radeon'
]:
if
env
[
'drm_intel'
]:
SConscript
([
'targets/dri-i915/SConscript'
,
'targets/dri-i965/SConscript'
,
])
if
env
[
'drm_radeon'
]:
SConscript
([
'targets/dri-r300/SConscript'
,
'targets/dri-r600/SConscript'
,
])
if
env
[
'xorg'
]
and
env
[
'drm'
]:
SConscript
([
'targets/dri-r300/SConscript'
,
'targets/dri-r600/SConscript'
,
#'targets/xorg-i915/SConscript',
#'targets/xorg-i965/SConscript',
#'targets/xorg-nouveau/SConscript',
#'targets/xorg-radeon/SConscript',
'targets/xorg-vmwgfx/SConscript'
,
])
if
env
[
'xorg'
]
and
env
[
'drm'
]:
SConscript
([
#'targets/xorg-i915/SConscript',
#'targets/xorg-i965/SConscript',
#'targets/xorg-nouveau/SConscript',
#'targets/xorg-radeon/SConscript',
'targets/xorg-vmwgfx/SConscript'
,
])
#
# Unit tests & tools
#
if
env
[
'platform'
]
!=
'embedded'
:
if
not
env
[
'embedded'
]
:
SConscript
(
'tests/unit/SConscript'
)
SConscript
(
'tests/graw/SConscript'
)
src/gallium/auxiliary/os/os_memory.h
View file @
41750107
...
...
@@ -39,7 +39,7 @@
#include "pipe/p_compiler.h"
#if defined(PIPE_
OS
_EMBEDDED)
#if defined(PIPE_
SUBSYSTEM
_EMBEDDED)
#ifdef __cplusplus
extern
"C"
{
...
...
src/gallium/auxiliary/os/os_misc.h
View file @
41750107
...
...
@@ -58,8 +58,6 @@ extern "C" {
# define os_break() __debugbreak()
#elif defined(PIPE_OS_UNIX)
# define os_break() kill(getpid(), SIGTRAP)
#elif defined(PIPE_OS_EMBEDDED)
void
os_break
(
void
);
#else
# define os_break() abort()
#endif
...
...
@@ -70,8 +68,6 @@ void os_break(void);
*/
#if defined(DEBUG) || defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) || defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
# define os_abort() os_break()
#elif defined(PIPE_OS_EMBEDDED)
void
os_abort
(
void
);
#else
# define os_abort() abort()
#endif
...
...
src/gallium/auxiliary/os/os_thread.h
View file @
41750107
...
...
@@ -40,7 +40,7 @@
#include "util/u_debug.h"
/* for assert */
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_
EMBEDDED) || defined(PIPE_OS_
CYGWIN)
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
#include <pthread.h>
/* POSIX threads headers */
#include <stdio.h>
/* for perror() */
...
...
@@ -314,7 +314,7 @@ typedef int64_t pipe_condvar;
* pipe_barrier
*/
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
|| defined(PIPE_OS_EMBEDDED)
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
typedef
pthread_barrier_t
pipe_barrier
;
...
...
@@ -442,7 +442,7 @@ pipe_semaphore_wait(pipe_semaphore *sema)
*/
typedef
struct
{
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_
EMBEDDED) || defined(PIPE_OS_
CYGWIN)
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
pthread_key_t
key
;
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
DWORD
key
;
...
...
@@ -457,7 +457,7 @@ typedef struct {
static
INLINE
void
pipe_tsd_init
(
pipe_tsd
*
tsd
)
{
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_
EMBEDDED) || defined(PIPE_OS_
CYGWIN)
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
if
(
pthread_key_create
(
&
tsd
->
key
,
NULL
/*free*/
)
!=
0
)
{
perror
(
"pthread_key_create(): failed to allocate key for thread specific data"
);
exit
(
-
1
);
...
...
@@ -474,7 +474,7 @@ pipe_tsd_get(pipe_tsd *tsd)
if
(
tsd
->
initMagic
!=
(
int
)
PIPE_TSD_INIT_MAGIC
)
{
pipe_tsd_init
(
tsd
);
}
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_
EMBEDDED) || defined(PIPE_OS_
CYGWIN)
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
return
pthread_getspecific
(
tsd
->
key
);
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
assert
(
0
);
...
...
@@ -491,7 +491,7 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
if
(
tsd
->
initMagic
!=
(
int
)
PIPE_TSD_INIT_MAGIC
)
{
pipe_tsd_init
(
tsd
);
}
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_
EMBEDDED) || defined(PIPE_OS_
CYGWIN)
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
if
(
pthread_setspecific
(
tsd
->
key
,
value
)
!=
0
)
{
perror
(
"pthread_set_specific() failed"
);
exit
(
-
1
);
...
...
src/gallium/auxiliary/os/os_time.c
View file @
41750107
...
...
@@ -35,8 +35,6 @@
#include "pipe/p_config.h"
#if !defined(PIPE_OS_EMBEDDED)
#if defined(PIPE_OS_UNIX)
# include <sys/time.h>
/* timeval */
#elif defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
...
...
@@ -123,6 +121,3 @@ os_time_sleep(int64_t usecs)
}
#endif
#endif
/* !PIPE_OS_EMBEDDED */
src/gallium/auxiliary/util/u_debug.c
View file @
41750107
...
...
@@ -48,7 +48,7 @@
void
_debug_vprintf
(
const
char
*
format
,
va_list
ap
)
{
#if defined(PIPE_OS_WINDOWS) || defined(PIPE_
OS
_EMBEDDED)
#if defined(PIPE_OS_WINDOWS) || defined(PIPE_
SUBSYSTEM
_EMBEDDED)
/* We buffer until we find a newline. */
static
char
buf
[
4096
]
=
{
'\0'
};
size_t
len
=
strlen
(
buf
);
...
...
src/gallium/drivers/llvmpipe/SConscript
View file @
41750107
...
...
@@ -79,7 +79,7 @@ llvmpipe = env.ConvenienceLibrary(
env
.
Alias
(
'llvmpipe'
,
llvmpipe
)
if
env
[
'platform'
]
!=
'embedded'
:
if
not
env
[
'embedded'
]
:
env
=
env
.
Clone
()
env
.
Prepend
(
LIBS
=
[
llvmpipe
]
+
gallium
)
...
...
src/gallium/drivers/llvmpipe/lp_screen.c
View file @
41750107
...
...
@@ -423,7 +423,7 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
lp_jit_screen_init
(
screen
);
screen
->
num_threads
=
util_cpu_caps
.
nr_cpus
>
1
?
util_cpu_caps
.
nr_cpus
:
0
;
#ifdef PIPE_
OS
_EMBEDDED
#ifdef PIPE_
SUBSYSTEM
_EMBEDDED
screen
->
num_threads
=
0
;
#endif
screen
->
num_threads
=
debug_get_num_option
(
"LP_NUM_THREADS"
,
screen
->
num_threads
);
...
...
src/gallium/include/pipe/p_config.h
View file @
41750107
...
...
@@ -134,8 +134,6 @@
#error Unknown Endianness
#endif
#if !defined(PIPE_OS_EMBEDDED)
/*
* Auto-detect the operating system family.
*
...
...
@@ -222,7 +220,5 @@
#endif
#endif
/* PIPE_OS_WINDOWS */
#endif
/* !PIPE_OS_EMBEDDED */
#endif
/* P_CONFIG_H_ */
src/glsl/SConscript
View file @
41750107
...
...
@@ -102,7 +102,7 @@ if env['msvc']:
env
.
Prepend
(
CPPPATH
=
[
'#/src/getopt'
])
env
.
PrependUnique
(
LIBS
=
[
getopt
])
if
env
[
'crosscompile'
]
and
env
[
'platform'
]
!=
'embedded'
:
if
env
[
'crosscompile'
]
and
not
env
[
'embedded'
]
:
Import
(
'builtin_glsl_function'
)
else
:
# Copy these files to avoid generation object files into src/mesa/program
...
...
@@ -156,7 +156,7 @@ Export('glsl')
# Skip building these programs as they will cause SCons error "Two environments
# with different actions were specified for the same target"
if
env
[
'crosscompile'
]
or
env
[
'
platform'
]
==
'embedded'
:
if
env
[
'crosscompile'
]
or
env
[
'
embedded'
]
:
Return
()
env
=
env
.
Clone
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment