Exemplo n.º 1
0
def checkPthreads(context):
    context.Message("Checking for threads... ")
    if utils.useAndroid() or utils.useAndroidX86():
        context.Message(" android threads")
        context.Result(utils.colorResult(1))
        return 1
    if utils.useAllegro():
        env = context.env
        env.Append(LIBS = ['pthread'])
        context.Message(" pthreads")
        context.Result(utils.colorResult(1))
        return 1
    if utils.useAllegro5():
        env = context.env
        env.Append(LIBS = ['pthread'])
        context.Message(' pthreads')
        context.Result(utils.colorResult(1))
        return 1
    if utils.useSDL():
        # context.Message(" SDL threads")
        env = context.env
        env.Append(LIBS = ['pthread'])
        context.Message(' pthreads')
        context.Result(utils.colorResult(1))
        return 1
    context.Message(" defaulting to pthreads")
    context.Result(utils.colorResult(1))
    return 1
Exemplo n.º 2
0
def checkSDLMain(context):
    context.Message("Checking for SDL main... ")
    tmp = context.env.Clone()
    env = context.env

    env['HAVE_SDL_MAIN'] = False

    ok = False
    if utils.useAndroid():
        ok = True
    else:
        ok = context.TryLink("""
#include <SDL.h>
int SDL_main(int argc, char ** argv){
    return 0;
}
""", ".c")

    if not ok:
        context.sconf.env = tmp
    else:
        env.Append(CPPDEFINES = ['USE_SDL_MAIN'])
        env['HAVE_SDL_MAIN'] = True
    
    context.Result(utils.colorResult(ok))
    return ok