📄 linstall
字号:
$ECHO " 1. regcmp" $ECHO " 2. re_comp" $ECHO " 3. neither [$def] \c" read ans case "X$ans" in X1) REGCMP=1;RECOMP=0 ;; X2) REGCMP=0;RECOMP=1 ;; X3) REGCMP=0;RECOMP=0 ;; esac $ECHO ""ficat >>defines.h <<EOF/* * REGCMP is 1 if your system has the regcmp() function. * This is normally the case for System 5. * RECOMP is 1 if your system has the re_comp() function. * This is normally the case for BSD. * If neither is 1, pattern matching is supported, but without metacharacters. */#define REGCMP $REGCMP#define RECOMP $RECOMPEOFdef=yesx=1if [ $alloptional = 0 ]then $ECHO "Do you wish to allow shell escapes? [$def] \c" read ans case "X$ans" in X[yY]*) x=1 ;; X[nN]*) x=0 ;; esac $ECHO ""ficat >>defines.h <<EOF/* * SHELL_ESCAPE is 1 if you wish to allow shell escapes. * (This is possible only if your system supplies the system() function.) */#define SHELL_ESCAPE $xEOFdef=yesx=1edname="vi"if [ $alloptional = 0 ]then $ECHO "Do you wish to allow editor escapes? [$def] \c" read ans case "X$ans" in X[nN]*) x=0; edname="" ;; X[yY]*) x=1 $ECHO "What is the pathname of the default editor? [$edname] \c" read ans if [ "x$ans" != "x" ] then edname=$ans fi ;; esac $ECHO ""ficat >>defines.h <<EOF/* * EDITOR is 1 if you wish to allow editor invocation (the "v" command). * (This is possible only if your system supplies the system() function.) * EDIT_PGM is the name of the (default) editor to be invoked. */#define EDITOR $x#define EDIT_PGM "$edname"EOFdef=yesx=1if [ $alloptional = 0 ]then $ECHO "Do you wish to support \"tag\" files? [$def] \c" read ans case "X$ans" in X[yY]*) x=1 ;; X[nN]*) x=0 ;; esac $ECHO ""ficat >>defines.h <<EOF/* * TAGS is 1 if you wish to support tag files. */#define TAGS $xEOFdef=yesx=1if [ $alloptional = 0 ]then $ECHO "Do you wish to allow user-defined key definitions? [$def] \c" read ans case "X$ans" in X[yY]*) x=1 ;; X[nN]*) x=0 ;; esac $ECHO ""fiUSERFILE=$xcat >>defines.h <<EOF/* * USERFILE is 1 if you wish to allow a .less file to specify * user-defined key bindings. */#define USERFILE $xEOFdef=yesx=1if [ $alldefault = 0 ]then $ECHO "If your system provides the popen() function and" $ECHO "the \"echo\" shell command, you may allow shell metacharacters" $ECHO "to be expanded in filenames." $ECHO "Do you wish to allow shell metacharacters in filenames? [$def] \c" read ans case "X$ans" in X[yY]*) x=1 ;; X[nN]*) x=0 ;; esac $ECHO ""ficat >>defines.h <<EOF/* * GLOB is 1 if you wish to have shell metacharacters expanded in filenames. * This will generally work if your system provides the "popen" function * and the "echo" shell command. */#define GLOB $x/* * PIPEC is 1 if you wish to have the "|" command * which allows the user to pipe data into a shell command. */#define PIPEC $xEOFdef=yesx=1if [ $alloptional = 0 ]then $ECHO "Do you wish to allow log files (-l option)? [$def] \c" read ans case "X$ans" in X[yY]*) x=1 ;; X[nN]*) x=0 ;; esac $ECHO ""ficat >>defines.h <<EOF/* * LOGFILE is 1 if you wish to allow the -l option (to create log files). */#define LOGFILE $xEOFcat >>defines.h <<EOF/* * ONLY_RETURN is 1 if you want RETURN to be the only input which * will continue past an error message. * Otherwise, any key will continue past an error message. */#define ONLY_RETURN 0EOFcat >>makefile <<EOF########################################################################### Compilation environment.##########################################################################EOFif [ "$xenix" = "1" ]then LIBS="-ltermlib"elif [ "$sys" = "bsd" ]then LIBS="-ltermcap"else LIBS="-lcurses -ltermcap -lPW"fiif [ $alldefault = 0 ]then $ECHO "To build \"less\", you must link with libraries supplied by your system." $ECHO "(If this needs to be changed later, edit the makefile" $ECHO "and change the definition of LIBS.)" $ECHO "What libraries should be used [$LIBS] \c" read ans if [ "X$ans" != "X" ] then LIBS="$ans" fi $ECHO ""ficat >>makefile <<EOF# LIBS is the list of libraries needed.LIBS = $LIBSEOFINSTALL_LESS="/usr/local/bin/less"INSTALL_KEY="/usr/local/bin/lesskey"INSTALL_HELP="/usr/local/bin/less.hlp"INSTALL_LESSMAN="/usr/man/man1/less.1"INSTALL_KEYMAN="/usr/man/man1/lesskey.1"LESS_MANUAL="less.nro"KEY_MANUAL="lesskey.nro"if [ $alldefault = 0 ]then $ECHO "What is the name of the \"public\" (installed) version of less?" $ECHO " [$INSTALL_LESS] \c" read ans if [ "X$ans" != "X" ] then INSTALL_LESS="$ans" fi $ECHO "What is the name of the \"public\" (installed) version of lesskey?" $ECHO " [$INSTALL_KEY] \c" read ans if [ "X$ans" != "X" ] then INSTALL_KEY="$ans" fi $ECHO "What is the name of the \"public\" (installed) version of the help file?" $ECHO " [$INSTALL_HELP] \c" read ans if [ "X$ans" != "X" ] then INSTALL_HELP="$ans" fi $ECHO "What is the name of the \"public\" (installed) version of the less manual page?" $ECHO " [$INSTALL_LESSMAN] \c" read ans if [ "X$ans" != "X" ] then INSTALL_LESSMAN="$ans" fi $ECHO "What is the name of the \"public\" (installed) version of the lesskey manual page?" $ECHO " [$INSTALL_KEYMAN] \c" read ans if [ "X$ans" != "X" ] then INSTALL_KEYMAN="$ans" fi $ECHO ""ficat >>defines.h <<EOF/* * HELPFILE is the full pathname of the help file. */#define HELPFILE "$INSTALL_HELP"EOFcat >>makefile <<EOF# INSTALL_LESS is a list of the public versions of less.# INSTALL_KEY is a list of the public versions of lesskey.# INSTALL_HELP is a list of the public version of the help file.# INSTALL_LESSMAN is a list of the public versions of the less manual page.# INSTALL_KEYMAN is a list of the public versions of the lesskey manual page.INSTALL_LESS = \$(ROOT)$INSTALL_LESSINSTALL_KEY = \$(ROOT)$INSTALL_KEYINSTALL_HELP = \$(ROOT)$INSTALL_HELPINSTALL_LESSMAN = \$(ROOT)$INSTALL_LESSMANINSTALL_KEYMAN = \$(ROOT)$INSTALL_KEYMANLESS_MANUAL = $LESS_MANUALKEY_MANUAL = $KEY_MANUALHELPFILE = $INSTALL_HELPEOFcat >>makefile <<"EOF"# OPTIM is passed to the compiler and the loader.# It is normally "-O" but may be, for example, "-g".OPTIM = -OCFLAGS = $(OPTIM)########################################################################### Files##########################################################################SRC1 = ch.c cmdbuf.c command.c decode.c help.c input.c SRC2 = line.c linenum.c main.c edit.c option.c optfunc.c \ opttbl.c os.c SRC3 = charset.c filename.c lsystem.c output.c position.c ifile.c \ brac.c forwback.c jump.c search.c SRC4 = mark.c prompt.c screen.c signal.c tags.c ttyin.c version.cSRC = $(SRC1) $(SRC2) $(SRC3) $(SRC4)OBJ = brac.o ch.o charset.o cmdbuf.o command.o decode.o edit.o filename.o \ forwback.o help.o input.o jump.o line.o linenum.o \ lsystem.o main.o option.o optfunc.o opttbl.o os.o \ output.o position.o mark.o ifile.o prompt.o screen.o \ search.o signal.o tags.o ttyin.o version.o########################################################################### Rules for building stuff##########################################################################EOFif [ "$USERFILE" = "1" ]then cat >>makefile <<"EOF"all: less lesskeyinstall: install_less install_help install_key install_lman install_kmanEOFelse cat >>makefile <<"EOF"all: lessinstall: install_less install_help install_lmanEOFficat >>makefile <<"EOF"less: $(OBJ) $(CC) $(LDFLAGS) $(OPTIM) -o less $(OBJ) $(LIBS) $(LDLIBS)lesskey: lesskey.o $(CC) $(LDFLAGS) $(OPTIM) -o lesskey lesskey.o $(LDLIBS)install_less: less for f in $(INSTALL_LESS); do rm -f $$f; cp less $$f; done touch install_lessinstall_key: lesskey for f in $(INSTALL_KEY); do rm -f $$f; cp lesskey $$f; done touch install_keyinstall_help: less.hlp for f in $(INSTALL_HELP); do rm -f $$f; cp less.hlp $$f; done touch install_helpinstall_lman: $(LESS_MANUAL) for f in $(INSTALL_LESSMAN); do rm -f $$f; cp $(LESS_MANUAL) $$f; done touch install_lmaninstall_kman: $(KEY_MANUAL) for f in $(INSTALL_KEYMAN); do rm -f $$f; cp $(KEY_MANUAL) $$f; done touch install_kman########################################################################### Maintenance##########################################################################lint: lint -hp $(SRC)newfuncs funcs.h: if [ -f funcs.h ]; then mv funcs.h funcs.h.OLD; fi awk -f mkfuncs.awk $(SRC) >funcs.hclean: rm -f $(OBJ) lesskey.o less lesskey vechoclobber: rm -f *.o less lesskey vecho install_less install_key \ install_help install_lman install_kmanshar: shar -v README CHANGES linstall \ less.nro lesskey.nro \ vecho.c mkfuncs.awk > less1.shr shar -v less.man lesskey.man \ less.h position.h cmd.h option.h > less2.shr shar -v lesskey.c $(SRC1) > less3.shr shar -v $(SRC2) > less4.shr shar -v $(SRC3) less.hlp > less5.shr shar -v $(SRC4) funcs.h > less6.shr########################################################################### Dependencies##########################################################################$(OBJ): less.h funcs.h defines.h position.hcommand.o decode.o: cmd.hoption.o opttbl.o optfunc.o: option.hlesskey.o: less.h funcs.h defines.h cmd.hEOF$ECHO ""$ECHO "The makefile and defines.h have been built."$ECHO "You should check them to make sure everything is as you want it to be."$ECHO "When you are satisfied, just type \"make\", and \"less\" will be built."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -