xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.02k stars 781 forks source link

*BSD as a supported platform? #630

Closed tomekw closed 4 years ago

tomekw commented 4 years ago

I didn't find *BSD systems on a supported platforms list. I also couldn't find what's the reason for this.

If it's only for technical reasons and there would be someone to guide me through this I would be more than happy to try to contribute and work on supporting *BSD platforms.

waruqi commented 4 years ago

Because I don’t have the *bsd system for testing, I’m not sure if it is supported. If you are interested, welcome to support it.

Thanks!

RussellHaley commented 4 years ago

Hello, I have FreeBSD available and could even set up a jail (secured instance) for you if you like. I noted FreeBSD has a 1.6 version in the ports tree that I was going to look at eventually. Would love to discuss.

waruqi commented 4 years ago

Hello, I have FreeBSD available and could even set up a jail (secured instance) for you if you like. I noted FreeBSD has a 1.6 version in the ports tree that I was going to look at eventually. Would love to discuss.

If there is a freebsd environment, I would be happy to test and support it. I tried to install freebsd on virtualbox and searched for available docker image, but they were unsuccessful, so I didn't try it again later.

RussellHaley commented 4 years ago

That's great news. I'll get back to you for an ssh public key. Feel free to ping me if I don't get back to you in a week (e.g. I lost track of it).

waruqi commented 4 years ago

That's great news. I'll get back to you for an ssh public key. Feel free to ping me if I don't get back to you in a week (e.g. I lost track of it).

ok, thanks.

waruqi commented 4 years ago

@RussellHaley @tomekw I have supported freebsd now.

We can install xmake on freebsd.

git clone --recursive https://github.com/xmake-io/xmake.git
cd ./xmake
gmake build
./scripts/get.sh __local__ __install_only__
source ~/.xmake/profile

After the new version is released, we can quickly install it directly through the script.

