Merge commit '97ef0077f06cef6f6bb93b0dae22441078647486' as 'cde/programs/dtksh/ksh93'
This commit is contained in:
66
cde/programs/dtksh/ksh93/src/cmd/builtin/Mamfile
Normal file
66
cde/programs/dtksh/ksh93/src/cmd/builtin/Mamfile
Normal file
@@ -0,0 +1,66 @@
|
||||
note *
|
||||
note * This build file is in the Make Abstract Machine (MAM) language. It was
|
||||
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
|
||||
note * it manually because nmake had too many problems to keep using. The
|
||||
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
|
||||
note * indentation to improve readability. The language is documented in
|
||||
note * src/cmd/INIT/README-mamake.md.
|
||||
note *
|
||||
setv INSTALLROOT ../../..
|
||||
setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast
|
||||
setv PACKAGE_cmd ${INSTALLROOT}
|
||||
setv PACKAGEROOT ../../../../..
|
||||
setv CC cc
|
||||
setv mam_cc_FLAGS
|
||||
setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?}
|
||||
setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??}
|
||||
setv IFFEFLAGS
|
||||
setv LDFLAGS
|
||||
make .INIT
|
||||
make ${PACKAGE_ast_INCLUDE}/cmdlist.h
|
||||
done ${PACKAGE_ast_INCLUDE}/cmdlist.h
|
||||
exec - sed -e '/^CMDLIST(.*)$/!d' -e 's/CMDLIST(\(.*\))/\1/' -e '/^getconf$/d' -e '/^ln$/d' -e '/^mv$/d' -e '/^md5sum$/d' -e '/^sum$/d' ${PACKAGE_ast_INCLUDE}/cmdlist.h
|
||||
bind -lcmd
|
||||
done .INIT dontcare virtual
|
||||
make install
|
||||
make pty
|
||||
make pty.o
|
||||
make pty.c
|
||||
make FEATURE/pty implicit
|
||||
make features/pty
|
||||
done features/pty
|
||||
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty
|
||||
done FEATURE/pty generated
|
||||
make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast_time.h
|
||||
prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/regex.h implicit
|
||||
make ${PACKAGE_ast_INCLUDE}/proc.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/proc.h
|
||||
prev ${PACKAGE_ast_INCLUDE}/error.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/cmd.h implicit
|
||||
done pty.c
|
||||
prev pty.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -D_PACKAGE_ast -DCMD_STANDALONE=b_pty -c pty.c
|
||||
done pty.o generated
|
||||
bind -lutil dontcare
|
||||
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} -lm ${mam_libcmd}
|
||||
done pty generated
|
||||
make ${INSTALLROOT}/bin
|
||||
exec - if silent test ! -d ${INSTALLROOT}/bin
|
||||
exec - then mkdir -p ${INSTALLROOT}/bin
|
||||
exec - fi
|
||||
done ${INSTALLROOT}/bin generated
|
||||
make ${INSTALLROOT}/bin/pty
|
||||
prev pty
|
||||
exec - ${STDCMP} 2>/dev/null -s pty ${INSTALLROOT}/bin/pty || { ${STDMV} ${INSTALLROOT}/bin/pty ${INSTALLROOT}/bin/pty.old 2>/dev/null || true; ${STDCP} pty ${INSTALLROOT}/bin/pty ;}
|
||||
done ${INSTALLROOT}/bin/pty generated
|
||||
make ${INSTALLROOT}/bin
|
||||
exec - if silent test ! -d ${INSTALLROOT}/bin
|
||||
exec - then mkdir -p ${INSTALLROOT}/bin
|
||||
exec - fi
|
||||
done ${INSTALLROOT}/bin virtual
|
||||
done install virtual
|
||||
make test
|
||||
done test dontcare virtual
|
||||
14
cde/programs/dtksh/ksh93/src/cmd/builtin/RELEASE
Normal file
14
cde/programs/dtksh/ksh93/src/cmd/builtin/RELEASE
Normal file
@@ -0,0 +1,14 @@
|
||||
This file is of historical interest only. For recent changes in both ksh 93u+m
|
||||
and the accompanying libraries, see the file NEWS in the top-level directory.
|
||||
____
|
||||
|
||||
12-02-28 pty.c: change --verbose[=level] to --debug=level
|
||||
12-01-26 pty.c: fix --man docs
|
||||
10-06-21 pty.c: add 4 sec timeout for initial handshake -- fix me!!
|
||||
10-04-12 pty: fix sfpoll() result read/write bug
|
||||
10-04-01 pty: add --tty='stty-settings'
|
||||
10-03-19 pty: add --dialogue
|
||||
10-03-15 pty: fix select() fd management
|
||||
09-03-31 features/pty,Makefile: add pty.h and -lutil refs for Linux -- great, another util library
|
||||
09-01-30 pty.c: add <ast_time.h> (for fd_set!! on mvs.390)
|
||||
06-07-20 pty.c: add
|
||||
63
cde/programs/dtksh/ksh93/src/cmd/builtin/features/pty
Normal file
63
cde/programs/dtksh/ksh93/src/cmd/builtin/features/pty
Normal file
@@ -0,0 +1,63 @@
|
||||
header sys/types.h
|
||||
header pty.h
|
||||
header libutil.h
|
||||
header sys/pty.h
|
||||
header sys/ptyio.h
|
||||
header sys/vty.h
|
||||
header sys/ioctl.h
|
||||
header stropts.h
|
||||
|
||||
lib openpty,_getpty,ptsname -lutil
|
||||
lib grantpt,unlockpt,posix_openpt stdlib.h
|
||||
lib cfmakeraw termios.h
|
||||
|
||||
# try once with -lm, once without
|
||||
tst - -lm - - output{
|
||||
#include <fcntl.h>
|
||||
#if _lib_ptsname
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sfio.h>
|
||||
int main()
|
||||
{
|
||||
int i;
|
||||
struct stat statb;
|
||||
static char* pty[] = { "/dev/ptyp0000", "/dev/ptym/ptyp0", "/dev/ptyp0" };
|
||||
#if _lib_ptsname
|
||||
int fd;
|
||||
static char* ptc[] = { "/dev/ptmx", "/dev/ptc", "/dev/ptmx_bsd" };
|
||||
|
||||
for (i = 0; i < sizeof(ptc) / sizeof(ptc[0]); i++)
|
||||
if((fd = open(ptc[i], 2))>=0)
|
||||
{
|
||||
if (ptsname(fd))
|
||||
{
|
||||
sfprintf(sfstdout, "#define _pty_clone\t\"%s\"\n", ptc[i]);
|
||||
close(fd);
|
||||
break;
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
#endif
|
||||
for (i = 0;; i++)
|
||||
if(i >= (sizeof(pty) / sizeof(pty[0]) - 1) || stat(pty[i], &statb)>=0)
|
||||
{
|
||||
sfprintf(sfstdout, "#define _pty_first\t\"%s\"\n", pty[i]);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}end fail{
|
||||
case ${_features_pty_TRIEDONCE-no} in
|
||||
no) _features_pty_TRIEDONCE=yes ;;
|
||||
*) echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
}end
|
||||
|
||||
extern _getpty char* (int*, int, mode_t, int)
|
||||
extern openpty int (int*, int*, char*, struct termios*, struct winsize*)
|
||||
extern ptsname char* (int)
|
||||
1146
cde/programs/dtksh/ksh93/src/cmd/builtin/pty.c
Normal file
1146
cde/programs/dtksh/ksh93/src/cmd/builtin/pty.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user