#!/usr/local/bin/python3.10

def configure(conf):
    AR32 = ['i386', 'i586', 'i686']
    AR64 = ['x86_64', 'amd64']
    TC = ['mingw32', 'mingw32msvc', 'w64-mingw32']

    found = False

    for a in AR32:
        for t in TC:
            if conf.find_program(a + '-' + t + '-gcc', var='WINEXE_CC_WIN32'):
                found = True
                break
        if found:
            conf.DEFINE('HAVE_WINEXE_CC_WIN32', 1);
            break

    found = False

    for a in AR64:
        for t in TC:
            if conf.find_program(a + '-' + t + '-gcc', var='WINEXE_CC_WIN64'):
                found = True
                break
        if found:
            conf.DEFINE('HAVE_WINEXE_CC_WIN64', 1);
            break

    conf.DEFINE("WINEXE_LDFLAGS",
                "-s -Wall -Wl,-Bstatic -Wl,-Bdynamic -luserenv")
