From e89f54ece4e0f6d1da98f50444bb1d6be70c7b97 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 13 Aug 2011 22:56:11 -0700 Subject: [PATCH] Add forgotten gyp files --- deps/pthread-win32/pthread-win32.gyp | 165 +++++++++++++++ uv.gyp | 301 +++++++++++++++++++++++++++ 2 files changed, 466 insertions(+) create mode 100644 deps/pthread-win32/pthread-win32.gyp create mode 100644 uv.gyp diff --git a/deps/pthread-win32/pthread-win32.gyp b/deps/pthread-win32/pthread-win32.gyp new file mode 100644 index 00000000..2c4c6529 --- /dev/null +++ b/deps/pthread-win32/pthread-win32.gyp @@ -0,0 +1,165 @@ +{ + 'targets': [ + { + 'target_name': 'pthread-win32', + 'type': '<(library)', + 'include_dirs': [ + '.' + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '.' + ], + }, + 'conditions': [ + ['OS=="win"', { + 'defines': [ + 'HAVE_PTW32_CONFIG_H', + '__CLEANUP_C' + ], + 'sources': [ + 'autostatic.c', + 'cleanup.c', + 'create.c', + 'dll.c', + 'errno.c', + 'fork.c', + 'global.c', + 'pthread_attr_destroy.c', + 'pthread_attr_getdetachstate.c', + 'pthread_attr_getinheritsched.c', + 'pthread_attr_getschedparam.c', + 'pthread_attr_getschedpolicy.c', + 'pthread_attr_getscope.c', + 'pthread_attr_getstackaddr.c', + 'pthread_attr_getstacksize.c', + 'pthread_attr_init.c', + 'pthread_attr_setdetachstate.c', + 'pthread_attr_setinheritsched.c', + 'pthread_attr_setschedparam.c', + 'pthread_attr_setschedpolicy.c', + 'pthread_attr_setscope.c', + 'pthread_attr_setstackaddr.c', + 'pthread_attr_setstacksize.c', + 'pthread_barrierattr_destroy.c', + 'pthread_barrierattr_getpshared.c', + 'pthread_barrierattr_init.c', + 'pthread_barrierattr_setpshared.c', + 'pthread_barrier_destroy.c', + 'pthread_barrier_init.c', + 'pthread_barrier_wait.c', + 'pthread_cancel.c', + 'pthread_condattr_destroy.c', + 'pthread_condattr_getpshared.c', + 'pthread_condattr_init.c', + 'pthread_condattr_setpshared.c', + 'pthread_cond_destroy.c', + 'pthread_cond_init.c', + 'pthread_cond_signal.c', + 'pthread_cond_wait.c', + 'pthread_delay_np.c', + 'pthread_detach.c', + 'pthread_equal.c', + 'pthread_exit.c', + 'pthread_getconcurrency.c', + 'pthread_getschedparam.c', + 'pthread_getspecific.c', + 'pthread_getunique_np.c', + 'pthread_getw32threadhandle_np.c', + 'pthread_join.c', + 'pthread_key_create.c', + 'pthread_key_delete.c', + 'pthread_kill.c', + 'pthread_mutexattr_destroy.c', + 'pthread_mutexattr_getkind_np.c', + 'pthread_mutexattr_getpshared.c', + 'pthread_mutexattr_getrobust.c', + 'pthread_mutexattr_gettype.c', + 'pthread_mutexattr_init.c', + 'pthread_mutexattr_setkind_np.c', + 'pthread_mutexattr_setpshared.c', + 'pthread_mutexattr_setrobust.c', + 'pthread_mutexattr_settype.c', + 'pthread_mutex_consistent.c', + 'pthread_mutex_destroy.c', + 'pthread_mutex_init.c', + 'pthread_mutex_lock.c', + 'pthread_mutex_timedlock.c', + 'pthread_mutex_trylock.c', + 'pthread_mutex_unlock.c', + 'pthread_num_processors_np.c', + 'pthread_once.c', + 'pthread_rwlockattr_destroy.c', + 'pthread_rwlockattr_getpshared.c', + 'pthread_rwlockattr_init.c', + 'pthread_rwlockattr_setpshared.c', + 'pthread_rwlock_destroy.c', + 'pthread_rwlock_init.c', + 'pthread_rwlock_rdlock.c', + 'pthread_rwlock_timedrdlock.c', + 'pthread_rwlock_timedwrlock.c', + 'pthread_rwlock_tryrdlock.c', + 'pthread_rwlock_trywrlock.c', + 'pthread_rwlock_unlock.c', + 'pthread_rwlock_wrlock.c', + 'pthread_self.c', + 'pthread_setcancelstate.c', + 'pthread_setcanceltype.c', + 'pthread_setconcurrency.c', + 'pthread_setschedparam.c', + 'pthread_setspecific.c', + 'pthread_spin_destroy.c', + 'pthread_spin_init.c', + 'pthread_spin_lock.c', + 'pthread_spin_trylock.c', + 'pthread_spin_unlock.c', + 'pthread_testcancel.c', + 'pthread_timechange_handler_np.c', + 'pthread_win32_attach_detach_np.c', + 'ptw32_calloc.c', + 'ptw32_callUserDestroyRoutines.c', + 'ptw32_cond_check_need_init.c', + 'ptw32_getprocessors.c', + 'ptw32_is_attr.c', + 'ptw32_MCS_lock.c', + 'ptw32_mutex_check_need_init.c', + 'ptw32_new.c', + 'ptw32_processInitialize.c', + 'ptw32_processTerminate.c', + 'ptw32_relmillisecs.c', + 'ptw32_reuse.c', + 'ptw32_rwlock_cancelwrwait.c', + 'ptw32_rwlock_check_need_init.c', + 'ptw32_semwait.c', + 'ptw32_spinlock_check_need_init.c', + 'ptw32_threadDestroy.c', + 'ptw32_threadStart.c', + 'ptw32_throw.c', + 'ptw32_timespec.c', + 'ptw32_tkAssocCreate.c', + 'ptw32_tkAssocDestroy.c', + 'sched_getscheduler.c', + 'sched_get_priority_max.c', + 'sched_get_priority_min.c', + 'sched_setscheduler.c', + 'sched_yield.c', + 'sem_close.c', + 'sem_destroy.c', + 'sem_getvalue.c', + 'sem_init.c', + 'sem_open.c', + 'sem_post.c', + 'sem_post_multiple.c', + 'sem_timedwait.c', + 'sem_trywait.c', + 'sem_unlink.c', + 'sem_wait.c', + 'signal.c', + 'w32_CancelableWait.c', + ], + }] + ], + }, + ] +} + diff --git a/uv.gyp b/uv.gyp new file mode 100644 index 00000000..5a573714 --- /dev/null +++ b/uv.gyp @@ -0,0 +1,301 @@ +{ + 'targets': [ + { + 'target_name': 'uv', + 'type': '<(library)', + 'include_dirs': [ 'include' ], + 'direct_dependent_settings': { + 'include_dirs': [ 'include' ], + }, + + 'defines': [ + 'HAVE_CONFIG_H' + ], + 'sources': [ + 'include/ares.h', + 'include/ares_version.h', + 'include/uv.h', + 'src/uv-common.c', + 'src/uv-common.h', + 'src/ares/ares__close_sockets.c', + 'src/ares/ares__get_hostent.c', + 'src/ares/ares__read_line.c', + 'src/ares/ares__timeval.c', + 'src/ares/ares_cancel.c', + 'src/ares/ares_data.c', + 'src/ares/ares_data.h', + 'src/ares/ares_destroy.c', + 'src/ares/ares_dns.h', + 'src/ares/ares_expand_name.c', + 'src/ares/ares_expand_string.c', + 'src/ares/ares_fds.c', + 'src/ares/ares_free_hostent.c', + 'src/ares/ares_free_string.c', + 'src/ares/ares_gethostbyaddr.c', + 'src/ares/ares_gethostbyname.c', + 'src/ares/ares_getnameinfo.c', + 'src/ares/ares_getopt.c', + 'src/ares/ares_getopt.h', + 'src/ares/ares_getsock.c', + 'src/ares/ares_init.c', + 'src/ares/ares_ipv6.h', + 'src/ares/ares_library_init.c', + 'src/ares/ares_library_init.h', + 'src/ares/ares_llist.c', + 'src/ares/ares_llist.h', + 'src/ares/ares_mkquery.c', + 'src/ares/ares_nowarn.c', + 'src/ares/ares_nowarn.h', + 'src/ares/ares_options.c', + 'src/ares/ares_parse_a_reply.c', + 'src/ares/ares_parse_aaaa_reply.c', + 'src/ares/ares_parse_mx_reply.c', + 'src/ares/ares_parse_ns_reply.c', + 'src/ares/ares_parse_ptr_reply.c', + 'src/ares/ares_parse_srv_reply.c', + 'src/ares/ares_parse_txt_reply.c', + 'src/ares/ares_private.h', + 'src/ares/ares_process.c', + 'src/ares/ares_query.c', + 'src/ares/ares_rules.h', + 'src/ares/ares_search.c', + 'src/ares/ares_send.c', + 'src/ares/ares_setup.h', + 'src/ares/ares_strcasecmp.c', + 'src/ares/ares_strcasecmp.h', + 'src/ares/ares_strdup.c', + 'src/ares/ares_strdup.h', + 'src/ares/ares_strerror.c', + 'src/ares/ares_timeout.c', + 'src/ares/ares_version.c', + 'src/ares/ares_writev.c', + 'src/ares/ares_writev.h', + 'src/ares/bitncmp.c', + 'src/ares/bitncmp.h', + 'src/ares/inet_net_pton.c', + 'src/ares/inet_net_pton.h', + 'src/ares/inet_ntop.c', + 'src/ares/inet_ntop.h', + 'src/ares/nameser.h', + 'src/ares/setup_once.h', + ], + 'conditions': [ + [ 'OS=="win"', { + 'include_dirs': [ + 'src/ares/config_win32' + ], + 'sources': [ 'src/ares/windows_port.c' ], + 'defines': [ + '_WIN32_WINNT=0x0502', + 'EIO_STACKSIZE=262144', + '_GNU_SOURCE', + ], + 'sources': [ + 'include/tree.h', + 'include/uv-win.h', + 'src/ares/config_win32/ares_config.h', + 'src/win/async.c', + 'src/win/cares.c', + 'src/win/core.c', + 'src/win/error.c', + 'src/win/getaddrinfo.c', + 'src/win/handle.c', + 'src/win/internal.h', + 'src/win/loop-watcher.c', + 'src/win/ntdll.h', + 'src/win/pipe.c', + 'src/win/process.c', + 'src/win/req.c', + 'src/win/stdio.c', + 'src/win/stream.c', + 'src/win/tcp.c', + 'src/win/timer.c', + 'src/win/util.c', + 'src/win/winapi.c', + ], + 'link_settings': { + 'libraries': [ + '-lws2_32.lib', + ], + }, + }, { # Not Windows i.e. POSIX + 'cflags': [ + '-g', + '--std=gnu89', + '-pedantic', + '-Wall', + '-Wextra', + '-Wno-unused-parameter' + ], + 'sources': [ + 'include/eio.h', + 'include/ev.h', + 'include/ngx-queue.h', + 'include/uv-unix.h', + 'src/uv-eio.c', + 'src/uv-eio.h', + 'src/uv-unix.c', + 'src/ares/config_cygwin/ares_config.h', + 'src/ares/config_darwin/ares_config.h', + 'src/ares/config_freebsd/ares_config.h', + 'src/ares/config_linux/ares_config.h', + 'src/ares/config_openbsd/ares_config.h', + 'src/ares/config_sunos/ares_config.h', + 'src/eio/config_cygwin.h', + 'src/eio/config_darwin.h', + 'src/eio/config_freebsd.h', + 'src/eio/config_linux.h', + 'src/eio/config_sunos.h', + 'src/eio/ecb.h', + 'src/eio/eio.c', + 'src/eio/xthread.h', + 'src/ev/config_cygwin.h', + 'src/ev/config_darwin.h', + 'src/ev/config_freebsd.h', + 'src/ev/config_linux.h', + 'src/ev/config_sunos.h', + 'src/ev/ev.c', + 'src/ev/ev_vars.h', + 'src/ev/ev_wrap.h', + 'src/ev/event.h', + ], + 'include_dirs': [ + 'src/ev' + ], + 'defines': [ + '_LARGEFILE_SOURCE', + '_FILE_OFFSET_BITS=64', + '_GNU_SOURCE', + 'EIO_STACKSIZE=262144' + ], + 'libraries': [ '-lm' ] + }], + [ 'OS=="mac"', { + 'include_dirs': [ 'src/ares/config_darwin' ], + 'sources': [ 'src/uv-darwin.c' ], + 'direct_dependent_settings': { + 'libraries': [ '-framework CoreServices' ], + }, + 'defines': [ + 'EV_CONFIG_H="config_darwin.h"', + 'EIO_CONFIG_H="config_darwin.h"', + ] + }], + [ 'OS=="linux"', { + 'include_dirs': [ 'src/ares/config_linux' ], + 'sources': [ 'src/uv-linux.c' ], + 'defines': [ + 'EV_CONFIG_H="config_linux.h"', + 'EIO_CONFIG_H="config_linux.h"', + ], + 'direct_dependent_settings': { + 'libraries': [ '-lrt' ], + }, + }], + # TODO add OS=='sun' + ] + }, + + { + 'target_name': 'run-tests', + 'type': 'executable', + 'dependencies': [ 'uv' ], + 'sources': [ + 'test/echo-server.c', + 'test/run-tests.c', + 'test/runner.c', + 'test/runner.h', + 'test/task.h', + 'test/test-async.c', + 'test/test-callback-stack.c', + 'test/test-connection-fail.c', + 'test/test-delayed-accept.c', + 'test/test-fail-always.c', + 'test/test-get-currentexe.c', + 'test/test-getaddrinfo.c', + 'test/test-gethostbyname.c', + 'test/test-getsockname.c', + 'test/test-hrtime.c', + 'test/test-idle.c', + 'test/test-list.h', + 'test/test-loop-handles.c', + 'test/test-pass-always.c', + 'test/test-ping-pong.c', + 'test/test-pipe-bind-error.c', + 'test/test-ref.c', + 'test/test-shutdown-eof.c', + 'test/test-spawn.c', + 'test/test-tcp-bind-error.c', + 'test/test-tcp-bind6-error.c', + 'test/test-tcp-writealot.c', + 'test/test-timer-again.c', + 'test/test-timer.c', + ], + 'conditions': [ + [ 'OS=="win"', { + 'sources': [ + 'test/runner-win.c', + 'test/runner-win.h' + ], + 'libraries': [ 'ws2_32.lib' ] + }, { # POSIX + 'defines': [ '_GNU_SOURCE' ], + 'ldflags': [ '-pthread' ], + 'sources': [ + 'test/runner-unix.c', + 'test/runner-unix.h', + ] + }] + ], + 'msvs-settings': { + 'VCLinkerTool': { + 'SubSystem': 1, # /subsystem:console + }, + }, + }, + + { + 'target_name': 'run-benchmarks', + 'type': 'executable', + 'dependencies': [ 'uv' ], + 'sources': [ + 'test/benchmark-ares.c', + 'test/benchmark-getaddrinfo.c', + 'test/benchmark-list.h', + 'test/benchmark-ping-pongs.c', + 'test/benchmark-pound.c', + 'test/benchmark-pump.c', + 'test/benchmark-sizes.c', + 'test/benchmark-spawn.c', + 'test/dns-server.c', + 'test/echo-server.c', + 'test/run-benchmarks.c', + 'test/runner.c', + 'test/runner.h', + 'test/task.h', + ], + 'conditions': [ + [ 'OS=="win"', { + 'sources': [ + 'test/runner-win.c', + 'test/runner-win.h', + ], + 'libraries': [ 'ws2_32.lib' ] + }, { # POSIX + 'defines': [ '_GNU_SOURCE' ], + 'ldflags': [ '-pthread' ], + 'sources': [ + 'test/runner-unix.c', + 'test/runner-unix.h', + ] + }] + ], + 'msvs-settings': { + 'VCLinkerTool': { + 'SubSystem': 1, # /subsystem:console + }, + }, + } + ] +} +