bash <(curl -fsSL https://xmake.io/shget.text)
RussellHaley commented 4 years ago

@RussellHaley @tomekw I have supported freebsd now.

We can install xmake on freebsd.

git clone --recursive https://github.com/xmake-io/xmake.git
cd ./xmake
gmake build
./scripts/get.sh __local__ __install_only__
source ~/.xmake/profile

After the new version is released, we can quickly install it directly through the script.

bash <(curl -fsSL https://xmake.io/shget.text)

I'm getting a build errors:

russellh@jailbird:/storage/git/xmake> gmake build
compiling xmake-core ...
sed: 1: "/storage/git/xmake/core ...": extra characters at the end of g command
gmake[1]: [makefile:343: config] Error 1 (ignored)
sed: 1: "/storage/git/xmake/core ...": extra characters at the end of g command
gmake[1]: [makefile:344: config] Error 1 (ignored)
sed: 1: "/storage/git/xmake/core ...": extra characters at the end of g command
gmake[1]: [makefile:345: config] Error 1 (ignored)
sed: 1: "/storage/git/xmake/core ...": extra characters at the end of g command
gmake[1]: [makefile:346: config] Error 1 (ignored)
sed: 1: "/storage/git/xmake/core ...": extra characters at the end of g command
gmake[1]: [makefile:347: config] Error 1 (ignored)
sed: 1: "/storage/git/xmake/core ...": extra characters at the end of g command
gmake[1]: [makefile:348: config] Error 1 (ignored)
sed: 1: "/storage/git/xmake/core ...": extra characters at the end of g command
gmake[1]: [makefile:349: config] Error 1 (ignored)
sed: 1: "/storage/git/xmake/core ...": extra characters at the end of g command
gmake[1]: [makefile:350: config] Error 1 (ignored)
sed: 1: "/storage/git/xmake/core ...": extra characters at the end of g command
gmake[1]: [makefile:351: config] Error 1 (ignored)

=============================================================================
compile:
    plat:               bsd
    arch:               x86_64
    host:               jailbird
    demo:               y
    prof:               n
    debug:              n
    small:              n
    ccache:
    distcc:

packages:
    tbox:               y
    luajit:             y
    base:               y

directories:
    install:
    package:

toolchains:
    bin:
    pre:
    sdk:

flags:
    cflag:
    ccflag:
    cxflag:
    mflag:
    mmflag:
    mxflag:
    ldflag:
    asflag:
    arflag:
    shflag:

clean xmake
clean lcurses
clean sv
clean luajit
clean tbox
clean xmake
clean demo
make xmake
make lcurses
compile.r lcurses.c
link liblcursesr.a
make sv
compile.r sv/src/comp.c
compile.r sv/src/id.c
compile.r sv/src/num.c
compile.r sv/src/range.c
compile.r sv/src/semvers.c
compile.r sv/src/utils.c
compile.r sv/src/version.c
link libsvr.a
make luajit
compile.r luajit/src/lib_aux.c
compile.r luajit/src/lib_base.c
compile.r luajit/src/lib_bit.c
compile.r luajit/src/lib_debug.c
compile.r luajit/src/lib_ffi.c
compile.r luajit/src/lib_init.c
compile.r luajit/src/lib_io.c
compile.r luajit/src/lib_jit.c
compile.r luajit/src/lib_math.c
compile.r luajit/src/lib_os.c
compile.r luajit/src/lib_package.c
compile.r luajit/src/lib_string.c
compile.r luajit/src/lib_table.c
compile.r luajit/src/lj_alloc.c
compile.r luajit/src/lj_api.c
compile.r luajit/src/lj_asm.c
compile.r luajit/src/lj_bc.c
compile.r luajit/src/lj_bcread.c
compile.r luajit/src/lj_bcwrite.c
compile.r luajit/src/lj_buf.c
compile.r luajit/src/lj_carith.c
compile.r luajit/src/lj_ccall.c
compile.r luajit/src/lj_ccallback.c
compile.r luajit/src/lj_cconv.c
compile.r luajit/src/lj_cdata.c
compile.r luajit/src/lj_char.c
compile.r luajit/src/lj_clib.c
compile.r luajit/src/lj_cparse.c
compile.r luajit/src/lj_crecord.c
compile.r luajit/src/lj_ctype.c
compile.r luajit/src/lj_debug.c
compile.r luajit/src/lj_dispatch.c
compile.r luajit/src/lj_err.c
compile.r luajit/src/lj_ffrecord.c
compile.r luajit/src/lj_func.c
compile.r luajit/src/lj_gc.c
compile.r luajit/src/lj_gdbjit.c
compile.r luajit/src/lj_ir.c
compile.r luajit/src/lj_lex.c
compile.r luajit/src/lj_lib.c
compile.r luajit/src/lj_load.c
compile.r luajit/src/lj_mcode.c
compile.r luajit/src/lj_meta.c
compile.r luajit/src/lj_obj.c
compile.r luajit/src/lj_opt_dce.c
compile.r luajit/src/lj_opt_fold.c
compile.r luajit/src/lj_opt_loop.c
compile.r luajit/src/lj_opt_mem.c
compile.r luajit/src/lj_opt_narrow.c
compile.r luajit/src/lj_opt_sink.c
compile.r luajit/src/lj_opt_split.c
compile.r luajit/src/lj_parse.c
compile.r luajit/src/lj_profile.c
compile.r luajit/src/lj_record.c
compile.r luajit/src/lj_snap.c
compile.r luajit/src/lj_state.c
compile.r luajit/src/lj_str.c
compile.r luajit/src/lj_strfmt.c
compile.r luajit/src/lj_strfmt_num.c
compile.r luajit/src/lj_strscan.c
compile.r luajit/src/lj_tab.c
compile.r luajit/src/lj_trace.c
compile.r luajit/src/lj_udata.c
compile.r luajit/src/lj_vmevent.c
compile.r luajit/src/lj_vmmath.c
compile.r autogen/bsd/jit/x86_64/lj_vm.S
link libluajitr.a
make tbox
compile.r tbox/src/tbox/algorithm/binary_find.c
compile.r tbox/src/tbox/algorithm/binary_find_if.c
compile.r tbox/src/tbox/algorithm/bubble_sort.c
compile.r tbox/src/tbox/algorithm/count.c
compile.r tbox/src/tbox/algorithm/count_if.c
compile.r tbox/src/tbox/algorithm/distance.c
compile.r tbox/src/tbox/algorithm/find.c
compile.r tbox/src/tbox/algorithm/find_if.c
compile.r tbox/src/tbox/algorithm/heap_sort.c
compile.r tbox/src/tbox/algorithm/insert_sort.c
compile.r tbox/src/tbox/algorithm/predicate.c
compile.r tbox/src/tbox/algorithm/quick_sort.c
compile.r tbox/src/tbox/algorithm/remove.c
compile.r tbox/src/tbox/algorithm/remove_first.c
compile.r tbox/src/tbox/algorithm/remove_first_if.c
compile.r tbox/src/tbox/algorithm/remove_if.c
compile.r tbox/src/tbox/algorithm/rfind.c
compile.r tbox/src/tbox/algorithm/rfind_if.c
compile.r tbox/src/tbox/algorithm/rwalk.c
compile.r tbox/src/tbox/algorithm/sort.c
compile.r tbox/src/tbox/algorithm/walk.c
compile.r tbox/src/tbox/charset/ascii.c
compile.r tbox/src/tbox/charset/charset.c
compile.r tbox/src/tbox/charset/gb2312.c
compile.r tbox/src/tbox/charset/iso8859.c
compile.r tbox/src/tbox/charset/ucs2.c
compile.r tbox/src/tbox/charset/ucs4.c
compile.r tbox/src/tbox/charset/utf16.c
compile.r tbox/src/tbox/charset/utf32.c
compile.r tbox/src/tbox/charset/utf8.c
compile.r tbox/src/tbox/container/array_iterator.c
compile.r tbox/src/tbox/container/bloom_filter.c
compile.r tbox/src/tbox/container/circle_queue.c
compile.r tbox/src/tbox/container/element/hash.c
compile.r tbox/src/tbox/container/element/long.c
compile.r tbox/src/tbox/container/element/mem.c
compile.r tbox/src/tbox/container/element/null.c
compile.r tbox/src/tbox/container/element/ptr.c
compile.r tbox/src/tbox/container/element/size.c
compile.r tbox/src/tbox/container/element/str.c
compile.r tbox/src/tbox/container/element/true.c
compile.r tbox/src/tbox/container/element/uint16.c
compile.r tbox/src/tbox/container/element/uint32.c
compile.r tbox/src/tbox/container/element/uint8.c
compile.r tbox/src/tbox/container/hash_map.c
compile.r tbox/src/tbox/container/hash_set.c
compile.r tbox/src/tbox/container/heap.c
compile.r tbox/src/tbox/container/iterator.c
compile.r tbox/src/tbox/container/list.c
compile.r tbox/src/tbox/container/list_entry.c
compile.r tbox/src/tbox/container/priority_queue.c
compile.r tbox/src/tbox/container/queue.c
compile.r tbox/src/tbox/container/single_list.c
compile.r tbox/src/tbox/container/single_list_entry.c
compile.r tbox/src/tbox/container/stack.c
compile.r tbox/src/tbox/container/vector.c
compile.r tbox/src/tbox/hash/adler32.c
compile.r tbox/src/tbox/hash/bkdr.c
compile.r tbox/src/tbox/hash/fnv32.c
compile.r tbox/src/tbox/hash/md5.c
compile.r tbox/src/tbox/hash/sha.c
compile.r tbox/src/tbox/hash/uuid.c
compile.r tbox/src/tbox/libc/impl/libc.c
compile.r tbox/src/tbox/libc/misc/time/gmmktime.c
compile.r tbox/src/tbox/libc/misc/time/gmtime.c
compile.r tbox/src/tbox/libc/misc/time/localtime.c
compile.r tbox/src/tbox/libc/misc/time/mktime.c
compile.r tbox/src/tbox/libc/misc/time/time.c
compile.r tbox/src/tbox/libc/stdio/printf.c
compile.r tbox/src/tbox/libc/stdio/printf_object.c
compile.r tbox/src/tbox/libc/stdio/puts.c
compile.r tbox/src/tbox/libc/stdio/snprintf.c
compile.r tbox/src/tbox/libc/stdio/sprintf.c
compile.r tbox/src/tbox/libc/stdio/swprintf.c
compile.r tbox/src/tbox/libc/stdio/vsnprintf.c
compile.r tbox/src/tbox/libc/stdio/vswprintf.c
compile.r tbox/src/tbox/libc/stdio/wprintf.c
compile.r tbox/src/tbox/libc/stdio/wputs.c
compile.r tbox/src/tbox/libc/stdlib/mbstowcs.c
compile.r tbox/src/tbox/libc/stdlib/random.c
compile.r tbox/src/tbox/libc/stdlib/stdlib.c
compile.r tbox/src/tbox/libc/stdlib/wcstombs.c
compile.r tbox/src/tbox/libc/string/memcmp.c
compile.r tbox/src/tbox/libc/string/memcpy.c
compile.r tbox/src/tbox/libc/string/memdup.c
compile.r tbox/src/tbox/libc/string/memmem.c
compile.r tbox/src/tbox/libc/string/memmov.c
compile.r tbox/src/tbox/libc/string/memset.c
compile.r tbox/src/tbox/libc/string/strcat.c
compile.r tbox/src/tbox/libc/string/strchr.c
compile.r tbox/src/tbox/libc/string/strcmp.c
compile.r tbox/src/tbox/libc/string/strcpy.c
compile.r tbox/src/tbox/libc/string/strdup.c
compile.r tbox/src/tbox/libc/string/strichr.c
compile.r tbox/src/tbox/libc/string/stricmp.c
compile.r tbox/src/tbox/libc/string/strirchr.c
compile.r tbox/src/tbox/libc/string/strirstr.c
compile.r tbox/src/tbox/libc/string/stristr.c
compile.r tbox/src/tbox/libc/string/strlcpy.c
compile.r tbox/src/tbox/libc/string/strlen.c
compile.r tbox/src/tbox/libc/string/strncat.c
compile.r tbox/src/tbox/libc/string/strnchr.c
compile.r tbox/src/tbox/libc/string/strncmp.c
compile.r tbox/src/tbox/libc/string/strncpy.c
compile.r tbox/src/tbox/libc/string/strndup.c
compile.r tbox/src/tbox/libc/string/strnicmp.c
compile.r tbox/src/tbox/libc/string/strnirchr.c
compile.r tbox/src/tbox/libc/string/strnirstr.c
compile.r tbox/src/tbox/libc/string/strnistr.c
compile.r tbox/src/tbox/libc/string/strnlen.c
compile.r tbox/src/tbox/libc/string/strnrchr.c
compile.r tbox/src/tbox/libc/string/strnrstr.c
compile.r tbox/src/tbox/libc/string/strnstr.c
compile.r tbox/src/tbox/libc/string/strrchr.c
compile.r tbox/src/tbox/libc/string/strrstr.c
compile.r tbox/src/tbox/libc/string/strstr.c
compile.r tbox/src/tbox/libc/string/wcscat.c
compile.r tbox/src/tbox/libc/string/wcschr.c
compile.r tbox/src/tbox/libc/string/wcscmp.c
compile.r tbox/src/tbox/libc/string/wcscpy.c
compile.r tbox/src/tbox/libc/string/wcsdup.c
compile.r tbox/src/tbox/libc/string/wcsichr.c
compile.r tbox/src/tbox/libc/string/wcsicmp.c
compile.r tbox/src/tbox/libc/string/wcsirchr.c
compile.r tbox/src/tbox/libc/string/wcsirstr.c
compile.r tbox/src/tbox/libc/string/wcsistr.c
compile.r tbox/src/tbox/libc/string/wcslcpy.c
compile.r tbox/src/tbox/libc/string/wcslen.c
compile.r tbox/src/tbox/libc/string/wcsncat.c
compile.r tbox/src/tbox/libc/string/wcsncmp.c
compile.r tbox/src/tbox/libc/string/wcsncpy.c
compile.r tbox/src/tbox/libc/string/wcsndup.c
compile.r tbox/src/tbox/libc/string/wcsnicmp.c
compile.r tbox/src/tbox/libc/string/wcsnirchr.c
compile.r tbox/src/tbox/libc/string/wcsnirstr.c
compile.r tbox/src/tbox/libc/string/wcsnlen.c
compile.r tbox/src/tbox/libc/string/wcsnrchr.c
compile.r tbox/src/tbox/libc/string/wcsnrstr.c
compile.r tbox/src/tbox/libc/string/wcsrchr.c
compile.r tbox/src/tbox/libc/string/wcsrstr.c
compile.r tbox/src/tbox/libc/string/wcsstr.c
compile.r tbox/src/tbox/libm/cos.c
compile.r tbox/src/tbox/libm/cosf.c
compile.r tbox/src/tbox/libm/exp.c
compile.r tbox/src/tbox/libm/idivi8.c
compile.r tbox/src/tbox/libm/ilog2i.c
compile.r tbox/src/tbox/libm/impl/libm.c
compile.r tbox/src/tbox/libm/isfin.c
compile.r tbox/src/tbox/libm/isfinf.c
compile.r tbox/src/tbox/libm/isinf.c
compile.r tbox/src/tbox/libm/isinff.c
compile.r tbox/src/tbox/libm/isnan.c
compile.r tbox/src/tbox/libm/isnanf.c
compile.r tbox/src/tbox/libm/isqrti.c
compile.r tbox/src/tbox/libm/pow.c
compile.r tbox/src/tbox/libm/sqrtf.c
compile.r tbox/src/tbox/math/impl/math.c
compile.r tbox/src/tbox/math/random/linear.c
compile.r tbox/src/tbox/math/random/random.c
compile.r tbox/src/tbox/memory/allocator.c
compile.r tbox/src/tbox/memory/buffer.c
compile.r tbox/src/tbox/memory/default_allocator.c
compile.r tbox/src/tbox/memory/fixed_pool.c
compile.r tbox/src/tbox/memory/impl/memory.c
compile.r tbox/src/tbox/memory/impl/native_large_allocator.c
compile.r tbox/src/tbox/memory/impl/prefix.c
compile.r tbox/src/tbox/memory/impl/static_fixed_pool.c
compile.r tbox/src/tbox/memory/impl/static_large_allocator.c
compile.r tbox/src/tbox/memory/large_allocator.c
compile.r tbox/src/tbox/memory/native_allocator.c
compile.r tbox/src/tbox/memory/queue_buffer.c
compile.r tbox/src/tbox/memory/small_allocator.c
compile.r tbox/src/tbox/memory/static_allocator.c
compile.r tbox/src/tbox/memory/static_buffer.c
compile.r tbox/src/tbox/memory/string_pool.c
compile.r tbox/src/tbox/network/cookies.c
compile.r tbox/src/tbox/network/dns/cache.c
compile.r tbox/src/tbox/network/dns/looker.c
compile.r tbox/src/tbox/network/dns/server.c
compile.r tbox/src/tbox/network/http.c
compile.r tbox/src/tbox/network/hwaddr.c
compile.r tbox/src/tbox/network/impl/http/date.c
compile.r tbox/src/tbox/network/impl/http/method.c
compile.r tbox/src/tbox/network/impl/http/option.c
compile.r tbox/src/tbox/network/impl/http/status.c
compile.r tbox/src/tbox/network/impl/network.c
compile.r tbox/src/tbox/network/ipaddr.c
compile.r tbox/src/tbox/network/ipv4.c
compile.r tbox/src/tbox/network/ipv6.c
compile.r tbox/src/tbox/network/unixaddr.c
compile.r tbox/src/tbox/network/url.c
compile.r tbox/src/tbox/platform/addrinfo.c
compile.r tbox/src/tbox/platform/atomic64.c
compile.r tbox/src/tbox/platform/backtrace.c
compile.r tbox/src/tbox/platform/cache_time.c
compile.r tbox/src/tbox/platform/cpu.c
compile.r tbox/src/tbox/platform/directory.c
compile.r tbox/src/tbox/platform/dynamic.c
compile.r tbox/src/tbox/platform/environment.c
compile.r tbox/src/tbox/platform/event.c
compile.r tbox/src/tbox/platform/file.c
compile.r tbox/src/tbox/platform/filelock.c
compile.r tbox/src/tbox/platform/hostname.c
compile.r tbox/src/tbox/platform/ifaddrs.c
compile.r tbox/src/tbox/platform/impl/charset.c
compile.r tbox/src/tbox/platform/impl/dns.c
compile.r tbox/src/tbox/platform/impl/platform.c
compile.r tbox/src/tbox/platform/impl/pollerdata.c
compile.r tbox/src/tbox/platform/ltimer.c
compile.r tbox/src/tbox/platform/mutex.c
compile.r tbox/src/tbox/platform/native_memory.c
compile.r tbox/src/tbox/platform/page.c
compile.r tbox/src/tbox/platform/path.c
compile.r tbox/src/tbox/platform/pipe.c
compile.r tbox/src/tbox/platform/poller.c
compile.r tbox/src/tbox/platform/print.c
compile.r tbox/src/tbox/platform/process.c
compile.r tbox/src/tbox/platform/sched.c
compile.r tbox/src/tbox/platform/semaphore.c
compile.r tbox/src/tbox/platform/socket.c
compile.r tbox/src/tbox/platform/stdfile.c
compile.r tbox/src/tbox/platform/syserror.c
compile.r tbox/src/tbox/platform/thread.c
compile.r tbox/src/tbox/platform/thread_local.c
compile.r tbox/src/tbox/platform/time.c
compile.r tbox/src/tbox/platform/timer.c
compile.r tbox/src/tbox/platform/virtual_memory.c
compile.r tbox/src/tbox/prefix/state.c
compile.r tbox/src/tbox/stream/filter.c
compile.r tbox/src/tbox/stream/impl/filter/cache.c
compile.r tbox/src/tbox/stream/impl/filter/charset.c
compile.r tbox/src/tbox/stream/impl/filter/chunked.c
compile.r tbox/src/tbox/stream/impl/stream/data.c
compile.r tbox/src/tbox/stream/impl/stream/file.c
compile.r tbox/src/tbox/stream/impl/stream/filter.c
compile.r tbox/src/tbox/stream/impl/stream/http.c
compile.r tbox/src/tbox/stream/impl/stream/sock.c
compile.r tbox/src/tbox/stream/static_stream.c
compile.r tbox/src/tbox/stream/stream.c
compile.r tbox/src/tbox/stream/transfer.c
compile.r tbox/src/tbox/string/static_string.c
compile.r tbox/src/tbox/string/string.c
compile.r tbox/src/tbox/tbox.c
compile.r tbox/src/tbox/utils/base32.c
compile.r tbox/src/tbox/utils/base64.c
compile.r tbox/src/tbox/utils/bits.c
compile.r tbox/src/tbox/utils/dump.c
compile.r tbox/src/tbox/utils/lock_profiler.c
compile.r tbox/src/tbox/utils/singleton.c
compile.r tbox/src/tbox/utils/trace.c
compile.r tbox/src/tbox/utils/url.c
compile.r tbox/src/tbox/utils/used.c
link libtboxr.a
make xmake
compile.r engine.c
gmake[3]: *** [/storage/git/xmake/core/suffix.mak:303: engine.o] Error 1
gmake[2]: *** [/storage/git/xmake/core/suffix.mak:305: DEP_PROS_xmake_all] Error 2
In file included from engine.c:31:
In file included from ./xmake.h:27:
In file included from ./prefix.h:27:
In file included from ./prefix/prefix.h:27:
./prefix/config.h:38:5: error: invalid token at start of a preprocessor expression
#if XM_CONFIG_SMALL
    ^
/storage/git/xmake/core/xmake.config.h:20:41: note: expanded from macro 'XM_CONFIG_SMALL'
#define XM_CONFIG_SMALL                 [small]
                                        ^
engine.c:1018:9: error: expected expression
    if (xm_init())
        ^
./xmake.h:70:84: note: expanded from macro 'xm_init'
#define xm_init()     xm_init_((tb_size_t)(__xm_mode_debug__ | __xm_mode_small__), XM_VERSION_BUILD)
                                                                                   ^
./prefix/version.h:46:37: note: expanded from macro 'XM_VERSION_BUILD'
#define XM_VERSION_BUILD            XM_CONFIG_VERSION_BUILD
                                    ^
/storage/git/xmake/core/xmake.config.h:17:41: note: expanded from macro 'XM_CONFIG_VERSION_BUILD'
#define XM_CONFIG_VERSION_BUILD         [build]
                                        ^
2 errors generated.

I noted some sed errors at the top; BSD sed is much different from GNU sed. GNU sed is available through pkg as gsed.

waruqi commented 4 years ago

============================================================================= compile: plat: bsd arch: x86_64 host: jailbird. <--- should be bsd

Maybe your host was detected as jailbird (not bsd) by mistake. Maybe your $ HOST environment variable interfered with it

HOST :=$(if $(HOST),$(HOST),$(if ${shell uname | egrep -i bsd},bsd,))

You can try run

HOST=bsd gmake build
RussellHaley commented 4 years ago

I'm using tcsh for a shell on FreeBSD 12.

gmake "HOST=bsd" build
su
gmake install

I have a new xmake installation! I'll test asap.

waruqi commented 4 years ago

Ok, I closed this issue. If there are other bsd related issues, please open a new issue.

ljsnogard commented 4 years ago

I was trying to compile xmake inside a jail based on a FreeBSD 11.3-p5 with the following command:

root:xmake/ (master) # gmake build 

And I got the following errors:

root:xmake/ (master) # gmake build                                                                                                                                                                                                [10:00:19]
compiling xmake-core ...
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:343: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:344: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:345: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:346: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:347: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:348: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:349: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:350: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:351: config] Error 1 (ignored)

=============================================================================
compile:
    plat:               bsd
    arch:               x86_64
    host:               exprimental-xmake
    demo:               y
    prof:               n
    debug:              n
    small:              n
    ccache:
    distcc:

packages:
    tbox:               y
    luajit:             y
    base:               y

directories:
    install:
    package:

toolchains:
    bin:
    pre:
    sdk:

flags:
    cflag:
    ccflag:
    cxflag:
    mflag:
    mmflag:
    mxflag:
    ldflag:
    asflag:
    arflag:
    shflag:

clean xmake
clean lcurses
clean sv
clean luajit
clean tbox
clean xmake
clean demo
make xmake
make lcurses

...
...
...

link libluajitr.a
make tbox
...
...
...
compile.r tbox/src/tbox/platform/poller.c
gmake[3]: *** [/root/projects/xmake/core/suffix.mak:303: tbox/src/tbox/platform/poller.o] Error 1
gmake[2]: *** [/root/projects/xmake/core/suffix.mak:305: DEP_PROS_tbox_all] Error 2
In file included from tbox/src/tbox/platform/poller.c:52:
In file included from tbox/src/tbox/platform/bsd/poller_kqueue.c:26:
/usr/include/sys/event.h:75:2: error: unknown type name 'uintptr_t'
        uintptr_t       ident;          /* identifier for this event */
        ^
/usr/include/sys/event.h:77:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short         flags;          /* action flags for kqueue */
        ^
/usr/include/sys/event.h:78:2: error: unknown type name 'u_int'
        u_int           fflags;         /* filter flag value */
        ^
/usr/include/sys/event.h:79:2: error: unknown type name 'intptr_t'; did you mean '__intptr_t'?
        intptr_t        data;           /* filter data value */
        ^
/usr/include/x86/_types.h:86:19: note: '__intptr_t' declared here
typedef __int64_t       __intptr_t;
                        ^
4 errors generated.

Is xmake going to support FreeBSD 11 too? What can I do to help solve the errors?

waruqi commented 4 years ago

I was trying to compile xmake inside a jail based on a FreeBSD 11.3-p5 with the following command:

root:xmake/ (master) # gmake build 

And I got the following errors:

root:xmake/ (master) # gmake build                                                                                                                                                                                                [10:00:19]
compiling xmake-core ...
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:343: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:344: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:345: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:346: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:347: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:348: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:349: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:350: config] Error 1 (ignored)
sed: 1: "/root/projects/xmake/co ...": extra characters at the end of p command
gmake[1]: [makefile:351: config] Error 1 (ignored)

