Index: SCons/Config/gnu =================================================================== RCS file: /cvsroot/nsis/NSIS/SCons/Config/gnu,v retrieving revision 1.24 diff -u -r1.24 gnu --- SCons/Config/gnu 5 Oct 2005 13:47:12 -0000 1.24 +++ SCons/Config/gnu 8 Nov 2005 19:21:40 -0000 @@ -178,6 +178,36 @@ conf.Finish() +# +# Some platforms, like FreeBSD, require -pthread flag to be passed +# instead of -lpthread. +# + +def check_pthread(ctx): + ctx.Message('Checking for -pthread... ') + + last_flags = ctx.env['LINKFLAGS'] + + ctx.env.Append(LINKFLAGS = '-pthread') + + test = """ + int __main() { + return 0; + } + """ + + result = not ctx.TryLink(test, '.c') + ctx.Result(result) + + ctx.env.Replace(LINKFLAGS = last_flags) + + return result + +conf = defenv.Configure(custom_tests = { 'CheckPThread' : check_pthread }) +if conf.CheckPThread(): + makensis_env.Append(LINKFLAGS = '-pthread') +conf.Finish() + ### return Return('stub_env makensis_env plugin_env util_env cp_util_env') Index: Source/SConscript =================================================================== RCS file: /cvsroot/nsis/NSIS/Source/SConscript,v retrieving revision 1.7 diff -u -r1.7 SConscript --- Source/SConscript 24 Sep 2005 15:49:38 -0000 1.7 +++ Source/SConscript 8 Nov 2005 19:27:46 -0000 @@ -48,7 +48,6 @@ libs = Split(""" gdi32 user32 - version pthread stdc++ iconv @@ -58,6 +57,11 @@ ##### Use available libraries +if env['PLATFORM'] == 'win32': + # XXX will cause problems if makensis is cross compiled + # on freebsd, libversion.a exists and gives trouble if linked + libs += ['version'] + AddAvailableLibs(env, libs) ##### Configuration defines Index: Source/mmap.cpp =================================================================== RCS file: /cvsroot/nsis/NSIS/Source/mmap.cpp,v retrieving revision 1.2 diff -u -r1.2 mmap.cpp --- Source/mmap.cpp 16 Sep 2005 11:27:51 -0000 1.2 +++ Source/mmap.cpp 8 Nov 2005 18:00:08 -0000 @@ -3,6 +3,7 @@ #include // for f* #include // for assert #ifndef _WIN32 +# include # include # include # include