diff options
| author | ruki <[email protected]> | 2016-09-17 21:14:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-09-17 21:14:56 +0800 |
| commit | f6a99c6c8ee94e5b5af4186aad685d8ccfe715fc (patch) | |
| tree | 1d0f1d423742254869c6ca875b97db5f97addd0a | |
| parent | 05019549ea769b64a31929b7044e7a53dba97549 (diff) | |
clear xmake config first for install.bat
| -rw-r--r-- | core/pkg/base.pkg/xmake.lua | 11 | ||||
| -rw-r--r-- | core/pkg/luajit.pkg/xmake.lua | 30 | ||||
| -rwxr-xr-x | core/pkg/tbox.pkg/inc/linux/i386/tbox.config.h | 120 | ||||
| -rwxr-xr-x | core/pkg/tbox.pkg/inc/linux/x86_64/tbox.config.h | 120 | ||||
| -rwxr-xr-x | core/pkg/tbox.pkg/inc/macosx/x86_64/tbox.config.h | 118 | ||||
| -rw-r--r-- | core/pkg/tbox.pkg/inc/windows/x86/tbox.config.h | 68 | ||||
| -rw-r--r-- | core/pkg/tbox.pkg/xmake.lua | 30 | ||||
| -rwxr-xr-x | core/plat/macosx/config.h | 22 | ||||
| -rwxr-xr-x | core/plat/macosx/config.mak | 1 | ||||
| -rwxr-xr-x | core/plat/macosx/prefix.mak | 171 | ||||
| -rw-r--r-- | core/src/demo/xmake.lua | 29 | ||||
| -rw-r--r-- | core/src/xmake/xmake.lua | 25 | ||||
| -rw-r--r-- | core/xmake.lua | 44 | ||||
| -rw-r--r-- | install.bat | 1 |
14 files changed, 790 insertions, 0 deletions
diff --git a/core/pkg/base.pkg/xmake.lua b/core/pkg/base.pkg/xmake.lua new file mode 100644 index 000000000..db521e677 --- /dev/null +++ b/core/pkg/base.pkg/xmake.lua @@ -0,0 +1,11 @@ +-- the base package +option("base") + + -- set category + set_category("package") + + -- add links + if is_os("windows") then add_links("ws2_32") + elseif is_os("android") then add_links("m", "c") + else add_links("pthread", "dl", "m", "c") end + diff --git a/core/pkg/luajit.pkg/xmake.lua b/core/pkg/luajit.pkg/xmake.lua new file mode 100644 index 000000000..465bf6cdf --- /dev/null +++ b/core/pkg/luajit.pkg/xmake.lua @@ -0,0 +1,30 @@ +-- add luajit package +option("luajit") + + -- show menu + set_showmenu(true) + + -- set category + set_category("package") + + -- set description + set_description("The luajit package") + + -- set language: c99, c++11 + set_languages("c99", "cxx11") + + -- add defines to config.h if checking ok + add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_LUAJIT") + + -- add links for checking + add_links("luajit") + + -- add link directories + add_linkdirs("lib/$(plat)/$(arch)") + + -- add c includes for checking + add_cincludes("luajit/luajit.h") + + -- add include directories + add_includedirs("inc") + diff --git a/core/pkg/tbox.pkg/inc/linux/i386/tbox.config.h b/core/pkg/tbox.pkg/inc/linux/i386/tbox.config.h new file mode 100755 index 000000000..24e3f1851 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/linux/i386/tbox.config.h @@ -0,0 +1,120 @@ +#ifndef TB_CONFIG_H +#define TB_CONFIG_H + +// version +#define TB_CONFIG_VERSION "1.5.3" +#define TB_CONFIG_VERSION_MAJOR 1 +#define TB_CONFIG_VERSION_MINOR 5 +#define TB_CONFIG_VERSION_ALTER 3 +#define TB_CONFIG_VERSION_BUILD 201608031359 + +// defines +#define TB_CONFIG_OS_LINUX 1 +#define _GNU_SOURCE 1 +#define _REENTRANT 1 +#define TB_CONFIG_SMALL 1 +#define TB_CONFIG_TYPE_HAVE_FLOAT 1 +#define TB_CONFIG_POSIX_HAVE_POSIX_SPAWNP 1 +#define TB_CONFIG_LIBC_HAVE_MKTIME 1 +#define TB_CONFIG_LIBM_HAVE_ACOS 1 +#define TB_CONFIG_POSIX_HAVE_SOCKET 1 +#define TB_CONFIG_LIBC_HAVE_SETLOCALE 1 +#define TB_CONFIG_POSIX_HAVE_POLL 1 +#define TB_CONFIG_LIBC_HAVE_KILL 1 +#define TB_CONFIG_POSIX_HAVE_PWRITEV 1 +#define TB_CONFIG_LIBM_HAVE_ATAN2 1 +#define TB_CONFIG_POSIX_HAVE_SCHED_YIELD 1 +#define TB_CONFIG_LIBC_HAVE_STRLEN 1 +#define TB_CONFIG_LIBC_HAVE_WCSCMP 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCAT 1 +#define TB_CONFIG_POSIX_HAVE_EXECVP 1 +#define TB_CONFIG_POSIX_HAVE_FORK 1 +#define TB_CONFIG_POSIX_HAVE_GETIFADDRS 1 +#define TB_CONFIG_POSIX_HAVE_FDATASYNC 1 +#define TB_CONFIG_POSIX_HAVE_DLOPEN 1 +#define TB_CONFIG_POSIX_HAVE_REGEXEC 1 +#define TB_CONFIG_POSIX_HAVE_VFORK 1 +#define TB_CONFIG_LIBC_HAVE_STRCAT 1 +#define TB_CONFIG_LIBC_HAVE_WCSSTR 1 +#define TB_CONFIG_LIBC_HAVE_WCSCAT 1 +#define TB_CONFIG_LIBM_HAVE_POW 1 +#define TB_CONFIG_LIBC_HAVE_MEMCPY 1 +#define TB_CONFIG_LIBM_HAVE_SQRTF 1 +#define TB_CONFIG_LIBC_HAVE_WCSNLEN 1 +#define TB_CONFIG_LIBM_HAVE_ACOSF 1 +#define TB_CONFIG_POSIX_HAVE_OPEN 1 +#define TB_CONFIG_LIBC_HAVE_STRNLEN 1 +#define TB_CONFIG_LIBC_HAVE_RANDOM 1 +#define TB_CONFIG_LIBM_HAVE_ATANF 1 +#define TB_CONFIG_LIBC_HAVE_STRNCAT 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCPY 1 +#define TB_CONFIG_LIBC_HAVE_GMTIME 1 +#define TB_CONFIG_LIBM_HAVE_TAN 1 +#define TB_CONFIG_LIBM_HAVE_POWF 1 +#define TB_CONFIG_LIBM_HAVE_SINF 1 +#define TB_CONFIG_LIBM_HAVE_ATAN 1 +#define TB_CONFIG_LIBC_HAVE_STRNCMP 1 +#define TB_CONFIG_LIBC_HAVE_MEMMOVE 1 +#define TB_CONFIG_LIBC_HAVE_STRNCASECMP 1 +#define TB_CONFIG_POSIX_HAVE_PREADV 1 +#define TB_CONFIG_LIBC_HAVE_WCSCPY 1 +#define TB_CONFIG_LIBM_HAVE_SQRT 1 +#define TB_CONFIG_LIBC_HAVE_STRCMP 1 +#define TB_CONFIG_LIBC_HAVE_STRCASECMP 1 +#define TB_CONFIG_LIBC_HAVE_MEMSET 1 +#define TB_CONFIG_LIBC_HAVE_FPUTS 1 +#define TB_CONFIG_LIBM_HAVE_TANF 1 +#define TB_CONFIG_LIBC_HAVE_STRNCPY 1 +#define TB_CONFIG_LIBC_HAVE_LOCALTIME 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCASECMP 1 +#define TB_CONFIG_LIBC_HAVE_STRCPY 1 +#define TB_CONFIG_POSIX_HAVE_SEM_INIT 1 +#define TB_CONFIG_SYSTEMV_HAVE_SEMGET 1 +#define TB_CONFIG_POSIX_HAVE_WAITPID 1 +#define TB_CONFIG_POSIX_HAVE_EPOLL_WAIT 1 +#define TB_CONFIG_POSIX_HAVE_EPOLL_CREATE 1 +#define TB_CONFIG_LIBC_HAVE_GETTIMEOFDAY 1 +#define TB_CONFIG_LIBM_HAVE_ATAN2F 1 +#define TB_CONFIG_LIBC_HAVE_STRSTR 1 +#define TB_CONFIG_POSIX_HAVE_SENDFILE 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCMP 1 +#define TB_CONFIG_POSIX_HAVE_WRITEV 1 +#define TB_CONFIG_LIBM_HAVE_LOG2 1 +#define TB_CONFIG_LIBM_HAVE_COS 1 +#define TB_CONFIG_POSIX_HAVE_READV 1 +#define TB_CONFIG_POSIX_HAVE_PTHREAD_MUTEX_INIT 1 +#define TB_CONFIG_LIBM_HAVE_FMODF 1 +#define TB_CONFIG_MODULE_HAVE_HASH 1 +#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1 +#define TB_CONFIG_LIBM_HAVE_FMOD 1 +#define TB_CONFIG_LIBC_HAVE_MEMCMP 1 +#define TB_CONFIG_POSIX_HAVE_REGCOMP 1 +#define TB_CONFIG_POSIX_HAVE_SYSCONF 1 +#define TB_CONFIG_POSIX_HAVE_GETPAGESIZE 1 +#define TB_CONFIG_POSIX_HAVE_GETHOSTNAME 1 +#define TB_CONFIG_POSIX_HAVE_OPENDIR 1 +#define TB_CONFIG_LIBM_HAVE_SIN 1 +#define TB_CONFIG_LIBM_HAVE_COSF 1 +#define TB_CONFIG_LIBM_HAVE_EXP 1 +#define TB_CONFIG_POSIX_HAVE_PTHREAD_CREATE 1 +#define TB_CONFIG_LIBM_HAVE_ASIN 1 +#define TB_CONFIG_LIBM_HAVE_EXPF 1 +#define TB_CONFIG_LIBC_HAVE_WCSLEN 1 +#define TB_CONFIG_MODULE_HAVE_THREAD 1 +#define TB_CONFIG_MODULE_HAVE_NETWORK 1 +#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1 +#define TB_CONFIG_LIBC_HAVE_WCSCASECMP 1 +#define TB_CONFIG_LIBM_HAVE_ASINF 1 +#define TB_CONFIG_LIBC_HAVE_SIGSETJMP 1 +#define TB_CONFIG_LIBM_HAVE_LOG2F 1 +#define TB_CONFIG_LIBC_HAVE_SRANDOM 1 +#define TB_CONFIG_LIBC_HAVE_SETJMP 1 +#define TB_CONFIG_LIBC_HAVE_SIGNAL 1 +#define TB_CONFIG_LIBC_HAVE_BACKTRACE 1 + +// undefines +#undef TB_CONFIG_TRACE_INFO_ONLY +#undef TB_CONFIG_EXCEPTION_ENABLE +#undef TB_CONFIG_MEMORY_UNALIGNED_ACCESS_ENABLE + +#endif diff --git a/core/pkg/tbox.pkg/inc/linux/x86_64/tbox.config.h b/core/pkg/tbox.pkg/inc/linux/x86_64/tbox.config.h new file mode 100755 index 000000000..095066c75 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/linux/x86_64/tbox.config.h @@ -0,0 +1,120 @@ +#ifndef TB_CONFIG_H +#define TB_CONFIG_H + +// version +#define TB_CONFIG_VERSION "1.5.3" +#define TB_CONFIG_VERSION_MAJOR 1 +#define TB_CONFIG_VERSION_MINOR 5 +#define TB_CONFIG_VERSION_ALTER 3 +#define TB_CONFIG_VERSION_BUILD 201608031402 + +// defines +#define TB_CONFIG_OS_LINUX 1 +#define _GNU_SOURCE 1 +#define _REENTRANT 1 +#define TB_CONFIG_SMALL 1 +#define TB_CONFIG_TYPE_HAVE_FLOAT 1 +#define TB_CONFIG_POSIX_HAVE_POSIX_SPAWNP 1 +#define TB_CONFIG_LIBC_HAVE_MKTIME 1 +#define TB_CONFIG_LIBM_HAVE_ACOS 1 +#define TB_CONFIG_POSIX_HAVE_SOCKET 1 +#define TB_CONFIG_LIBC_HAVE_SETLOCALE 1 +#define TB_CONFIG_POSIX_HAVE_POLL 1 +#define TB_CONFIG_LIBC_HAVE_KILL 1 +#define TB_CONFIG_POSIX_HAVE_PWRITEV 1 +#define TB_CONFIG_LIBM_HAVE_ATAN2 1 +#define TB_CONFIG_POSIX_HAVE_SCHED_YIELD 1 +#define TB_CONFIG_LIBC_HAVE_STRLEN 1 +#define TB_CONFIG_LIBC_HAVE_WCSCMP 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCAT 1 +#define TB_CONFIG_POSIX_HAVE_EXECVP 1 +#define TB_CONFIG_POSIX_HAVE_FORK 1 +#define TB_CONFIG_POSIX_HAVE_GETIFADDRS 1 +#define TB_CONFIG_POSIX_HAVE_FDATASYNC 1 +#define TB_CONFIG_POSIX_HAVE_DLOPEN 1 +#define TB_CONFIG_POSIX_HAVE_REGEXEC 1 +#define TB_CONFIG_POSIX_HAVE_VFORK 1 +#define TB_CONFIG_LIBC_HAVE_STRCAT 1 +#define TB_CONFIG_LIBC_HAVE_WCSSTR 1 +#define TB_CONFIG_LIBC_HAVE_WCSCAT 1 +#define TB_CONFIG_LIBM_HAVE_POW 1 +#define TB_CONFIG_LIBC_HAVE_MEMCPY 1 +#define TB_CONFIG_LIBM_HAVE_SQRTF 1 +#define TB_CONFIG_LIBC_HAVE_WCSNLEN 1 +#define TB_CONFIG_LIBM_HAVE_ACOSF 1 +#define TB_CONFIG_POSIX_HAVE_OPEN 1 +#define TB_CONFIG_LIBC_HAVE_STRNLEN 1 +#define TB_CONFIG_LIBC_HAVE_RANDOM 1 +#define TB_CONFIG_LIBM_HAVE_ATANF 1 +#define TB_CONFIG_LIBC_HAVE_STRNCAT 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCPY 1 +#define TB_CONFIG_LIBC_HAVE_GMTIME 1 +#define TB_CONFIG_LIBM_HAVE_TAN 1 +#define TB_CONFIG_LIBM_HAVE_POWF 1 +#define TB_CONFIG_LIBM_HAVE_SINF 1 +#define TB_CONFIG_LIBM_HAVE_ATAN 1 +#define TB_CONFIG_LIBC_HAVE_STRNCMP 1 +#define TB_CONFIG_LIBC_HAVE_MEMMOVE 1 +#define TB_CONFIG_LIBC_HAVE_STRNCASECMP 1 +#define TB_CONFIG_POSIX_HAVE_PREADV 1 +#define TB_CONFIG_LIBC_HAVE_WCSCPY 1 +#define TB_CONFIG_LIBM_HAVE_SQRT 1 +#define TB_CONFIG_LIBC_HAVE_STRCMP 1 +#define TB_CONFIG_LIBC_HAVE_STRCASECMP 1 +#define TB_CONFIG_LIBC_HAVE_MEMSET 1 +#define TB_CONFIG_LIBC_HAVE_FPUTS 1 +#define TB_CONFIG_LIBM_HAVE_TANF 1 +#define TB_CONFIG_LIBC_HAVE_STRNCPY 1 +#define TB_CONFIG_LIBC_HAVE_LOCALTIME 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCASECMP 1 +#define TB_CONFIG_LIBC_HAVE_STRCPY 1 +#define TB_CONFIG_POSIX_HAVE_SEM_INIT 1 +#define TB_CONFIG_SYSTEMV_HAVE_SEMGET 1 +#define TB_CONFIG_POSIX_HAVE_WAITPID 1 +#define TB_CONFIG_POSIX_HAVE_EPOLL_WAIT 1 +#define TB_CONFIG_POSIX_HAVE_EPOLL_CREATE 1 +#define TB_CONFIG_LIBC_HAVE_GETTIMEOFDAY 1 +#define TB_CONFIG_LIBM_HAVE_ATAN2F 1 +#define TB_CONFIG_LIBC_HAVE_STRSTR 1 +#define TB_CONFIG_POSIX_HAVE_SENDFILE 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCMP 1 +#define TB_CONFIG_POSIX_HAVE_WRITEV 1 +#define TB_CONFIG_LIBM_HAVE_LOG2 1 +#define TB_CONFIG_LIBM_HAVE_COS 1 +#define TB_CONFIG_POSIX_HAVE_READV 1 +#define TB_CONFIG_POSIX_HAVE_PTHREAD_MUTEX_INIT 1 +#define TB_CONFIG_LIBM_HAVE_FMODF 1 +#define TB_CONFIG_MODULE_HAVE_HASH 1 +#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1 +#define TB_CONFIG_LIBM_HAVE_FMOD 1 +#define TB_CONFIG_LIBC_HAVE_MEMCMP 1 +#define TB_CONFIG_POSIX_HAVE_REGCOMP 1 +#define TB_CONFIG_POSIX_HAVE_SYSCONF 1 +#define TB_CONFIG_POSIX_HAVE_GETPAGESIZE 1 +#define TB_CONFIG_POSIX_HAVE_GETHOSTNAME 1 +#define TB_CONFIG_POSIX_HAVE_OPENDIR 1 +#define TB_CONFIG_LIBM_HAVE_SIN 1 +#define TB_CONFIG_LIBM_HAVE_COSF 1 +#define TB_CONFIG_LIBM_HAVE_EXP 1 +#define TB_CONFIG_POSIX_HAVE_PTHREAD_CREATE 1 +#define TB_CONFIG_LIBM_HAVE_ASIN 1 +#define TB_CONFIG_LIBM_HAVE_EXPF 1 +#define TB_CONFIG_LIBC_HAVE_WCSLEN 1 +#define TB_CONFIG_MODULE_HAVE_THREAD 1 +#define TB_CONFIG_MODULE_HAVE_NETWORK 1 +#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1 +#define TB_CONFIG_LIBC_HAVE_WCSCASECMP 1 +#define TB_CONFIG_LIBM_HAVE_ASINF 1 +#define TB_CONFIG_LIBC_HAVE_SIGSETJMP 1 +#define TB_CONFIG_LIBM_HAVE_LOG2F 1 +#define TB_CONFIG_LIBC_HAVE_SRANDOM 1 +#define TB_CONFIG_LIBC_HAVE_SETJMP 1 +#define TB_CONFIG_LIBC_HAVE_SIGNAL 1 +#define TB_CONFIG_LIBC_HAVE_BACKTRACE 1 + +// undefines +#undef TB_CONFIG_TRACE_INFO_ONLY +#undef TB_CONFIG_EXCEPTION_ENABLE +#undef TB_CONFIG_MEMORY_UNALIGNED_ACCESS_ENABLE + +#endif diff --git a/core/pkg/tbox.pkg/inc/macosx/x86_64/tbox.config.h b/core/pkg/tbox.pkg/inc/macosx/x86_64/tbox.config.h new file mode 100755 index 000000000..da1a2fa56 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/macosx/x86_64/tbox.config.h @@ -0,0 +1,118 @@ +#ifndef TB_CONFIG_H +#define TB_CONFIG_H + +// version +#define TB_CONFIG_VERSION "1.5.3" +#define TB_CONFIG_VERSION_MAJOR 1 +#define TB_CONFIG_VERSION_MINOR 5 +#define TB_CONFIG_VERSION_ALTER 3 +#define TB_CONFIG_VERSION_BUILD 201608031341 + +// defines +#define TB_CONFIG_OS_MACOSX 1 +#define _GNU_SOURCE 1 +#define _REENTRANT 1 +#define TB_CONFIG_SMALL 1 +#define TB_CONFIG_TYPE_HAVE_FLOAT 1 +#define TB_CONFIG_POSIX_HAVE_POSIX_SPAWNP 1 +#define TB_CONFIG_LIBC_HAVE_MKTIME 1 +#define TB_CONFIG_LIBM_HAVE_ACOS 1 +#define TB_CONFIG_POSIX_HAVE_SOCKET 1 +#define TB_CONFIG_LIBC_HAVE_SETLOCALE 1 +#define TB_CONFIG_POSIX_HAVE_POLL 1 +#define TB_CONFIG_LIBC_HAVE_KILL 1 +#define TB_CONFIG_LIBC_HAVE_BACKTRACE 1 +#define TB_CONFIG_POSIX_HAVE_SCHED_YIELD 1 +#define TB_CONFIG_LIBC_HAVE_STRLEN 1 +#define TB_CONFIG_LIBC_HAVE_WCSCMP 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCAT 1 +#define TB_CONFIG_POSIX_HAVE_EXECVP 1 +#define TB_CONFIG_POSIX_HAVE_FORK 1 +#define TB_CONFIG_POSIX_HAVE_GETIFADDRS 1 +#define TB_CONFIG_POSIX_HAVE_DLOPEN 1 +#define TB_CONFIG_POSIX_HAVE_REGEXEC 1 +#define TB_CONFIG_POSIX_HAVE_VFORK 1 +#define TB_CONFIG_LIBC_HAVE_STRCAT 1 +#define TB_CONFIG_LIBC_HAVE_WCSSTR 1 +#define TB_CONFIG_LIBC_HAVE_WCSCAT 1 +#define TB_CONFIG_LIBM_HAVE_POW 1 +#define TB_CONFIG_LIBC_HAVE_MEMCPY 1 +#define TB_CONFIG_LIBM_HAVE_SQRTF 1 +#define TB_CONFIG_LIBC_HAVE_WCSNLEN 1 +#define TB_CONFIG_LIBM_HAVE_ACOSF 1 +#define TB_CONFIG_POSIX_HAVE_OPEN 1 +#define TB_CONFIG_LIBC_HAVE_STRNLEN 1 +#define TB_CONFIG_LIBC_HAVE_RANDOM 1 +#define TB_CONFIG_LIBM_HAVE_ATANF 1 +#define TB_CONFIG_LIBC_HAVE_STRNCAT 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCPY 1 +#define TB_CONFIG_LIBC_HAVE_GMTIME 1 +#define TB_CONFIG_LIBM_HAVE_TAN 1 +#define TB_CONFIG_LIBM_HAVE_POWF 1 +#define TB_CONFIG_LIBM_HAVE_SINF 1 +#define TB_CONFIG_MODULE_HAVE_NETWORK 1 +#define TB_CONFIG_LIBC_HAVE_STRNCMP 1 +#define TB_CONFIG_LIBC_HAVE_MEMMOVE 1 +#define TB_CONFIG_LIBC_HAVE_STRNCASECMP 1 +#define TB_CONFIG_LIBC_HAVE_STRLCPY 1 +#define TB_CONFIG_LIBC_HAVE_WCSCPY 1 +#define TB_CONFIG_LIBM_HAVE_SQRT 1 +#define TB_CONFIG_LIBC_HAVE_STRCMP 1 +#define TB_CONFIG_LIBC_HAVE_STRCASECMP 1 +#define TB_CONFIG_LIBC_HAVE_MEMSET 1 +#define TB_CONFIG_LIBC_HAVE_FPUTS 1 +#define TB_CONFIG_LIBM_HAVE_TANF 1 +#define TB_CONFIG_LIBC_HAVE_STRNCPY 1 +#define TB_CONFIG_LIBC_HAVE_LOCALTIME 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCASECMP 1 +#define TB_CONFIG_LIBC_HAVE_STRCPY 1 +#define TB_CONFIG_LIBC_HAVE_WCSLCPY 1 +#define TB_CONFIG_SYSTEMV_HAVE_SEMGET 1 +#define TB_CONFIG_POSIX_HAVE_WAITPID 1 +#define TB_CONFIG_POSIX_HAVE_WRITEV 1 +#define TB_CONFIG_POSIX_HAVE_READV 1 +#define TB_CONFIG_LIBC_HAVE_GETTIMEOFDAY 1 +#define TB_CONFIG_LIBC_HAVE_SIGNAL 1 +#define TB_CONFIG_LIBC_HAVE_STRSTR 1 +#define TB_CONFIG_POSIX_HAVE_REGCOMP 1 +#define TB_CONFIG_LIBC_HAVE_WCSNCMP 1 +#define TB_CONFIG_POSIX_HAVE_SYSCONF 1 +#define TB_CONFIG_LIBM_HAVE_LOG2 1 +#define TB_CONFIG_LIBM_HAVE_COS 1 +#define TB_CONFIG_POSIX_HAVE_GETPAGESIZE 1 +#define TB_CONFIG_POSIX_HAVE_PTHREAD_MUTEX_INIT 1 +#define TB_CONFIG_LIBM_HAVE_FMODF 1 +#define TB_CONFIG_MODULE_HAVE_HASH 1 +#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1 +#define TB_CONFIG_LIBM_HAVE_FMOD 1 +#define TB_CONFIG_LIBC_HAVE_MEMCMP 1 +#define TB_CONFIG_POSIX_HAVE_SEM_INIT 1 +#define TB_CONFIG_POSIX_HAVE_GETHOSTNAME 1 +#define TB_CONFIG_POSIX_HAVE_OPENDIR 1 +#define TB_CONFIG_LIBM_HAVE_ATAN2F 1 +#define TB_CONFIG_LIBM_HAVE_ATAN2 1 +#define TB_CONFIG_LIBM_HAVE_EXP 1 +#define TB_CONFIG_LIBM_HAVE_SIN 1 +#define TB_CONFIG_LIBM_HAVE_COSF 1 +#define TB_CONFIG_POSIX_HAVE_PTHREAD_CREATE 1 +#define TB_CONFIG_LIBM_HAVE_ASIN 1 +#define TB_CONFIG_LIBM_HAVE_EXPF 1 +#define TB_CONFIG_LIBM_HAVE_ATAN 1 +#define TB_CONFIG_LIBM_HAVE_ASINF 1 +#define TB_CONFIG_MODULE_HAVE_THREAD 1 +#define TB_CONFIG_LIBC_HAVE_MEMMEM 1 +#define TB_CONFIG_LIBC_HAVE_WCSCASECMP 1 +#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1 +#define TB_CONFIG_LIBC_HAVE_SIGSETJMP 1 +#define TB_CONFIG_LIBM_HAVE_LOG2F 1 +#define TB_CONFIG_LIBC_HAVE_SRANDOM 1 +#define TB_CONFIG_LIBC_HAVE_SETJMP 1 +#define TB_CONFIG_LIBC_HAVE_STRCASESTR 1 +#define TB_CONFIG_LIBC_HAVE_WCSLEN 1 + +// undefines +#undef TB_CONFIG_TRACE_INFO_ONLY +#undef TB_CONFIG_EXCEPTION_ENABLE +#undef TB_CONFIG_MEMORY_UNALIGNED_ACCESS_ENABLE + +#endif diff --git a/core/pkg/tbox.pkg/inc/windows/x86/tbox.config.h b/core/pkg/tbox.pkg/inc/windows/x86/tbox.config.h new file mode 100644 index 000000000..3621ae4e2 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/windows/x86/tbox.config.h @@ -0,0 +1,68 @@ +#ifndef TB_CONFIG_H
+#define TB_CONFIG_H
+
+// version
+#define TB_CONFIG_VERSION "1.5.3"
+#define TB_CONFIG_VERSION_MAJOR 1
+#define TB_CONFIG_VERSION_MINOR 5
+#define TB_CONFIG_VERSION_ALTER 3
+#define TB_CONFIG_VERSION_BUILD 201608031342
+
+// defines
+#define TB_CONFIG_OS_WINDOWS 1
+#define _GNU_SOURCE 1
+#define _REENTRANT 1
+#define TB_CONFIG_SMALL 1
+#define TB_CONFIG_TYPE_HAVE_FLOAT 1
+#define TB_CONFIG_LIBC_HAVE_MEMMOVE 1
+#define TB_CONFIG_LIBC_HAVE_MKTIME 1
+#define TB_CONFIG_LIBM_HAVE_ACOS 1
+#define TB_CONFIG_LIBC_HAVE_SETLOCALE 1
+#define TB_CONFIG_LIBC_HAVE_WCSCPY 1
+#define TB_CONFIG_LIBM_HAVE_SQRT 1
+#define TB_CONFIG_LIBC_HAVE_STRCMP 1
+#define TB_CONFIG_LIBM_HAVE_ATAN2 1
+#define TB_CONFIG_LIBC_HAVE_MEMSET 1
+#define TB_CONFIG_LIBC_HAVE_WCSLEN 1
+#define TB_CONFIG_LIBC_HAVE_STRNCPY 1
+#define TB_CONFIG_LIBC_HAVE_LOCALTIME 1
+#define TB_CONFIG_LIBC_HAVE_WCSNCAT 1
+#define TB_CONFIG_LIBC_HAVE_STRCPY 1
+#define TB_CONFIG_LIBC_HAVE_SIGNAL 1
+#define TB_CONFIG_LIBC_HAVE_STRSTR 1
+#define TB_CONFIG_LIBC_HAVE_WCSNCMP 1
+#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1
+#define TB_CONFIG_LIBC_HAVE_WCSSTR 1
+#define TB_CONFIG_LIBC_HAVE_WCSCAT 1
+#define TB_CONFIG_LIBM_HAVE_POW 1
+#define TB_CONFIG_LIBC_HAVE_MEMCPY 1
+#define TB_CONFIG_MODULE_HAVE_HASH 1
+#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1
+#define TB_CONFIG_LIBC_HAVE_WCSNLEN 1
+#define TB_CONFIG_LIBC_HAVE_MEMCMP 1
+#define TB_CONFIG_LIBM_HAVE_EXP 1
+#define TB_CONFIG_LIBC_HAVE_STRNLEN 1
+#define TB_CONFIG_LIBM_HAVE_SIN 1
+#define TB_CONFIG_LIBM_HAVE_COS 1
+#define TB_CONFIG_LIBM_HAVE_ATAN 1
+#define TB_CONFIG_LIBM_HAVE_ASIN 1
+#define TB_CONFIG_LIBC_HAVE_SETJMP 1
+#define TB_CONFIG_LIBC_HAVE_STRNCAT 1
+#define TB_CONFIG_LIBC_HAVE_WCSNCPY 1
+#define TB_CONFIG_LIBM_HAVE_FMOD 1
+#define TB_CONFIG_LIBC_HAVE_GMTIME 1
+#define TB_CONFIG_LIBC_HAVE_FPUTS 1
+#define TB_CONFIG_LIBM_HAVE_TAN 1
+#define TB_CONFIG_LIBC_HAVE_STRCAT 1
+#define TB_CONFIG_LIBC_HAVE_STRLEN 1
+#define TB_CONFIG_MODULE_HAVE_NETWORK 1
+#define TB_CONFIG_MODULE_HAVE_THREAD 1
+#define TB_CONFIG_LIBC_HAVE_WCSCMP 1
+#define TB_CONFIG_LIBC_HAVE_STRNCMP 1
+
+// undefines
+#undef TB_CONFIG_TRACE_INFO_ONLY
+#undef TB_CONFIG_EXCEPTION_ENABLE
+#undef TB_CONFIG_MEMORY_UNALIGNED_ACCESS_ENABLE
+
+#endif
diff --git a/core/pkg/tbox.pkg/xmake.lua b/core/pkg/tbox.pkg/xmake.lua new file mode 100644 index 000000000..b71bbe659 --- /dev/null +++ b/core/pkg/tbox.pkg/xmake.lua @@ -0,0 +1,30 @@ +-- add tbox package +option("tbox") + + -- show menu + set_showmenu(true) + + -- set category + set_category("package") + + -- set description + set_description("The tbox package") + + -- set language: c99, c++11 + set_languages("c99", "cxx11") + + -- add defines to config.h if checking ok + add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_TBOX") + + -- add links for checking + add_links("tbox") + + -- add link directories + add_linkdirs("lib/$(plat)/$(arch)") + + -- add c includes for checking + add_cincludes("tbox/tbox.h") + + -- add include directories + add_includedirs("inc/$(plat)/$(arch)", "inc") + diff --git a/core/plat/macosx/config.h b/core/plat/macosx/config.h new file mode 100755 index 000000000..e55edbc80 --- /dev/null +++ b/core/plat/macosx/config.h @@ -0,0 +1,22 @@ +#ifndef XM_CONFIG_H +#define XM_CONFIG_H + +// packages +// [packages] + +// major version +#define XM_CONFIG_VERSION_MAJOR [major] + +// minor version +#define XM_CONFIG_VERSION_MINOR [minor] + +// alter version +#define XM_CONFIG_VERSION_ALTER [alter] + +// build version +#define XM_CONFIG_VERSION_BUILD [build] + +// small +#define XM_CONFIG_SMALL [small] + +#endif diff --git a/core/plat/macosx/config.mak b/core/plat/macosx/config.mak new file mode 100755 index 000000000..8b1378917 --- /dev/null +++ b/core/plat/macosx/config.mak @@ -0,0 +1 @@ + diff --git a/core/plat/macosx/prefix.mak b/core/plat/macosx/prefix.mak new file mode 100755 index 000000000..fc917bca6 --- /dev/null +++ b/core/plat/macosx/prefix.mak @@ -0,0 +1,171 @@ +# architecture makefile configure + +# prefix & suffix +BIN_PREFIX = +BIN_SUFFIX = .b + +OBJ_PREFIX = +OBJ_SUFFIX = .o + +LIB_PREFIX = lib +LIB_SUFFIX = .a + +DLL_PREFIX = +DLL_SUFFIX = .dylib + +ASM_SUFFIX = .S + +# cpu bits +BITS := $(if $(findstring x86_64,$(ARCH)),64,) +BITS := $(if $(findstring i386,$(ARCH)),32,) +BITS := $(if $(BITS),$(BITS),$(shell getconf LONG_BIT)) + +# prefix +PRE_ := $(if $(BIN),$(BIN)/$(PRE),xcrun -sdk macosx ) + +# cc +CC = $(PRE_)clang +ifeq ($(CXFLAGS_CHECK),) +CC_CHECK = ${shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi } +CXFLAGS_CHECK := $(call CC_CHECK,-ftrapv,) $(call CC_CHECK,-fsanitize=address,) +export CXFLAGS_CHECK +endif + +# ld +LD = $(PRE_)clang +ifeq ($(LDFLAGS_CHECK),) +LD_CHECK = ${shell if $(LD) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi } +LDFLAGS_CHECK := $(call LD_CHECK,-ftrapv,) $(call LD_CHECK,-fsanitize=address,) +export LDFLAGS_CHECK +endif + +# tool +MM = $(PRE_)clang +AR = $(PRE_)ar +STRIP = $(PRE_)strip +RANLIB = $(PRE_)ranlib +AS = yasm +RM = rm -f +RMDIR = rm -rf +CP = cp +CPDIR = cp -r +MKDIR = mkdir -p +MAKE = make -r + +# cxflags: .c/.cc/.cpp files +CXFLAGS_RELEASE = -fvisibility=hidden +CXFLAGS_DEBUG = -g -D__tb_debug__ +CXFLAGS = -m$(BITS) -c -Wall -Werror -Wno-error=deprecated-declarations -Qunused-arguments -mssse3 +CXFLAGS-I = -I +CXFLAGS-o = -o + +# opti +ifeq ($(SMALL),y) +CXFLAGS_RELEASE += -Os +else +CXFLAGS_RELEASE += -O3 +endif + +# prof +ifeq ($(PROF),y) +CXFLAGS += -g -fno-omit-frame-pointer +else +CXFLAGS_RELEASE += -fomit-frame-pointer +CXFLAGS_DEBUG += -fno-omit-frame-pointer $(CXFLAGS_CHECK) +endif + +# cflags: .c files +CFLAGS_RELEASE = +CFLAGS_DEBUG = +CFLAGS = \ + -std=c99 \ + -D_GNU_SOURCE=1 -D_REENTRANT \ + -fno-math-errno -fno-tree-vectorize + +# ccflags: .cc/.cpp files +CCFLAGS_RELEASE = +CCFLAGS_DEBUG = +CCFLAGS = \ + -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ + -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 + +# mxflags: .m/.mm files +MXFLAGS_RELEASE = -fvisibility=hidden +MXFLAGS_DEBUG = -g -D__tb_debug__ +MXFLAGS = \ + -m$(BITS) -c -Wall -Werror -Wno-error=deprecated-declarations -Qunused-arguments \ + -mssse3 $(ARCH_CXFLAGS) -fmessage-length=0 -pipe -fpascal-strings \ + "-DIBOutlet=__attribute__((iboutlet))" \ + "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" \ + "-DIBAction=void)__attribute__((ibaction)" +MXFLAGS-I = -I +MXFLAGS-o = -o + +# opti +ifeq ($(SMALL),y) +MXFLAGS_RELEASE += -Os +else +MXFLAGS_RELEASE += -O3 +endif + +# prof +ifeq ($(PROF),y) +MXFLAGS += -g -fno-omit-frame-pointer +else +MXFLAGS_RELEASE += -fomit-frame-pointer +MXFLAGS_DEBUG += -fno-omit-frame-pointer $(LDFLAGS_CHECK) +endif + +# mflags: .m files +MFLAGS_RELEASE = +MFLAGS_DEBUG = +MFLAGS = -std=c99 + +# mmflags: .mm files +MMFLAGS_RELEASE = +MMFLAGS_DEBUG = +MMFLAGS = + +# ldflags +LDFLAGS_RELEASE = +LDFLAGS_DEBUG = +LDFLAGS = -m$(BITS) -all_load -pagezero_size 10000 -image_base 100000000 -mmacosx-version-min=10.7 +LDFLAGS-L = -L +LDFLAGS-l = -l +LDFLAGS-f = +LDFLAGS-o = -o + +# prof +ifeq ($(PROF),y) +else +LDFLAGS_RELEASE += -s +LDFLAGS_DEBUG += -ftrapv +endif + +# asflags +ASFLAGS_RELEASE = Wa,-march=native +ASFLAGS_DEBUG = +ASFLAGS = -m$(BITS) -f elf $(ARCH_ASFLAGS) +ASFLAGS-I = -I +ASFLAGS-o = -o + +# arflags +ARFLAGS_RELEASE = +ARFLAGS_DEBUG = +ARFLAGS = -cr +ARFLAGS-o = + +# shflags +SHFLAGS_RELEASE = -s +SHFLAGS = $(ARCH_LDFLAGS) -dynamiclib -mmacosx-version-min=10.7 + +# include directory +INC_DIR += /usr/include /usr/local/include + +# library directory +LIB_DIR += /usr/lib /usr/local/lib + +# config +include $(PLAT_DIR)/config.mak + + diff --git a/core/src/demo/xmake.lua b/core/src/demo/xmake.lua new file mode 100644 index 000000000..fddc45886 --- /dev/null +++ b/core/src/demo/xmake.lua @@ -0,0 +1,29 @@ +-- add target +target("demo") + + -- add deps + add_deps("xmake") + + -- make as a binary + set_kind("binary") + + -- add defines + add_defines("__tb_prefix__=\"xmake\"") + + -- set the object files directory + set_objectdir("$(buildir)/.objs") + + -- add includes directory + add_includedirs("$(projectdir)") + add_includedirs("$(projectdir)/src") + + -- add links and directory + add_links("xmake") + add_linkdirs("$(buildir)") + + -- add packages + add_packages("tbox", "luajit", "base") + + -- add the common source files + add_files("**.c") + diff --git a/core/src/xmake/xmake.lua b/core/src/xmake/xmake.lua new file mode 100644 index 000000000..abbab6420 --- /dev/null +++ b/core/src/xmake/xmake.lua @@ -0,0 +1,25 @@ +-- add target +target("xmake") + + -- make as a static library + set_kind("static") + + -- add defines + add_defines("__tb_prefix__=\"xmake\"") + + -- set the auto-generated config.h + set_config_h("$(projectdir)/xmake.config.h") + set_config_h_prefix("XM_CONFIG") + + -- set the object files directory + set_objectdir("$(buildir)/.objs") + + -- add includes directory + add_includedirs("$(projectdir)") + + -- add packages + add_packages("tbox", "luajit", "base") + + -- add the common source files + add_files("**.c") + diff --git a/core/xmake.lua b/core/xmake.lua new file mode 100644 index 000000000..967a1cb06 --- /dev/null +++ b/core/xmake.lua @@ -0,0 +1,44 @@ +-- project +set_project("xmake") + +-- version +set_version("2.0.5") + +-- set warning all as error +set_warnings("all", "error") + +-- set language: c99, c++11 +set_languages("c99", "cxx11") + +-- disable some compiler errors +add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") +add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") + +-- set the symbols visibility: hidden +set_symbols("hidden") + +-- strip all symbols +set_strip("all") + +-- fomit the frame pointer +add_cxflags("-fomit-frame-pointer") +add_mxflags("-fomit-frame-pointer") + +-- for the windows platform (msvc) +if is_plat("windows") then + + -- add some defines only for windows + add_defines("NOCRYPT", "NOGDI") + + -- link libcmt.lib + add_cxflags("-MT") + + -- no msvcrt.lib + add_ldflags("-nodefaultlib:\"msvcrt.lib\"") +end + +-- add package directories +add_packagedirs("pkg") + +-- add projects +add_subdirs("src/xmake", "src/demo") diff --git a/install.bat b/install.bat index c82634001..452f2559d 100644 --- a/install.bat +++ b/install.bat @@ -37,6 +37,7 @@ rem compile xmake-core echo compiling xmake-core...
set XMAKE_PROGRAM_DIR=%~dp0\xmake
cd core
+..\tools\xmake.exe f -c
..\tools\xmake.exe
cd ..
|
