diff --git a/config/pkg/lib/pthreads4w.yml b/config/pkg/lib/pthreads4w.yml new file mode 100644 index 00000000..06a6245f --- /dev/null +++ b/config/pkg/lib/pthreads4w.yml @@ -0,0 +1,12 @@ +pthreads4w: + type: library + artifact: + source: + type: git + rev: master + url: 'https://git.code.sf.net/p/pthreads4w/code' + metadata: + license-files: [LICENSE] + license: Apache-2.0 + static-libs@windows: + - libpthreadVC3.lib diff --git a/src/Package/Library/pthreads4w.php b/src/Package/Library/pthreads4w.php new file mode 100644 index 00000000..69f181f0 --- /dev/null +++ b/src/Package/Library/pthreads4w.php @@ -0,0 +1,34 @@ +cd($lib->getSourceDir()) + ->exec( + 'nmake /E /nologo /f Makefile ' . + 'DESTROOT=' . $lib->getBuildRootPath() . ' ' . + 'XCFLAGS="/MT" ' . // no dll + 'EHFLAGS="/I. /DHAVE_CONFIG_H /Os /Ob2 /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED" ' . + 'pthreadVC3.inlined_static_stamp' + ); + FileSystem::createDir($lib->getLibDir()); + FileSystem::createDir($lib->getIncludeDir()); + FileSystem::copy("{$lib->getSourceDir()}\\libpthreadVC3.lib", "{$lib->getLibDir()}\\libpthreadVC3.lib"); + FileSystem::copy("{$lib->getSourceDir()}\\_ptw32.h", "{$lib->getIncludeDir()}\\_ptw32.h"); + FileSystem::copy("{$lib->getSourceDir()}\\pthread.h", "{$lib->getIncludeDir()}\\pthread.h"); + FileSystem::copy("{$lib->getSourceDir()}\\sched.h", "{$lib->getIncludeDir()}\\sched.h"); + FileSystem::copy("{$lib->getSourceDir()}\\semaphore.h", "{$lib->getIncludeDir()}\\semaphore.h"); + } +}