New port: lang/J

J (J language) is a high-level, general-purpose, high-performance
programming language. J is portable and runs on 32/64-bit
Windows/Linux/Mac as well as iOS, Android, and other platforms.

WWW: http://www.jsoftware.com

PR:		226186
Submitted by:	Joao Neves <sevenjp@gmail.com>
This commit is contained in:
Kurt Jaeger 2018-04-08 09:41:15 +00:00
parent 6af505e241
commit c83a73ccc8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=466786
24 changed files with 929 additions and 0 deletions

47
lang/J/Makefile Normal file
View file

@ -0,0 +1,47 @@
# $FreeBSD$
PORTNAME= J
PORTVERSION= ${JVERSION:S/^j//:S/-release//}
CATEGORIES= lang math
MAINTAINER= sevenjp@gmail.com
COMMENT= J programming language
LICENSE= GPLv3
LICENSE_FILE= ${WRKDIR}/jsource-j806-release/license.txt
ONLY_FOR_ARCHS= amd64
ONLY_FOR_ARCHS_REASON_amd64= Not built or tested for other archs. i386 needs hostdefs and netdefs files to be generated.
BUILD_DEPENDS= bash:shells/bash
LIB_DEPENDS= libpcreposix.so:devel/pcre \
libsqlite3.so:databases/sqlite3
USES+= libedit gmake shebangfix uidfix
SHEBANG_GLOB= *.sh
SUB_FILES= jconsole profile.ijs
USE_GITHUB= yes
GH_ACCOUNT= jsoftware
GH_PROJECT= jsource
GH_TAGNAME= ${JVERSION}
# J is released with ports-unfriendly versioning
JVERSION= j806-release
BIN_FILES= jconsole
LIB_FILES= libj.so libtsdll.so libjavx.so
do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/lib/j/bin
${MKDIR} ${STAGEDIR}${PREFIX}/share/j/system
${MKDIR} ${STAGEDIR}${PREFIX}/share/j/addons
${INSTALL_PROGRAM} ${BIN_FILES:C!^!${WRKDIR}/jbld/j64/bin/!} ${STAGEDIR}${PREFIX}/lib/j/bin/
${INSTALL_LIB} ${LIB_FILES:C!^!${WRKDIR}/jbld/j64/bin/!} ${STAGEDIR}${PREFIX}/lib/j/bin # Required by the J runtime
${INSTALL_DATA} ${WRKDIR}/profile.ijs ${STAGEDIR}${PREFIX}/share/j/
${INSTALL_SCRIPT} ${WRKDIR}/jconsole ${STAGEDIR}${PREFIX}/bin/
(cd ${WRKDIR}/jbld/j64/system && ${COPYTREE_SHARE} \* ${STAGEDIR}${PREFIX}/share/j/system)
(cd ${WRKDIR}/jbld/j64/addons && ${COPYTREE_SHARE} \* ${STAGEDIR}${PREFIX}/share/j/addons)
.include <bsd.port.mk>

3
lang/J/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1519502511
SHA256 (jsoftware-jsource-806-j806-release_GH0.tar.gz) = 033a787ad3180a8ead8f4a3880c016b8581ddf6a3081f86a88774575c7cc168f
SIZE (jsoftware-jsource-806-j806-release_GH0.tar.gz) = 2280551

5
lang/J/files/jconsole.in Normal file
View file

@ -0,0 +1,5 @@
#!/bin/sh
# $FreeBSD$
exec %%LOCALBASE%%/lib/j/bin/jconsole -jprofile %%LOCALBASE%%/share/j/profile.ijs

View file

@ -0,0 +1,28 @@
--- Makefile.orig 2018-02-24 19:49:42 UTC
+++ Makefile
@@ -0,0 +1,25 @@
+.PHONY: all
+all: make-${ARCH}
+
+.PHONY: make-amd64
+make-amd64: build-j64 libj-avx
+
+.PHONY: make-i386
+make-i386: build-j32
+
+.PHONY: init
+init:
+ make/install.sh
+
+.PHONY: libj-avx
+libj-avx: init
+ make/build_libj.sh j64avx
+
+build-%: init
+ make/build_jconsole.sh $*
+ make/build_libj.sh $*
+ make/build_tsdll.sh $*
+
+.PHONY: clean
+clean:
+ rm -rf ${jbld}

View file

@ -0,0 +1,21 @@
--- jlibrary/system/config/base.cfg.orig 2018-02-22 18:45:28 UTC
+++ jlibrary/system/config/base.cfg
@@ -90,6 +90,18 @@ case. 'Linux' do.
XDiff=: '/usr/bin/meld'
Editor=: 'geany +%l %f'
Editor_nox=: 'vi -c%l %f'
+case. 'FreeBSD' do.
+ BoxForm=: 0
+ Browser=: ''
+ Browser_nox=: '/usr/bin/w3m'
+ EPSReader=: '/usr/bin/evince'
+ ImageViewer=: ''
+ ImageViewer_nox=: ''
+ PDFReader=: '/usr/bin/evince'
+ PDFReader_nox=: ''
+ XDiff=: '/usr/bin/meld'
+ Editor=: 'geany +%l %f'
+ Editor_nox=: 'vi -c%l %f'
case. 'Win' do.
BoxForm=: 1
Browser=: ''

View file

@ -0,0 +1,128 @@
--- jlibrary/system/defs/hostdefs_freebsd_64.ijs.orig 2018-02-22 19:12:35 UTC
+++ jlibrary/system/defs/hostdefs_freebsd_64.ijs
@@ -0,0 +1,125 @@
+NB. do not edit -- created by sym2ijs
+
+cocurrent <'jdefs'
+
+F_OK=: 0
+R_OK=: 4
+W_OK=: 2
+X_OK=: 1
+STDIN_FILENO=: 0
+STDOUT_FILENO=: 1
+STDERR_FILENO=: 2
+SEEK_CUR=: 1
+SEEK_END=: 2
+SEEK_SET=: 0
+
+O_APPEND=: 8
+O_CREAT=: 512
+O_EXCL=: 2048
+O_RDONLY=: 0
+O_RDWR=: 2
+O_TRUNC=: 1024
+O_WRONLY=: 1
+
+O_ACCMODE=: 3
+O_NOCTTY=: 32768
+O_NONBLOCK=: 4
+FD_CLOEXEC=: 1
+F_DUPFD=: 0
+F_GETFD=: 1
+F_SETFD=: 2
+F_GETFL=: 3
+F_SETFL=: 4
+F_SETLK=: 12
+F_SETLKW=: 13
+F_GETLK=: 11
+F_UNLCK=: 2
+F_WRLCK=: 3
+flock_sz=: 32
+l_len_off=: 8
+l_len_sz=: 8
+l_pid_off=: 16
+l_pid_sz=: 4
+l_start_off=: 0
+l_start_sz=: 8
+l_type_off=: 20
+l_type_sz=: 2
+l_whence_off=: 22
+l_whence_sz=: 2
+
+PROT_READ=: 1
+PROT_WRITE=: 2
+PROT_EXEC=: 4
+PROT_NONE=: 0
+MAP_SHARED=: 1
+MAP_PRIVATE=: 2
+MAP_FIXED=: 16
+
+REG_EXTENDED=: 1
+REG_ICASE=: 2
+REG_NOSUB=: 4
+REG_NEWLINE=: 8
+
+regex_t_sz=: 32
+re_nsub_off=: 8
+re_nsub_sz=: 8
+regmatch_t_sz=: 16
+rm_so_off=: 0
+rm_so_sz=: 8
+rm_eo_off=: 8
+rm_eo_sz=: 8
+
+
+fd_set_sz=: 128
+fds_bits_off=: 0
+fds_bits_sz=: 128
+FD_SETSIZE=: 1024
+timeval_sz=: 16
+tv_sec_off=: 0
+tv_sec_sz=: 8
+tv_usec_off=: 8
+tv_usec_sz=: 8
+
+E2BIG=: 7
+EFAULT=: 14
+ENFILE=: 23
+ENOTTY=: 25
+EACCES=: 13
+EFBIG=: 27
+ENODEV=: 19
+ENXIO=: 6
+EAGAIN=: 35
+ENOENT=: 2
+EPERM=: 1
+EBADF=: 9
+EINTR=: 4
+ENOEXEC=: 8
+EPIPE=: 32
+EINVAL=: 22
+ENOLCK=: 77
+ERANGE=: 34
+EBUSY=: 16
+EIO=: 5
+ENOMEM=: 12
+EROFS=: 30
+EISDIR=: 21
+ENOSPC=: 28
+ESPIPE=: 29
+ECHILD=: 10
+EMFILE=: 24
+ENOSYS=: 78
+ESRCH=: 3
+EDEADLK=: 11
+EMLINK=: 31
+ENOTDIR=: 20
+EDOM=: 33
+ENOTEMPTY=: 66
+EXDEV=: 18
+EEXIST=: 17
+ENAMETOOLONG=: 63
+
+EINPROGRESS=: 36
+ECANCELED=: 85
+ETIMEDOUT=: 60
+EMSGSIZE=: 40
+ENOTSUP=: 45

View file

@ -0,0 +1,134 @@
--- jlibrary/system/defs/netdefs_freebsd_64.ijs.orig 2018-02-22 19:12:35 UTC
+++ jlibrary/system/defs/netdefs_freebsd_64.ijs
@@ -0,0 +1,131 @@
+NB. do not edit -- created by sym2ijs
+
+cocurrent <'jdefs'
+
+FIONBIO=: -2147195266
+FIONREAD=: 1074030207
+FD_SETSIZE=: 1024
+
+sockaddr_sz=: 16
+sa_family_off=: 1
+sa_family_sz=: 1
+sa_data_off=: 2
+sa_data_sz=: 14
+
+sockaddr_in_sz=: 16
+sin_family_off=: 1
+sin_family_sz=: 1
+sin_port_off=: 2
+sin_port_sz=: 2
+sin_addr_off=: 4
+sin_addr_sz=: 4
+
+in_addr_sz=: 4
+s_addr_off=: 0
+s_addr_sz=: 4
+
+hostent_sz=: 32
+h_name_off=: 0
+h_name_sz=: 8
+h_aliases_off=: 8
+h_aliases_sz=: 8
+h_addrtype_off=: 16
+h_addrtype_sz=: 4
+h_length_off=: 20
+h_length_sz=: 4
+h_addr_list_off=: 24
+h_addr_list_sz=: 8
+
+
+SIOCATMARK=: 1074033415
+
+
+IPPROTO_IP=: 0
+IPPROTO_ICMP=: 1
+IPPROTO_IGMP=: 2
+IPPROTO_TCP=: 6
+IPPROTO_PUP=: 12
+IPPROTO_UDP=: 17
+IPPROTO_IDP=: 22
+IPPROTO_RAW=: 255
+IPPROTO_MAX=: 256
+
+
+INADDR_ANY=: 0
+INADDR_LOOPBACK=: 2130706433
+INADDR_BROADCAST=: 4294967295
+INADDR_NONE=: 4294967295
+
+INADDR_UNSPEC_GROUP=: -536870912
+INADDR_ALLHOSTS_GROUP=: -536870911
+INADDR_MAX_LOCAL_GROUP=: -536870657
+IN_LOOPBACKNET=: 127
+
+SOCK_STREAM=: 1
+SOCK_DGRAM=: 2
+SOCK_RAW=: 3
+SOCK_RDM=: 4
+SOCK_SEQPACKET=: 5
+
+SOL_SOCKET=: 65535
+SO_DEBUG=: 1
+SO_REUSEADDR=: 4
+SO_KEEPALIVE=: 8
+SO_DONTROUTE=: 16
+SO_BROADCAST=: 32
+SO_LINGER=: 128
+SO_OOBINLINE=: 256
+
+SO_SNDBUF=: 4097
+SO_RCVBUF=: 4098
+SO_SNDLOWAT=: 4099
+SO_RCVLOWAT=: 4100
+SO_SNDTIMEO=: 4101
+SO_RCVTIMEO=: 4102
+SO_ERROR=: 4103
+SO_TYPE=: 4104
+
+linger_sz=: 8
+l_onoff_off=: 0
+l_onoff_sz=: 4
+l_linger_off=: 4
+l_linger_sz=: 4
+
+AF_UNSPEC=: 0
+AF_UNIX=: 1
+AF_INET=: 2
+AF_SNA=: 11
+AF_DECnet=: 12
+AF_APPLETALK=: 16
+AF_IPX=: 23
+AF_MAX=: 42
+PF_UNSPEC=: 0
+PF_UNIX=: 1
+PF_INET=: 2
+PF_SNA=: 11
+PF_DECnet=: 12
+PF_APPLETALK=: 16
+PF_IPX=: 23
+PF_MAX=: 42
+
+SOMAXCONN=: 128
+MSG_OOB=: 1
+MSG_PEEK=: 2
+MSG_DONTROUTE=: 4
+
+msghdr_sz=: 48
+msg_name_off=: 0
+msg_name_sz=: 8
+msg_namelen_off=: 8
+msg_namelen_sz=: 4
+msg_iov_off=: 16
+msg_iov_sz=: 8
+msg_iovlen_off=: 24
+msg_iovlen_sz=: 4
+msg_control_off=: 32
+msg_control_sz=: 8
+msg_controllen_off=: 40
+msg_controllen_sz=: 4
+msg_flags_off=: 44
+msg_flags_sz=: 4
+

View file

@ -0,0 +1,10 @@
--- jlibrary/system/main/regex.ijs.orig 2018-02-22 18:45:28 UTC
+++ jlibrary/system/main/regex.ijs
@@ -101,6 +101,7 @@ NB. rxdll is in bin or tools/regex
select. UNAME
case. 'Win' do. t=. 'jpcre.dll'
case. 'Darwin' do. t=. 'libjpcre.dylib'
+case. 'FreeBSD' do. t=. 'libpcreposix.so'
fcase. 'Linux' do. NB. fall throught
if. 2 0-:('libpcreposix.so.3 dummyfunction n')&(15!:0) ::(15!:10) '' do.
rxdll=: 'libpcreposix.so.3'

View file

@ -0,0 +1,55 @@
--- jlibrary/system/main/stdlib.ijs.orig 2018-02-22 18:45:28 UTC
+++ jlibrary/system/main/stdlib.ijs
@@ -35,6 +35,7 @@ if. notdef 'UNAME' do.
end.
end.
'libc.so.6 setlocale > x i *c'&(15!:0)^:(UNAME-:'Linux') 1;,'C'
+'libc.so.7 setlocale > x i *c'&(15!:0)^:(UNAME-:'FreeBSD') 1;,'C'
if. notdef 'IFRASPI' do.
if. UNAME -: 'Linux' do.
cpu=. 2!:0 'cat /proc/cpuinfo'
@@ -97,6 +98,7 @@ if. (<'home') -.@e. {."1 SystemFolders d
elseif. 'Android'-:UNAME do. t=. '/sdcard'
elseif. 'Darwin'-:UNAME do. t=. (0-:t){::'';~t=. 2!:5'HOME'
elseif. 'Linux'-:UNAME do. t=. (0-:t){::'';~t=. 2!:5'HOME'
+ elseif. 'FreeBSD'-:UNAME do. t=. (0-:t){::'';~t=. 2!:5'HOME'
elseif. do. t=. ''
end.
if. (''-:t)+.((,'/')-:t)+.('/root'-:t)+.('/usr/'-:5{.t) do.
@@ -111,6 +113,7 @@ if. (<'temp') -.@e. {."1 SystemFolders d
elseif. 'Android'-:UNAME do. t=. '/sdcard'
elseif. 'Darwin'-:UNAME do. 1!:5 ::] <t=. '/tmp/',":2!:6''
elseif. 'Linux'-:UNAME do. 1!:5 ::] <t=. '/tmp/',":2!:6''
+ elseif. 'FreeBSD'-:UNAME do. 1!:5 ::] <t=. '/tmp/',":2!:6''
elseif. do. t=. ''
end.
SystemFolders=: SystemFolders, 'temp';t
@@ -123,14 +126,14 @@ end.
18!:4 <'z'
18!:4 <'z'
UNXLIB=: ([: <;._1 ' ',]);._2 (0 : 0)
-libc.so.6 libc.so libc.dylib libc.dylib
-libz.so.1 libz.so libz.dylib libz.dylib
-libsqlite3.so.0 libsqlite.so libsqlite3.dylib libsqlite3.dylib
-libxml2.so.2 libxml2.so libxml2.dylib libxml2.dylib
+libc.so.6 libc.so libc.so.7 libc.dylib libc.dylib
+libz.so.1 libz.so libc.so.7 libz.dylib libz.dylib
+libsqlite3.so.0 libsqlite.so libsqlite3.so.0 libsqlite3.dylib libsqlite3.dylib
+libxml2.so.2 libxml2.so libxml2.so.2 libxml2.dylib libxml2.dylib
)
unxlib=: 3 : 0
r=. (;: 'c z sqlite3') i. <,y
-c=. IFIOS + (;: 'Linux Android Darwin') i. <UNAME_z_
+c=. IFIOS + (;: 'Linux Android FreeBSD Darwin') i. <UNAME_z_
(<r,c) {:: UNXLIB_z_
)
18!:4 <'z'
@@ -1344,7 +1347,7 @@ require 'pacman'
x do_install_jpacman_ y
)
getqtbin=: 3 : 0
-if. (<UNAME) -.@e. 'Linux';'Darwin';'Win' do. return. end.
+if. (<UNAME) -.@e. 'Linux';'Darwin';'Win';'FreeBSD' do. return. end.
if. IFQT do.
smoutput 'must run from jconsole' return.
end.

View file

@ -0,0 +1,11 @@
--- jsrc/jeload.c.orig 2018-02-22 18:45:28 UTC
+++ jsrc/jeload.c
@@ -322,6 +322,8 @@ int jefirst(int type,char* arg)
strcat(input,"[UNAME_z_=:'Win'");
#elif defined(__MACH__)
strcat(input,"[UNAME_z_=:'Darwin'");
+#elif defined(__FreeBSD__)
+ strcat(input,"[UNAME_z_=:'FreeBSD'");
#elif !defined(ANDROID)
strcat(input,"[UNAME_z_=:'Linux'");
#endif

View file

@ -0,0 +1,8 @@
--- jsrc/jversion.h.orig 2018-02-22 19:12:35 UTC
+++ jsrc/jversion.h
@@ -0,0 +1,5 @@
+#define jversion "806"
+#define jplatform "freebsd" // windows/linux/darwin/raspberry/android/...
+#define jtype "release" // release,beta,... may include bug level such as beta-3
+#define jlicense "GPL3"
+#define jbuilder "unknown" // website or email

View file

@ -0,0 +1,29 @@
--- make/build_jconsole.sh.orig 2018-02-24 19:49:42 UTC
+++ make/build_jconsole.sh
@@ -1,9 +1,8 @@
#!/usr/local/bin/bash
# $1 is j32 or j64
-cd ~
-. jvars.sh
+. make/jvars.sh
-common=" -fPIC -O1 -Wextra -Wno-unused-parameter "
+common=" -fPIC -Wextra -Wno-unused-parameter "
case $jplatform\_$1 in
@@ -31,6 +30,14 @@ darwin_j64)
COMPILE="$common -DREADLINE -mmacosx-version-min=10.5"
LINK=" -ledit -ldl -lncurses -mmacosx-version-min=10.5 -o jconsole "
;;
+freebsd_j32)
+COMPILE="$common -m32 -DREADLINE"
+LINK="-L${LOCALBASE}/lib -ledit -m32 -o jconsole "
+;;
+freebsd_j64)
+COMPILE="$common -DREADLINE"
+LINK="-L${LOCALBASE}/lib -ledit -o jconsole "
+;;
*)
echo no case for those parameters
exit

View file

@ -0,0 +1,54 @@
--- make/build_jdll.sh.orig 2018-02-24 19:49:42 UTC
+++ make/build_jdll.sh
@@ -1,7 +1,6 @@
#!/usr/local/bin/bash
# $1 is j32 or j64
-cd ~
-. jvars.sh
+. make/jvars.sh
# gcc 5 vs 4 - killing off linux asm routines (overflow detection)
# new fast code uses builtins not available in gcc 4
@@ -37,10 +36,10 @@ fi
if [ "x$COMPILER" = x'gcc' ] ; then
# gcc
-common="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-shift-negative-value"
+common="$OPENMP -fPIC -fwrapv -fno-strict-aliasing -Wextra -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-shift-negative-value"
else
# clang 3.5 .. 5.0
-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+common="$OPENMP -Werror -fPIC -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
fi
darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
@@ -101,6 +100,29 @@ LINK=" -dynamiclib -lm -ldl $LDOPENMP -m
OBJS_FMA=" blis/gemm_int-fma.o "
;;
+freebsd_j32) # freebsd x86
+TARGET=libj.so
+# faster, but sse2 not available for 32-bit amd cpu
+# sse does not support mfpmath=sse in 32-bit gcc
+COMPILE="$common -m32 -msse2 -mfpmath=sse -DC_NOMULTINTRINSIC "
+# slower, use 387 fpu and truncate extra precision
+# COMPILE="$common -m32 -ffloat-store "
+LINK=" -shared -Wl,-soname,libj.so -m32 -lm $LDOPENMP32 -o libj.so "
+;;
+
+freebsd_j64) # freebsd intel 64bit
+TARGET=libj.so
+COMPILE="$common $OPENMP "
+LINK=" -shared -Wl,-soname,libj.so -lm $LDOPENMP -o libj.so "
+;;
+
+freebsd_j64avx) # freebsd intel 64bit avx
+TARGET=libj.so
+COMPILE="$common -mavx -DC_AVX=1 $OPENMP "
+LINK=" -shared -Wl,-soname,libj.so -lm $LDOPENMP -o libj.so "
+OBJS_FMA=" blis/gemm_int-fma.o "
+;;
+
windows_j32) # windows x86
DLLOBJS=" jdll.o jdllcomx.o "
LIBJDEF=" $jgit/dllsrc/jdll.def "

View file

@ -0,0 +1,77 @@
--- make/build_libj.sh.orig 2018-02-24 19:49:42 UTC
+++ make/build_libj.sh
@@ -1,7 +1,6 @@
#!/usr/local/bin/bash
# $1 is j32 or j64
-cd ~
-. jvars.sh
+. make/jvars.sh
# gcc 5 vs 4 - killing off linux asm routines (overflow detection)
# new fast code uses builtins not available in gcc 4
@@ -38,10 +37,10 @@ fi
if [ "x$COMPILER" = x'gcc' ] ; then
# gcc
-common="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-shift-negative-value"
+common="$OPENMP -fPIC -fwrapv -fno-strict-aliasing -Wextra -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-shift-negative-value"
else
# clang 3.5 .. 5.0
-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+common="$OPENMP -Werror -fPIC -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
fi
darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
@@ -55,19 +54,19 @@ TARGET=libj.so
COMPILE="$common -m32 -msse2 -mfpmath=sse -DC_NOMULTINTRINSIC "
# slower, use 387 fpu and truncate extra precision
# COMPILE="$common -m32 -ffloat-store "
-LINK=" -shared -Wl,-soname,libj.so -m32 -lm -ldl $LDOPENMP32 -o libj.so "
+LINK=" -shared -Wl,-soname,libj.so -m32 -lm $LDOPENMP32 -o libj.so "
;;
linux_j64) # linux intel 64bit
TARGET=libj.so
COMPILE="$common "
-LINK=" -shared -Wl,-soname,libj.so -lm -ldl $LDOPENMP -o libj.so "
+LINK=" -shared -Wl,-soname,libj.so -lm $LDOPENMP -o libj.so "
;;
linux_j64avx) # linux intel 64bit avx
TARGET=libj.so
COMPILE="$common -mavx -DC_AVX=1 "
-LINK=" -shared -Wl,-soname,libj.so -lm -ldl $LDOPENMP -o libj.so "
+LINK=" -shared -Wl,-soname,libj.so -lm $LDOPENMP -o libj.so "
OBJS_FMA=" blis/gemm_int-fma.o "
;;
@@ -102,6 +101,29 @@ LINK=" -dynamiclib -lm -ldl $LDOPENMP -m
OBJS_FMA=" blis/gemm_int-fma.o "
;;
+freebsd_j32) # freebsd x86
+TARGET=libj.so
+# faster, but sse2 not available for 32-bit amd cpu
+# sse does not support mfpmath=sse in 32-bit gcc
+COMPILE="$common -m32 -msse2 -mfpmath=sse -DC_NOMULTINTRINSIC "
+# slower, use 387 fpu and truncate extra precision
+# COMPILE="$common -m32 -ffloat-store "
+LINK=" -shared -Wl,-soname,libj.so -m32 -lm $LDOPENMP32 -o libj.so "
+;;
+
+freebsd_j64) # freebsd intel 64bit
+TARGET=libj.so
+COMPILE="$common "
+LINK=" -shared -Wl,-soname,libj.so -lm $LDOPENMP -o libj.so "
+;;
+
+freebsd_j64avx) # freebsd intel 64bit avx
+TARGET=libj.so
+COMPILE="$common -mavx -DC_AVX=1 "
+LINK=" -shared -Wl,-soname,libj.so -lm $LDOPENMP -o libj.so "
+OBJS_FMA=" blis/gemm_int-fma.o "
+;;
+
*)
echo no case for those parameters
exit

View file

@ -0,0 +1,31 @@
--- make/build_tsdll.sh.orig 2018-02-24 19:49:42 UTC
+++ make/build_tsdll.sh
@@ -1,9 +1,8 @@
#!/usr/local/bin/bash
# $1 is j32 or j64
-cd ~
-. jvars.sh
+. make/jvars.sh
-common=" -fPIC -O1 -Werror -Wextra -Wno-unused-parameter"
+common=" -fPIC -Werror -Wextra -Wno-unused-parameter"
case $jplatform\_$1 in
@@ -38,6 +37,16 @@ TARGET=libtsdll.dylib
COMPILE="$common "
LINK=" -dynamiclib -o libtsdll.dylib "
;;
+freebsd_j32)
+TARGET=libtsdll.so
+COMPILE="$common -m32 "
+LINK=" -shared -Wl,-soname,libtsdll.so -m32 -o libtsdll.so "
+;;
+freebsd_j64)
+TARGET=libtsdll.so
+COMPILE="$common "
+LINK=" -shared -Wl,-soname,libtsdll.so -o libtsdll.so "
+;;
*)
echo no case for those parameters
exit

View file

@ -0,0 +1,21 @@
--- make/domake.sh.orig 2017-11-02 18:50:23 UTC
+++ make/domake.sh
@@ -3,8 +3,7 @@
# run by build_jconsole and build_libj
# $1 is j32 or j64
-cd ~
-. jvars.sh
+. make/jvars.sh
echo $TARGET
echo $COMPILE
@@ -12,7 +11,7 @@ echo $LINK
mkdir -p $jbld/jout/$TARGET/$1/blis
cd $jbld/jout/$TARGET/$1
-make -f $jmake/makefile
+gmake -f $jmake/makefile
if [ $1 = "j64avx" ] ; then
if [ $TARGET = "libj.dylib" ] ; then