=============================================================================
compile:
    plat:               bsd
    arch:               x86_64
    host:               exprimental-xmake
    demo:               y
    prof:               n
    debug:              n
    small:              n
    ccache:
    distcc:

packages:
    tbox:               y
    luajit:             y
    base:               y

directories:
    install:
    package:

toolchains:
    bin:
    pre:
    sdk:

flags:
    cflag:
    ccflag:
    cxflag:
    mflag:
    mmflag:
    mxflag:
    ldflag:
    asflag:
    arflag:
    shflag:

clean xmake
clean lcurses
clean sv
clean luajit
clean tbox
clean xmake
clean demo
make xmake
make lcurses

...
...
...

link libluajitr.a
make tbox
...
...
...
compile.r tbox/src/tbox/platform/poller.c
gmake[3]: *** [/root/projects/xmake/core/suffix.mak:303: tbox/src/tbox/platform/poller.o] Error 1
gmake[2]: *** [/root/projects/xmake/core/suffix.mak:305: DEP_PROS_tbox_all] Error 2
In file included from tbox/src/tbox/platform/poller.c:52:
In file included from tbox/src/tbox/platform/bsd/poller_kqueue.c:26:
/usr/include/sys/event.h:75:2: error: unknown type name 'uintptr_t'
        uintptr_t       ident;          /* identifier for this event */
        ^
