libuv/uv.gyp

357 lines
9.8 KiB
Plaintext
Raw Normal View History

2011-08-14 05:56:11 +00:00
{
'variables': {
'conditions': [
['OS=="win"', {
'shared_unix_defines': [ ],
}, {
'shared_unix_defines': [
'_LARGEFILE_SOURCE',
'_FILE_OFFSET_BITS=64',
],
}],
['OS in "mac ios"', {
'shared_mac_defines': [ '_DARWIN_USE_64_BIT_INODE=1' ],
}, {
'shared_mac_defines': [ ],
}],
['OS=="zos"', {
'shared_zos_defines': [
'_UNIX03_THREADS',
'_UNIX03_SOURCE',
'_UNIX03_WITHDRAWN',
'_OPEN_SYS_IF_EXT',
'_OPEN_SYS_SOCK_IPV6',
'_OPEN_MSGQ_EXT',
'_XOPEN_SOURCE_EXTENDED',
'_ALL_SOURCE',
'_LARGE_TIME_API',
'_OPEN_SYS_FILE_EXT',
'_AE_BIMODAL',
'PATH_MAX=255'
],
}, {
'shared_zos_defines': [ ],
}],
],
},
2011-08-14 05:56:11 +00:00
'targets': [
{
2012-10-11 12:32:06 +00:00
'target_name': 'libuv',
'type': '<(uv_library)',
2011-08-29 22:03:42 +00:00
'include_dirs': [
'include',
'src/',
],
'defines': [
'<@(shared_mac_defines)',
'<@(shared_unix_defines)',
'<@(shared_zos_defines)',
],
2011-08-14 05:56:11 +00:00
'direct_dependent_settings': {
'defines': [
'<@(shared_mac_defines)',
'<@(shared_unix_defines)',
'<@(shared_zos_defines)',
],
2011-08-14 05:56:11 +00:00
'include_dirs': [ 'include' ],
2012-03-05 14:28:27 +00:00
'conditions': [
['OS == "linux"', {
'defines': [ '_POSIX_C_SOURCE=200112' ],
}],
2012-03-05 14:28:27 +00:00
],
2011-08-14 05:56:11 +00:00
},
'sources': [
'common.gypi',
2011-08-14 05:56:11 +00:00
'include/uv.h',
'include/uv/tree.h',
'include/uv/errno.h',
'include/uv/threadpool.h',
'include/uv/version.h',
'src/fs-poll.c',
'src/heap-inl.h',
'src/idna.c',
'src/idna.h',
'src/inet.c',
'src/queue.h',
'src/strscpy.c',
'src/strscpy.h',
'src/threadpool.c',
'src/timer.c',
'src/uv-data-getter-setters.c',
2011-08-14 05:56:11 +00:00
'src/uv-common.c',
'src/uv-common.h',
'src/version.c'
2011-08-14 05:56:11 +00:00
],
'xcode_settings': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
'WARNING_CFLAGS': [
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wstrict-prototypes',
],
'OTHER_CFLAGS': [ '-g', '--std=gnu89', '-pedantic' ],
},
2011-08-14 05:56:11 +00:00
'conditions': [
[ 'OS=="win"', {
'defines': [
'_WIN32_WINNT=0x0600',
2011-08-14 05:56:11 +00:00
'_GNU_SOURCE',
],
'sources': [
'include/uv/win.h',
2011-08-14 05:56:11 +00:00
'src/win/async.c',
'src/win/atomicops-inl.h',
2011-08-14 05:56:11 +00:00
'src/win/core.c',
'src/win/detect-wakeup.c',
2011-10-28 22:45:47 +00:00
'src/win/dl.c',
2011-08-14 05:56:11 +00:00
'src/win/error.c',
2011-08-19 23:46:42 +00:00
'src/win/fs.c',
2011-09-16 19:04:36 +00:00
'src/win/fs-event.c',
2011-08-14 05:56:11 +00:00
'src/win/getaddrinfo.c',
'src/win/getnameinfo.c',
2011-08-14 05:56:11 +00:00
'src/win/handle.c',
'src/win/handle-inl.h',
2011-08-14 05:56:11 +00:00
'src/win/internal.h',
'src/win/loop-watcher.c',
'src/win/pipe.c',
'src/win/thread.c',
2012-04-24 22:25:01 +00:00
'src/win/poll.c',
2011-08-14 05:56:11 +00:00
'src/win/process.c',
'src/win/process-stdio.c',
'src/win/req-inl.h',
'src/win/signal.c',
'src/win/snprintf.c',
2011-08-14 05:56:11 +00:00
'src/win/stream.c',
'src/win/stream-inl.h',
2011-08-14 05:56:11 +00:00
'src/win/tcp.c',
'src/win/tty.c',
2011-08-24 02:31:36 +00:00
'src/win/udp.c',
2011-08-14 05:56:11 +00:00
'src/win/util.c',
'src/win/winapi.c',
'src/win/winapi.h',
'src/win/winsock.c',
'src/win/winsock.h',
2011-08-14 05:56:11 +00:00
],
'link_settings': {
'libraries': [
'-ladvapi32',
'-liphlpapi',
'-lpsapi',
'-lshell32',
'-luser32',
'-luserenv',
'-lws2_32'
2011-08-14 05:56:11 +00:00
],
},
}, { # Not Windows i.e. POSIX
'sources': [
'include/uv/unix.h',
'include/uv/linux.h',
'include/uv/sunos.h',
'include/uv/darwin.h',
'include/uv/bsd.h',
'include/uv/aix.h',
'src/unix/async.c',
'src/unix/atomic-ops.h',
2012-04-04 03:12:02 +00:00
'src/unix/core.c',
2011-10-28 22:45:47 +00:00
'src/unix/dl.c',
2012-04-04 03:12:02 +00:00
'src/unix/fs.c',
'src/unix/getaddrinfo.c',
'src/unix/getnameinfo.c',
2012-04-04 03:12:02 +00:00
'src/unix/internal.h',
'src/unix/loop.c',
'src/unix/loop-watcher.c',
2012-04-04 03:12:02 +00:00
'src/unix/pipe.c',
2012-05-02 23:43:56 +00:00
'src/unix/poll.c',
2012-04-04 03:12:02 +00:00
'src/unix/process.c',
'src/unix/signal.c',
'src/unix/spinlock.h',
2012-04-04 03:12:02 +00:00
'src/unix/stream.c',
'src/unix/tcp.c',
'src/unix/thread.c',
'src/unix/tty.c',
'src/unix/udp.c',
2011-08-14 05:56:11 +00:00
],
'link_settings': {
'libraries': [ '-lm' ],
'conditions': [
['OS=="solaris"', {
'ldflags': [ '-pthreads' ],
}],
[ 'OS=="zos" and uv_library=="shared_library"', {
'ldflags': [ '-Wl,DLL' ],
}],
['OS != "solaris" and OS != "android" and OS != "zos"', {
'ldflags': [ '-pthread' ],
}],
],
},
'conditions': [
['uv_library=="shared_library"', {
'conditions': [
['OS=="zos"', {
'cflags': [ '-qexportall' ],
}, {
'cflags': [ '-fPIC' ],
}],
],
}],
['uv_library=="shared_library" and OS!="mac" and OS!="zos"', {
# This will cause gyp to set soname
# Must correspond with UV_VERSION_MAJOR
# in include/uv/version.h
'product_extension': 'so.1',
2013-05-12 12:48:58 +00:00
}],
],
2011-08-14 05:56:11 +00:00
}],
[ 'OS in "linux mac ios android zos"', {
'sources': [ 'src/unix/proctitle.c' ],
}],
[ 'OS != "zos"', {
'cflags': [
'-fvisibility=hidden',
'-g',
'--std=gnu89',
'-pedantic',
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wstrict-prototypes',
],
}],
[ 'OS in "mac ios"', {
'sources': [
'src/unix/darwin.c',
'src/unix/fsevents.c',
'src/unix/darwin-proctitle.c'
],
2011-08-14 05:56:11 +00:00
'defines': [
'_DARWIN_USE_64_BIT_INODE=1',
'_DARWIN_UNLIMITED_SELECT=1',
2011-08-14 05:56:11 +00:00
]
}],
[ 'OS=="linux"', {
'defines': [ '_GNU_SOURCE' ],
'sources': [
'src/unix/linux-core.c',
'src/unix/linux-inotify.c',
'src/unix/linux-syscalls.c',
'src/unix/linux-syscalls.h',
'src/unix/procfs-exepath.c',
'src/unix/sysinfo-loadavg.c',
],
'link_settings': {
'libraries': [ '-ldl', '-lrt' ],
2011-08-14 05:56:11 +00:00
},
}],
[ 'OS=="android"', {
'sources': [
'src/unix/linux-core.c',
'src/unix/linux-inotify.c',
'src/unix/linux-syscalls.c',
'src/unix/linux-syscalls.h',
'src/unix/pthread-fixes.c',
'src/unix/android-ifaddrs.c',
'src/unix/procfs-exepath.c',
'src/unix/sysinfo-loadavg.c',
'src/unix/sysinfo-memory.c',
],
'link_settings': {
'libraries': [ '-ldl' ],
},
}],
2011-09-01 01:14:33 +00:00
[ 'OS=="solaris"', {
'sources': [
'src/unix/no-proctitle.c',
'src/unix/sunos.c',
],
2011-09-01 01:14:33 +00:00
'defines': [
'__EXTENSIONS__',
'_XOPEN_SOURCE=500',
],
'link_settings': {
2011-10-02 00:14:44 +00:00
'libraries': [
2011-10-10 20:47:07 +00:00
'-lkstat',
2011-10-02 00:14:44 +00:00
'-lnsl',
'-lsendfile',
'-lsocket',
2011-10-02 00:14:44 +00:00
],
2011-09-01 01:14:33 +00:00
},
}],
[ 'OS=="aix"', {
'variables': {
'os_name': '<!(uname -s)',
},
'sources': [
'src/unix/aix-common.c',
],
'defines': [
'_ALL_SOURCE',
'_XOPEN_SOURCE=500',
2014-04-23 18:26:42 +00:00
'_LINUX_SOURCE_COMPAT',
'_THREAD_SAFE',
],
'conditions': [
[ '"<(os_name)"=="OS400"', {
'sources': [
'src/unix/ibmi.c',
'src/unix/posix-poll.c',
'src/unix/no-fsevents.c',
'src/unix/no-proctitle.c',
],
}, {
'sources': [
'src/unix/aix.c'
],
'defines': [
'HAVE_SYS_AHAFS_EVPRODS_H'
],
'link_settings': {
'libraries': [
'-lperfstat',
],
},
}],
]
}],
[ 'OS=="freebsd" or OS=="dragonflybsd"', {
2011-08-17 04:40:17 +00:00
'sources': [ 'src/unix/freebsd.c' ],
}],
2011-10-13 03:38:13 +00:00
[ 'OS=="openbsd"', {
'sources': [ 'src/unix/openbsd.c' ],
2011-08-17 04:40:17 +00:00
}],
2012-09-08 12:34:14 +00:00
[ 'OS=="netbsd"', {
'link_settings': {
'libraries': [ '-lkvm' ],
2012-09-08 12:34:14 +00:00
},
'sources': [ 'src/unix/netbsd.c' ],
}],
[ 'OS in "freebsd dragonflybsd openbsd netbsd".split()', {
'sources': [
'src/unix/posix-hrtime.c',
'src/unix/bsd-proctitle.c'
],
2012-09-08 12:34:14 +00:00
}],
[ 'OS in "ios mac freebsd dragonflybsd openbsd netbsd".split()', {
'sources': [
'src/unix/bsd-ifaddrs.c',
'src/unix/kqueue.c',
],
}],
['uv_library=="shared_library"', {
'defines': [ 'BUILDING_UV_SHARED=1' ]
}],
['OS=="zos"', {
'sources': [
'src/unix/pthread-fixes.c',
'src/unix/os390.c',
'src/unix/os390-syscalls.c'
]
}],
2011-08-14 05:56:11 +00:00
]
},
]
}