View file

@ -0,0 +1,18 @@
--- make/install.sh.orig 2018-02-24 19:49:42 UTC
+++ make/install.sh
@@ -1,14 +1,7 @@
#!/usr/local/bin/bash
# install jbld folders - new install or a reinstall
-cd ~
-if [ ! -f jvars.sh ]; then
- echo "~/jvars.sh must exist"
- exit 1
-fi
-
-cd ~
-. jvars.sh
+. make/jvars.sh
rm -f -r $jbld
mkdir $jbld

View file

@ -0,0 +1,16 @@
--- make/jvars.sh.orig 2017-11-02 18:50:23 UTC
+++ make/jvars.sh
@@ -1,11 +1,11 @@
# source shell script (read with . jvars.sh) so stuff is easy to find
# edit following if your install is not standard
-jgit=~/gitdev/jsource # git jsource folder
+jgit=~/jsource-j806-release # git jsource folder
jbld=~/jbld # test libraries and binaries will be put here
# edit platform to build - linux darwin raspberry
-jplatform=linux
+jplatform=freebsd
# should not be necessary to edit after here
j32=$jbld/j32/bin/jconsole

View file

@ -0,0 +1,11 @@
--- make/makefile.orig 2018-02-24 19:45:08 UTC
+++ make/makefile
@@ -3,7 +3,7 @@ vpath % $(jgit)/jsrc
%.o: %.c
$(CC) -c $(CFLAGS) $(CFLAGS_FMA) -o$@ $^
-CFLAGS=$(COMPILE)
+CFLAGS+=$(COMPILE)
$(OBJS_FMA) : CFLAGS_FMA := -mfma
$(TARGET) : $(OBJS) $(OBJS_FMA)
$(CC) $(OBJS) $(OBJS_FMA) $(LINK)

View file

@ -0,0 +1,11 @@
--- netdefs/netdefs.c.orig 2018-02-22 18:45:28 UTC
+++ netdefs/netdefs.c
@@ -152,7 +152,7 @@ int main(){
printf ("msg_iov_sz=: " FMTI "\n",sizeof(((struct msghdr*)0)->msg_iov));
printf ("msg_iovlen_off=: " FMTI "\n",offset(struct msghdr,msg_iovlen));
printf ("msg_iovlen_sz=: " FMTI "\n",sizeof(((struct msghdr*)0)->msg_iovlen));
-#if defined(linux) || defined(Darwin)
+#if defined(linux) || defined(Darwin) || defined(__FreeBSD__)
printf ("msg_control_off=: " FMTI "\n",offset(struct msghdr,msg_control));
printf ("msg_control_sz=: " FMTI "\n",sizeof(((struct msghdr*)0)->msg_control));
printf ("msg_controllen_off=: " FMTI "\n",offset(struct msghdr,msg_controllen));

View file

@ -0,0 +1,9 @@
JE and jconsole have been installed in %%LOCALBASE%%/lib/j/bin.
Addons are installed in %%LOCALBASE%%/share/j/addons and system files
in %%LOCALBASE%%/share/j/system.
This port installs ONLY the base system. In order to install
additional addons, use the JAL, running jconsole as root:
http://code.jsoftware.com/wiki/JAL/Package_Manager/jpkg

View file

@ -0,0 +1,54 @@
NB. J profile
NB. JFE sets BINPATH_z_ and ARGV_z_
NB. add your sentences in startup.ijs
NB. $FreeBSD$
systype=. 9!:12''
jpathsep_z_=: '/'&(('\' I.@:= ])})
BINPATH_z_=: jpathsep BINPATH_z_
NB. create SystemFolders
bin=. BINPATH
install=. (bin i: '/'){.bin
fhs=. (FHS"_)^:(0=4!:0<'FHS')(5=systype)*.0=#1!:0<BINPATH,'%%LOCALBASE%%/share/j/system/util/boot.ijs'
install=. (0&~:fhs){::install;'%%LOCALBASE%%/share/j'
install=. (INSTALLROOT"_)^:(0=4!:0<'INSTALLROOT') install
addons=. install,'/addons'
system=. install,'/system'
tools=. install,'/tools'
home=. >(systype-5){(2!:5'HOME');2!:5'USERPROFILE'
home=. >(0-:home){home;,'/'
isroot=. (0=#1!:0'/data') *. ('root'-:2!:5'USER') +. (<home) e. '/var/root';'/root';'';,'/'
userx=. '/j',('64-'#~16={:$3!:3[2),'806-user'
user=. home,userx
user=. >isroot{user;install,'/user'
home=. >isroot{home;install
break=. user,'/break'
config=. user,'/config'
snap=. user,'/snap'
temp=. user,'/temp'
temp=. >isroot{temp;(*#1!:0'/tmp'){::'/tmp';~(0-:2!:5'TMPDIR'){::(2!:5'TMPDIR');temp
ids=. ;:'addons bin break config home install snap system tools temp user'
0!:0 :: ] <(({.~ i:&'/') jpathsep >{.4!:3''),'/profilex.ijs' NB. override
0!:0 :: ] ^:(0=#1!:0 (({.~ i:&'/') jpathsep >{.4!:3''),'/startup_android.ijs') <home,>(systype-5){'/.jprofile.ijs';'/_jprofile.ijs' NB. override per user except for standalone script
SystemFolders_j_=: ids,.jpathsep@".&.>ids
md=. 3 : 0 NB. recursive makedir
a=. jpathsep y,'/'
if. ('root'-:2!:5'USER') +. ('//'-:2{.a)+.('/root/'-:6{.a)+.('/var/root/'-:10{.a)+.('/usr/'-:5{.a)+.('/tmp'-:a) do. return. end. NB. installed under / /root /usr
if. -.#1!:0 }:a do.
for_n. I. a='/' do. 1!:5 :: [ <n{.a end.
end.
)
NB. try to ensure user folders exist
md user,'/projects'
md break
md config
md snap
md temp
NB. boot up J and load startup.ijs if it exists
0!:0 <jpathsep (4!:55 (;:'systype fhs isroot userx ids md'), ids)]system,'/util/boot.ijs'

5
lang/J/pkg-descr Normal file
View file

@ -0,0 +1,5 @@
J (J language) is a high-level, general-purpose, high-performance
programming language. J is portable and runs on 32/64-bit
Windows/Linux/Mac as well as iOS, Android, and other platforms.
WWW: http://www.jsoftware.com

143
lang/J/pkg-plist Normal file
View file

@ -0,0 +1,143 @@
bin/jconsole
lib/j/bin/jconsole
lib/j/bin/libj.so
lib/j/bin/libjavx.so
lib/j/bin/libtsdll.so
share/j/addons/data/jmf/history.txt
share/j/addons/data/jmf/jmf.ijs
share/j/addons/data/jmf/manifest.ijs
share/j/addons/data/jmf/test/testdata.ijs
share/j/addons/data/jmf/test/testjmf.ijs
share/j/addons/ide/jhs/build.ijs
share/j/addons/ide/jhs/config/jhs.cfg
share/j/addons/ide/jhs/config/jhs_default.ijs
share/j/addons/ide/jhs/core.ijs
share/j/addons/ide/jhs/demo/jdemo1.ijs
share/j/addons/ide/jhs/demo/jdemo10.ijs
share/j/addons/ide/jhs/demo/jdemo11.ijs
share/j/addons/ide/jhs/demo/jdemo12.ijs
share/j/addons/ide/jhs/demo/jdemo2.ijs
share/j/addons/ide/jhs/demo/jdemo3.ijs
share/j/addons/ide/jhs/demo/jdemo4.ijs
share/j/addons/ide/jhs/demo/jdemo5.ijs
share/j/addons/ide/jhs/demo/jdemo6.ijs
share/j/addons/ide/jhs/demo/jdemo7.ijs
share/j/addons/ide/jhs/demo/jdemo8.ijs
share/j/addons/ide/jhs/demo/jdemo9.ijs
share/j/addons/ide/jhs/demo/jdemogl1.ijs
share/j/addons/ide/jhs/favicon.ico
share/j/addons/ide/jhs/gnuplot.ijs
share/j/addons/ide/jhs/gpdemo.ijs
share/j/addons/ide/jhs/grep.exe
share/j/addons/ide/jhs/history.txt
share/j/addons/ide/jhs/jal.ijs
share/j/addons/ide/jhs/jbinfo.ijs
share/j/addons/ide/jhs/jd3.ijs
share/j/addons/ide/jhs/jdemo.ijs
share/j/addons/ide/jhs/jfif.ijs
share/j/addons/ide/jhs/jfile.ijs
share/j/addons/ide/jhs/jfiles.ijs
share/j/addons/ide/jhs/jfilesrc.ijs
share/j/addons/ide/jhs/jgcp.ijs
share/j/addons/ide/jhs/jhelp.ijs
share/j/addons/ide/jhs/jhs.jproj
share/j/addons/ide/jhs/jijs.ijs
share/j/addons/ide/jhs/jijsce.ijs
share/j/addons/ide/jhs/jijsipad.ijs
share/j/addons/ide/jhs/jijsta.ijs
share/j/addons/ide/jhs/jijx.ijs
share/j/addons/ide/jhs/jijxalt.ijs
share/j/addons/ide/jhs/jijxaz.ijs
share/j/addons/ide/jhs/jijxdebug.ijs
share/j/addons/ide/jhs/jijxh.ijs
share/j/addons/ide/jhs/jijxipad.ijs
share/j/addons/ide/jhs/jijxm.ijs
share/j/addons/ide/jhs/jijxmin.ijs
share/j/addons/ide/jhs/jlogin.ijs
share/j/addons/ide/jhs/js/codemirror/codemirror.4.2.css
share/j/addons/ide/jhs/js/codemirror/codemirror.min.4.2.js
share/j/addons/ide/jhs/js/codemirror/j/j.4.2.js
share/j/addons/ide/jhs/js/codemirror/j/jtheme.4.2.css
share/j/addons/ide/jhs/js/codemirror/license.txt
share/j/addons/ide/jhs/js/codemirror/util/dialog.4.2.css
share/j/addons/ide/jhs/js/codemirror/util/dialog.4.2.js
share/j/addons/ide/jhs/js/codemirror/util/search.4.2.js
share/j/addons/ide/jhs/js/codemirror/util/searchcursor.4.2.js
share/j/addons/ide/jhs/js/d3/LICENSE
share/j/addons/ide/jhs/js/d3/LICENSE.v3
share/j/addons/ide/jhs/js/d3/d3.js
share/j/addons/ide/jhs/js/d3/d3.min.js
share/j/addons/ide/jhs/js/d3/d3.v3.js
share/j/addons/ide/jhs/js/d3/d3.v3.min.js
share/j/addons/ide/jhs/js/excanvas.js
share/j/addons/ide/jhs/js/jquery-1.5.1.min.js
share/j/addons/ide/jhs/js/jquery/handsontable.css
share/j/addons/ide/jhs/js/jquery/handsontable.js
share/j/addons/ide/jhs/js/jquery/jquery-2.0.3.min.js
share/j/addons/ide/jhs/js/jquery/jquery-2.0.3.min.map
share/j/addons/ide/jhs/js/jquery/jquery-ui.css
share/j/addons/ide/jhs/js/jquery/jquery-ui.min.js
share/j/addons/ide/jhs/js/jquery/json-patch-duplex.js.map
share/j/addons/ide/jhs/js/jquery/smoothness/images/animated-overlay.gif
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-bg_glass_75_dadada_1x400.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-icons_222222_256x240.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-icons_2e83ff_256x240.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-icons_454545_256x240.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-icons_888888_256x240.png
share/j/addons/ide/jhs/js/jquery/smoothness/images/ui-icons_cd0a0a_256x240.png
share/j/addons/ide/jhs/js/jquery/smoothness/jquery-ui.custom.css
share/j/addons/ide/jhs/js/webgl/glmatrix-min.js
share/j/addons/ide/jhs/jtable.ijs
share/j/addons/ide/jhs/jum.ijs
share/j/addons/ide/jhs/manifest.ijs
share/j/addons/ide/jhs/readme.txt
share/j/addons/ide/jhs/shortcut.ijs
share/j/addons/ide/jhs/sp.ijs
share/j/addons/ide/jhs/spxdemo.ijs
share/j/addons/ide/jhs/utilh.ijs
share/j/addons/ide/jhs/utiljs.ijs
share/j/profile.ijs
share/j/system/config/base.cfg
share/j/system/config/folders.cfg
share/j/system/config/version.txt
share/j/system/defs/hostdefs_aix.ijs
share/j/system/defs/hostdefs_android.ijs
share/j/system/defs/hostdefs_android_64.ijs
share/j/system/defs/hostdefs_darwin.ijs
share/j/system/defs/hostdefs_darwin_64.ijs
share/j/system/defs/hostdefs_freebsd_64.ijs
share/j/system/defs/hostdefs_linux.ijs
share/j/system/defs/hostdefs_linux_64.ijs
share/j/system/defs/hostdefs_sunos.ijs
share/j/system/defs/hostdefs_win.ijs
share/j/system/defs/hostdefs_win_64.ijs
share/j/system/defs/netdefs_aix.ijs
share/j/system/defs/netdefs_android.ijs
share/j/system/defs/netdefs_android_64.ijs
share/j/system/defs/netdefs_darwin.ijs
share/j/system/defs/netdefs_darwin_64.ijs
share/j/system/defs/netdefs_freebsd_64.ijs
share/j/system/defs/netdefs_linux.ijs
share/j/system/defs/netdefs_linux_64.ijs
share/j/system/defs/netdefs_sunos.ijs
share/j/system/defs/netdefs_win.ijs
share/j/system/defs/netdefs_win_64.ijs
share/j/system/main/regex.ijs
share/j/system/main/socket.ijs
share/j/system/main/stdlib.ijs
share/j/system/main/task.ijs
share/j/system/util/boot.ijs
share/j/system/util/configure.ijs
share/j/system/util/pacman.ijs
share/j/system/util/pm.ijs
share/j/system/util/pp.ijs
share/j/system/util/project.ijs
share/j/system/util/scripts.ijs
share/j/system/util/tar.ijs