?? install
字號:
To compile and optionally install the library, it is first necessaryto create a makefile for your system, by typing: ./configureThe Makefile that this generates is designed to install the files ofthe library in subdirectories of /usr/local/. If you would prefer toinstall them under a different directory, you can type: ./configure --prefix /whereverWhere you would replace /wherever with your chosen directory. Othercommand-line options are available, and can be listed by typing: ./configure --helpHaving run the configure script, you are then ready to make thelibrary. To do this, just type: makeWhat 'make' does depends on whether the configure script knows aboutyour system. If the configure script doesn't know anything specificabout your system, it will arrange for 'make' to produce the statictecla library, called libtecla.a, and if possible, the reentrantversion of this called libtecla_r.a. If it does know about yoursystem, it will also create shared libraries if possible. If you areon a system that isn't known, and you would like shared libraries tobe compiled, please read the file called PORTING to see how this canbe achieved.To install the library, its include file and it manual pages, type: make installNote that this will also compile the library if you haven't alreadydone so.Having compiled the library, if you wish, you can test it by runningthe demo programs. After building the library, you should find twoprograms, called demo and demo2, in the current directory.The first of the demos programs reads input lines from the user, andwrites what was typed back to the screen. While typing a line ofinput, you can experiment with line editing, tab completion, historyrecall etc.. For details about these line editing features, see theman page gl_get_line(3). If you haven't installed this yet, you cansee it anyway by typing: nroff -man man3/gl_get_line.3 | moreThe second demo program, called demo2, demonstrates command-completionwith the UNIX PATH. If you type in a partial command name, and pressTAB, the command name will be completed if possible, and possiblecompletions will be listed if it is ambiguous. When you then enter theline, the demo program then prints out the full pathname of thecommand that you typed. If you type anything after the command name,filename completion with the tab key reverts to its default behaviorof completing filenames in the current directory.COMPILING IN A DIFFERENT DIRECTORY----------------------------------If you unpack the distribution in a directory which is visible frommultiple hosts which have different architectures, you have the optionof compiling the library for the different architectures in differentdirectories. You might for example create a sub-directory for eacharchitecture, under the top level directory of the distribution. Youwould then log in to a host of one of these architectures, cd to thesub-directory that you created for it, and type: ../configureThe configure script then creates a makefile in the current directorywhich is designed to build the library, object files, demos etc forthe architecture of the current host, in the current directory, usingthe original source code in ../. You then repeat this procedure onhosts of other architectures.The compilation directories don't have to be sub-directories of thetop level directory of the distribution. That was just described as anexample. They can be anywhere you like.Every rule in the makefiles that are generated by the configurescript, cites the paths of the target and source files explicitly, sothis procedure should work on any system, without the need for vpathmakefile support.EMBEDDING IN OTHER PACKAGE DISTRIBUTIONS----------------------------------------If you distribute the library with another package, which has its ownheirarchy and configuration procedures, the following installationoptions may be of interest to you. At first glance, the use of a GNUconfigure script by the tecla library, may appear to reduce youroptions for controlling what gets made, and where it gets installed,but this isn't the case, because many of the parameters configured bythe configure script are assigned to make variables which can beoverriden when you run make.For example, lets say that you have your own configuration script inthe parent directory of the libtecla top-level directory. In yourconfiguration script, you would first need to have the following line: (cd libtecla; ./configure)Now, from your makefile or whatever script you use to build yourapplication, you would need to make the library. Assuming that yourmakefile or build script is in the parent directory of the libtecladistribution, the following line tells make to just make thenon-reentrant, static version of the tecla library, and to install itand the tecla include file in sub-directories called lib and includein your current directory. (cd libtecla; make LIBDIR=../lib INCDIR=../include TARGETS=normal TARGET_LIBS="static" install_lib install_inc)First, the LIBDIR=../lib means that on installing the library, itshould be placed in the directory libtecla/../lib. Similarly INCDIRtells make where to place the include files. The install_lib andinstall_inc targets tell make to install the libraries and the includefile. Because the install_man and install_bin targets have beenomitted in this example, the man pages and programs aren't installed.If you were to include these additional targets then you could use theMANDIR and BINDIR variables, respectively to control where they wereinstalled.The TARGETS variable is used to specify which of the normal andreentrant versions of the library are compiled. This can contain oneor both of the words "normal" and "reentrant". If you don't specifythis when you invoke make, the default value generated by theconfigure script will be used. Depending on whether reentrant POSIXfunctions are available for compilation of the reentrant version, thiswill be either "normal" or "normal reentrant".The TARGET_LIBS variable is used to specify which of the static andshared libraries are to be built. This can contain one or both of thewords "static" and "shared". If you don't specify this when you invokemake, the default value generated by the configure script will beused. Depending on whether the configure script knows how to createshared libraries on the target system, this will be either "static" or"static shared". Beware that shared libraries aren't supported on manysystems, so requiring "shared" will limit which systems you cancompile your package on. Also note that unless your package installsthe tecla library in a directory which all users of your program willhave access to, you should only compile the static version.Instructions for adding shared-library creation rules for new systemsare included in the PORTING file.The OPT variable can be used to change the default optimization fromthe default of "-O" to something else.The DEMOS variable controls whether the demo programs are built.Normally this has the value "demos", which tells the makefile to buildthe demo programs. Setting it to an empty string stops the demos frombeing built.The PROGRAMS variable is used to specify which programs are to bebuilt and subsequently installed. All available programs are built bydefault. Currently there is only one such program, selected byspecifying the word "enhance". This program uses tecla-enhancedpseudo-terminals to layer command line editing on top of third partyprograms.The PROGRAMS_R variable serves the same purpose as the PROGRAMSvariable, except that programs listed here are linked with thereentrant version of the library, and should be specified with a _rsuffix. Currently this variable is empty by default.Martin Shepherd (mcs@astro.caltech.edu)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -