To enable embedding in platforms other than linux.
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 = [
#
# 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
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))
# 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':
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
# 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')
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
'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')
#include "pipe/p_compiler.h"
-#if defined(PIPE_OS_EMBEDDED)
+#if defined(PIPE_SUBSYSTEM_EMBEDDED)
#ifdef __cplusplus
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
*/
#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
#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() */
* 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;
*/
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;
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);
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);
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);
#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)
}
#endif
-
-
-#endif /* !PIPE_OS_EMBEDDED */
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);
env.Alias('llvmpipe', llvmpipe)
-if env['platform'] != 'embedded':
+if not env['embedded']:
env = env.Clone()
env.Prepend(LIBS = [llvmpipe] + gallium)
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);
#error Unknown Endianness
#endif
-#if !defined(PIPE_OS_EMBEDDED)
-
/*
* Auto-detect the operating system family.
*
#endif
#endif /* PIPE_OS_WINDOWS */
-#endif /* !PIPE_OS_EMBEDDED */
-
#endif /* P_CONFIG_H_ */
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
# 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()