/usr/include/sys/event.h:77:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short         flags;          /* action flags for kqueue */
        ^
/usr/include/sys/event.h:78:2: error: unknown type name 'u_int'
        u_int           fflags;         /* filter flag value */
        ^
/usr/include/sys/event.h:79:2: error: unknown type name 'intptr_t'; did you mean '__intptr_t'?
        intptr_t        data;           /* filter data value */
        ^
/usr/include/x86/_types.h:86:19: note: '__intptr_t' declared here
typedef __int64_t       __intptr_t;
                        ^
4 errors generated.

Is xmake going to support FreeBSD 11 too? What can I do to help solve the errors?

You can try RussellHaley's operation.

gmake "HOST=bsd" build
su
gmake install
ljsnogard commented 4 years ago

You can try RussellHaley's operation.

gmake "HOST=bsd" build
su
gmake install

I switched the shell to bash since the shell script seems work with bash. But I got exactly the same error and failed in building.

waruqi commented 4 years ago

arch: x86_64 host: exprimental-xmake

?? gmake "HOST=bsd" build does not work?

waruqi commented 4 years ago

I have improved core/makefile, you can fetch dev branch code and try it again.

gmake build
ljsnogard commented 4 years ago

I have improved core/makefile, you can fetch dev branch code and try it again.

gmake build

command:

root:xmake/ (dev) # git log                                                                                                                                                                                                        
commit 7d8866f5903db5372bf7c80abb172871290c6160 (HEAD -> dev, github/dev)
Author: ruki <waruqi@gmail.com>

root:xmake/ (dev) # gmake build

got:

compiling xmake-core ...

=============================================================================
compile:
    plat:               bsd
    arch:               x86_64
    host:               bsd
    demo:               y
    prof:               n
    debug:              n
    small:              n
    ccache:
    distcc:

packages:
    tbox:               y
    luajit:             y
    base:               y

directories:
    install:
    package:

toolchains:
    bin:
    pre:
    sdk:

flags:
    cflag:
    ccflag:
    cxflag:
    mflag:
    mmflag:
    mxflag:
    ldflag:
    asflag:
    arflag:
    shflag:

...
...
...
compile.r tbox/src/tbox/platform/poller.c
gmake[3]: *** [/root/projects/xmake/core/suffix.mak:303: tbox/src/tbox/platform/poller.o] Error 1
gmake[2]: *** [/root/projects/xmake/core/suffix.mak:305: DEP_PROS_tbox_all] Error 2
In file included from tbox/src/tbox/platform/poller.c:52:
In file included from tbox/src/tbox/platform/bsd/poller_kqueue.c:26:
/usr/include/sys/event.h:75:2: error: unknown type name 'uintptr_t'
        uintptr_t       ident;          /* identifier for this event */
        ^
