freebsd portability
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4379 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
1be656417f
commit
a70e478d6e
3 changed files with 36 additions and 1 deletions
|
@ -178,6 +178,36 @@ if conf.CheckRequirement('memset', 'char c[128] = "test";'):
|
||||||
|
|
||||||
conf.Finish()
|
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
|
||||||
|
|
||||||
Return('stub_env makensis_env plugin_env util_env cp_util_env')
|
Return('stub_env makensis_env plugin_env util_env cp_util_env')
|
||||||
|
|
|
@ -48,7 +48,6 @@ zlib_files = Split("""
|
||||||
libs = Split("""
|
libs = Split("""
|
||||||
gdi32
|
gdi32
|
||||||
user32
|
user32
|
||||||
version
|
|
||||||
pthread
|
pthread
|
||||||
stdc++
|
stdc++
|
||||||
iconv
|
iconv
|
||||||
|
@ -58,6 +57,11 @@ Import('env AddAvailableLibs')
|
||||||
|
|
||||||
##### Use available libraries
|
##### 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)
|
AddAvailableLibs(env, libs)
|
||||||
|
|
||||||
##### Configuration defines
|
##### Configuration defines
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include <cstdio> // for f*
|
#include <cstdio> // for f*
|
||||||
#include <cassert> // for assert
|
#include <cassert> // for assert
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
# include <sys/types.h> // for freebsd
|
||||||
# include <sys/mman.h>
|
# include <sys/mman.h>
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue