mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
use a patchfile to augment init.c instead of copying it entirely
This commit is contained in:
parent
90fff44682
commit
428223ee80
5 changed files with 65 additions and 2149 deletions
2
cde/.gitignore
vendored
2
cde/.gitignore
vendored
|
@ -908,7 +908,7 @@ programs/dtinfo/tools/misc/treeres
|
|||
# program/dtksh
|
||||
programs/dtksh/FEATURE
|
||||
programs/dtksh/dtksh
|
||||
programs/dtksh/suid_exec
|
||||
programs/dtksh/init.c
|
||||
programs/dtksh/examples/CallDataTest4
|
||||
programs/dtksh/examples/CallbackTest2
|
||||
programs/dtksh/examples/DtCursorTest2
|
||||
|
|
|
@ -214,7 +214,7 @@ programs/dtksh/dtksh
|
|||
mode = 0555
|
||||
}
|
||||
#
|
||||
programs/dtksh/suid_exec
|
||||
programs/dtksh/ksh93/bin/suid_exec
|
||||
{ default
|
||||
install_target = /usr/dt/bin/suid_exec
|
||||
owner = root
|
||||
|
|
|
@ -56,7 +56,7 @@ LOCAL_LIBRARIES = $(DTHELPLIB) $(DTWIDGETLIB) $(DTSVCLIB) $(DTPRINTLIB) \
|
|||
$(KSH93SRC)/lib/libcmd.a $(KSH93SRC)/lib/libast.a \
|
||||
$(KSH93SRC)/lib/libdll.a libshell.a
|
||||
|
||||
EXTRA_DEFINES = -DKSHELL -DSHOPT_RAWONLY
|
||||
EXTRA_DEFINES = -DKSHELL -DSHOPT_RAWONLY '-DAST_VERSION=20111111'
|
||||
|
||||
EXTRA_INCLUDES = -I$(DTHELPSRC) -I$(DTPRINTSRC)
|
||||
|
||||
|
@ -70,8 +70,7 @@ KSH93LIBSHELL = $(KSH93SRC)/lib/libshell.a
|
|||
|
||||
PROGRAMS = dtksh
|
||||
|
||||
SRCS = init.c \
|
||||
widget.c \
|
||||
SRCS = widget.c \
|
||||
dtkcvt.c \
|
||||
dtkcmds.c \
|
||||
XtCvtrs.c \
|
||||
|
@ -84,6 +83,7 @@ SRCS = init.c \
|
|||
|
||||
OBJS = \
|
||||
pmain.o \
|
||||
init.o \
|
||||
libshell.a \
|
||||
widget.o \
|
||||
dtkcvt.o \
|
||||
|
@ -106,8 +106,9 @@ libshell.a: $(KSH93LIBSHELL) init.o
|
|||
|
||||
pmain.o:
|
||||
cd ksh93; ./bin/package flat make CCFLAGS='$(SUIDEXECDEFINES) -g'
|
||||
cp ./ksh93/src/cmd/ksh93/sh/init.c init.c
|
||||
patch -u init.c -i init.patch
|
||||
./setup.sh
|
||||
cp ./ksh93/bin/suid_exec suid_exec
|
||||
|
||||
SpecialObjectRule(init.o, $(NULL), -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_2DMATCH -DSHOPT_PFSH -DSHOPT_MULTIBYTE -DSHOPT_BGX -DSHOPT_AUDIT '-D_API_ast=20100309' -D_PACKAGE_ast -DSHOPT_DYNAMIC -D_BLD_shell -DSHOPT_KIA -DKSHELL -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_FIXEDARRAY '-DERROR_CONTEXT_T=Error_context_t' -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DBUILD_DTKSH -l$(KSH93SRC)/lib/libcmd.a -l$(KSH93SRC)/lib/libast.a -l$(KSH93SRC)/lib/libdll.a)
|
||||
|
||||
|
@ -115,5 +116,5 @@ ComplexProgramTarget($(PROGRAMS))
|
|||
|
||||
clean::
|
||||
cd ksh93; ./bin/package flat clean
|
||||
rm -f suid_exec
|
||||
rm -f init.c
|
||||
rm -rf FEATURE
|
||||
|
|
File diff suppressed because it is too large
Load diff
57
cde/programs/dtksh/init.patch
Normal file
57
cde/programs/dtksh/init.patch
Normal file
|
@ -0,0 +1,57 @@
|
|||
--- ./ksh93/src/cmd/ksh93/sh/init.c 2020-11-22 15:34:35.964537420 -0600
|
||||
+++ init.c 2020-12-31 19:31:00.091176802 -0600
|
||||
@@ -48,6 +48,38 @@
|
||||
#include "lexstates.h"
|
||||
#include "version.h"
|
||||
|
||||
+#ifdef BUILD_DTKSH
|
||||
+#include <Dt/DtNlUtils.h>
|
||||
+#include <Dt/EnvControlP.h>
|
||||
+#include <stdio.h>
|
||||
+#include <nl_types.h>
|
||||
+#include <X11/X.h>
|
||||
+#include <X11/Intrinsic.h>
|
||||
+#include <X11/IntrinsicP.h>
|
||||
+#include <X11/CoreP.h>
|
||||
+#include <X11/StringDefs.h>
|
||||
+#include <Xm/XmStrDefs.h>
|
||||
+#include <setjmp.h>
|
||||
+#include <string.h>
|
||||
+#include <ctype.h>
|
||||
+#include <Xm/Xm.h>
|
||||
+#include <Xm/Protocols.h>
|
||||
+#include "hash.h"
|
||||
+#include "stdio.h"
|
||||
+
|
||||
+#define NO_AST
|
||||
+#include "dtksh.h"
|
||||
+#undef NO_AST
|
||||
+#include "xmksh.h"
|
||||
+#include "dtkcmds.h"
|
||||
+#include "xmcvt.h"
|
||||
+#include "widget.h"
|
||||
+#include "extra.h"
|
||||
+#include "xmwidgets.h"
|
||||
+#include "msgs.h"
|
||||
+#include <locale.h>
|
||||
+#endif
|
||||
+
|
||||
#if _hdr_wctype
|
||||
#include <ast_wchar.h>
|
||||
#include <wctype.h>
|
||||
@@ -1469,6 +1501,16 @@
|
||||
#endif
|
||||
if(shp->userinit=userinit)
|
||||
(*userinit)(shp, 0);
|
||||
+#ifdef BUILD_DTKSH
|
||||
+ int * lockedFds = LockKshFileDescriptors();
|
||||
+ (void) XtSetLanguageProc((XtAppContext)NULL, (XtLanguageProc)NULL,
|
||||
+ (XtPointer)NULL);
|
||||
+ DtNlInitialize();
|
||||
+ _DtEnvControl(DT_ENV_SET);
|
||||
+ UnlockKshFileDescriptors(lockedFds);
|
||||
+
|
||||
+ dtksh_init();
|
||||
+#endif
|
||||
return(shp);
|
||||
}
|
Loading…
Reference in a new issue