scons: make embedding orthogonal to the platform
To enable embedding in platforms other than linux.
This commit is contained in:
parent
fc8c4a3a7b
commit
4175010749
19
SConstruct
19
SConstruct
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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['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['x11']:
|
||||
SConscript([
|
||||
'targets/dri-i915/SConscript',
|
||||
'targets/dri-i965/SConscript',
|
||||
])
|
||||
if env['drm_radeon']:
|
||||
SConscript([
|
||||
'targets/dri-r300/SConscript',
|
||||
'targets/dri-r600/SConscript',
|
||||
'targets/graw-xlib/SConscript',
|
||||
'targets/libgl-xlib/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',
|
||||
])
|
||||
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']:
|
||||
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/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')
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "pipe/p_compiler.h"
|
||||
|
||||
|
||||
#if defined(PIPE_OS_EMBEDDED)
|
||||
#if defined(PIPE_SUBSYSTEM_EMBEDDED)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue