diff --git a/source/creator/SConscript b/source/creator/SConscript index a4c218f89d6..15f73040f4b 100644 --- a/source/creator/SConscript +++ b/source/creator/SConscript @@ -22,4 +22,7 @@ if env['WITH_BF_BINRELOC']==1: if env['WITH_BF_OPENEXR']==1: defs.append('WITH_OPENEXR') +if not env['WITH_BF_SDL']: + defs.append('DISABLE_SDL') + env.BlenderLib ( libname = 'blender_creator', sources = Split(sources), includes = Split(incs), defines = defs, libtype='core', priority = 1 ) diff --git a/source/creator/creator.c b/source/creator/creator.c index 38c37575bd1..b5360b31a0a 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -237,8 +237,10 @@ static void print_help(void) printf (" $TEMP\t\tStore temporary files here.\n"); #else printf (" $TMP or $TMPDIR\tStore temporary files here.\n"); - printf (" $SDL_AUDIODRIVER\tLibSDL audio driver - alsa, esd, alsa, dma.\n"); printf (" $BF_TIFF_LIB\t\tUse an alternative libtiff.so for loading tiff image files.\n"); +#endif +#ifndef DISABLE_SDL + printf (" $SDL_AUDIODRIVER\tLibSDL audio driver - alsa, esd, alsa, dma.\n"); #endif printf (" $IMAGEEDITOR\t\tImage editor executable, launch with the IKey from the file selector.\n"); printf (" $WINEDITOR\t\tText editor executable, launch with the EKey from the file selector.\n"); @@ -326,10 +328,6 @@ int main(int argc, char **argv) #ifdef __linux__ #ifdef __alpha__ signal (SIGFPE, fpe_handler); - #else - if ( getenv("SDL_AUDIODRIVER") == NULL) { - setenv("SDL_AUDIODRIVER", "alsa", 1); - } #endif #endif #if defined(__sgi) @@ -432,7 +430,7 @@ int main(int argc, char **argv) /* for all platforms, even windos has it! */ if(G.background) signal(SIGINT, blender_esc); /* ctrl c out bg render */ - + /* background render uses this font too */ BKE_font_register_builtin(datatoc_Bfont, datatoc_Bfont_size); @@ -530,6 +528,15 @@ int main(int argc, char **argv) BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */ +#ifndef DISABLE_SDL +#ifdef __linux__ + /* On linux the default SDL driver dma often would not play + * use alsa if none is set */ + if ( getenv("SDL_AUDIODRIVER") == NULL) { + setenv("SDL_AUDIODRIVER", "alsa", 1); + } +#endif +#endif } else { BPY_start_python(argc, argv);