/usr/include/sys/event.h:77:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short         flags;          /* action flags for kqueue */
        ^
/usr/include/sys/event.h:78:2: error: unknown type name 'u_int'
        u_int           fflags;         /* filter flag value */
        ^
/usr/include/sys/event.h:79:2: error: unknown type name 'intptr_t'; did you mean '__intptr_t'?
        intptr_t        data;           /* filter data value */
        ^
/usr/include/x86/_types.h:86:19: note: '__intptr_t' declared here
typedef __int64_t       __intptr_t;
                        ^
4 errors generated.

Some information I got:

In FreeBSD 11.3 Release notes:

The clang, llvm, lld, lldb, and compiler-rt utilities as well as libc++ have been updated to upstream version 8.0.0. [r346296]

But in FreeBSD 12.0 Release notes:

The clang, llvm, lld, lldb, compiler-rt utilities and libc++ have been updated to version 6.0.1. [r335799]
waruqi commented 4 years ago

You can try edit tbox/bsd/poller_kqueue.c to add

#include <stdint.h> 
#include <sys/event.h>

Or edit tbox/platform/poller.h to disable kqueue for *bsd.

If it works, I will add this patch.

ljsnogard commented 4 years ago

Two lines added into poller_kqueue.c and the build succeeded.

root:bsd/ (bfc9f879✗) # git diff poller_kqueue.c                                                                                                                                                                                
diff --git a/src/tbox/platform/bsd/poller_kqueue.c b/src/tbox/platform/bsd/poller_kqueue.c
index 12b734cb..6e5b0c83 100644
--- a/src/tbox/platform/bsd/poller_kqueue.c
+++ b/src/tbox/platform/bsd/poller_kqueue.c
@@ -23,6 +23,8 @@
  */
 #include "prefix.h"
 #include <errno.h>
+#include <stdint.h>
+#include <sys/types.h>
 #include <sys/event.h>
 #include <sys/time.h>
 #include <unistd.h>

Feel lazy to create pull request.

waruqi commented 4 years ago

@ljsnogard I have merged this patch. You can fetch the dev branch code and try it again.

ljsnogard commented 4 years ago

@ljsnogard I have merged this patch. You can fetch the dev branch code and try it again.

It works for me. With gmake build and gmake install I can install xmake.

root:xmake/ (dev✗) # gmake install                                                                                                                                                                                              
installing to /usr/local ...
plat: bsd
arch: x86_64
ok!
root:xmake/ (dev✗) # which xmake                                                                                                                                                                                                
/usr/local/bin/xmake

Thanks !

waruqi commented 4 years ago

ok