README revision 157184
1227825StheravenIntroduction 2227825Stheraven============ 3227825Stheraven 4227825StheravenThis is the Gnu Readline library, version 5.1. 5227825Stheraven 6227825StheravenThe Readline library provides a set of functions for use by applications 7227825Stheraventhat allow users to edit command lines as they are typed in. Both 8227825StheravenEmacs and vi editing modes are available. The Readline library includes 9227825Stheravenadditional functions to maintain a list of previously-entered command 10227825Stheravenlines, to recall and perhaps reedit those lines, and perform csh-like 11227825Stheravenhistory expansion on previous commands. 12227825Stheraven 13227825StheravenThe history facilites are also placed into a separate library, the 14227825StheravenHistory library, as part of the build process. The History library 15227825Stheravenmay be used without Readline in applications which desire its 16227825Stheravencapabilities. 17227825Stheraven 18227825StheravenThe Readline library is free software, distributed under the terms of 19227825Stheraventhe [GNU] General Public License, version 2. For more information, see 20227825Stheraventhe file COPYING. 21227825Stheraven 22227825StheravenTo build the library, try typing `./configure', then `make'. The 23227825Stheravenconfiguration process is automated, so no further intervention should 24227825Stheravenbe necessary. Readline builds with `gcc' by default if it is 25227825Stheravenavailable. If you want to use `cc' instead, type 26227825Stheraven 27227825Stheraven CC=cc ./configure 28227825Stheraven 29227825Stheravenif you are using a Bourne-style shell. If you are not, the following 30227825Stheravenmay work: 31227825Stheraven 32227825Stheraven env CC=cc ./configure 33227825Stheraven 34227825StheravenRead the file INSTALL in this directory for more information about how 35227825Stheravento customize and control the build process. 36227825Stheraven 37227825StheravenThe file rlconf.h contains C preprocessor defines that enable and disable 38227825Stheravencertain Readline features. 39227825Stheraven 40227825StheravenThe special make target `everything' will build the static and shared 41227825Stheravenlibraries (if the target platform supports them) and the examples. 42227825Stheraven 43227825StheravenExamples 44227825Stheraven======== 45227825Stheraven 46227825StheravenThere are several example programs that use Readline features in the 47227825Stheravenexamples directory. The `rl' program is of particular interest. It 48227825Stheravenis a command-line interface to Readline, suitable for use in shell 49227825Stheravenscripts in place of `read'. 50227825Stheraven 51227825StheravenShared Libraries 52227825Stheraven================ 53227825Stheraven 54227825StheravenThere is skeletal support for building shared versions of the 55227825StheravenReadline and History libraries. The configure script creates 56227825Stheravena Makefile in the `shlib' subdirectory, and typing `make shared' 57227825Stheravenwill cause shared versions of the Readline and History libraries 58227825Stheravento be built on supported platforms. 59227825Stheraven 60227825StheravenIf `configure' is given the `--enable-shared' option, it will attempt 61227825Stheravento build the shared libraries by default on supported platforms. 62227825Stheraven 63227825StheravenConfigure calls the script support/shobj-conf to test whether or 64227825Stheravennot shared library creation is supported and to generate the values 65227825Stheravenof variables that are substituted into shlib/Makefile. If you 66227825Stheraventry to build shared libraries on an unsupported platform, `make' 67227825Stheravenwill display a message asking you to update support/shobj-conf for 68227825Stheravenyour platform. 69227825Stheraven 70227825StheravenIf you need to update support/shobj-conf, you will need to create 71227825Stheravena `stanza' for your operating system and compiler. The script uses 72227825Stheraventhe value of host_os and ${CC} as determined by configure. For 73227825Stheraveninstance, FreeBSD 4.2 with any version of gcc is identified as 74227825Stheraven`freebsd4.2-gcc*'. 75227825Stheraven 76227825StheravenIn the stanza for your operating system-compiler pair, you will need to 77227825Stheravendefine several variables. They are: 78227825Stheraven 79227825StheravenSHOBJ_CC The C compiler used to compile source files into shareable 80227825Stheraven object files. This is normally set to the value of ${CC} 81227825Stheraven by configure, and should not need to be changed. 82227825Stheraven 83227825StheravenSHOBJ_CFLAGS Flags to pass to the C compiler ($SHOBJ_CC) to create 84227825Stheraven position-independent code. If you are using gcc, this 85227825Stheraven should probably be set to `-fpic'. 86227825Stheraven 87227825StheravenSHOBJ_LD The link editor to be used to create the shared library from 88227825Stheraven the object files created by $SHOBJ_CC. If you are using 89227825Stheraven gcc, a value of `gcc' will probably work. 90227825Stheraven 91227825StheravenSHOBJ_LDFLAGS Flags to pass to SHOBJ_LD to enable shared object creation. 92227825Stheraven If you are using gcc, `-shared' may be all that is necessary. 93227825Stheraven These should be the flags needed for generic shared object 94227825Stheraven creation. 95227825Stheraven 96227825StheravenSHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library 97227825Stheraven creation. Many systems use the -R option to the link 98227825Stheraven editor to embed a path within the library for run-time 99227825Stheraven library searches. A reasonable value for such systems would 100227825Stheraven be `-R$(libdir)'. 101227825Stheraven 102227825StheravenSHLIB_LIBS Any additional libraries that shared libraries should be 103227825Stheraven linked against when they are created. 104227825Stheraven 105227825StheravenSHLIB_LIBPREF The prefix to use when generating the filename of the shared 106227825Stheraven library. The default is `lib'; Cygwin uses `cyg'. 107227825Stheraven 108227825StheravenSHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when 109227825Stheraven generating the filename of the shared library. Many systems 110227825Stheraven use `so'; HP-UX uses `sl'. 111227825Stheraven 112227825StheravenSHLIB_LIBVERSION The string to append to the filename to indicate the version 113227825Stheraven of the shared library. It should begin with $(SHLIB_LIBSUFF), 114227825Stheraven and possibly include version information that allows the 115227825Stheraven run-time loader to load the version of the shared library 116227825Stheraven appropriate for a particular program. Systems using shared 117227825Stheraven libraries similar to SunOS 4.x use major and minor library 118227825Stheraven version numbers; for those systems a value of 119227825Stheraven `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate. 120227825Stheraven Systems based on System V Release 4 don't use minor version 121227825Stheraven numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems. 122262801Sdim Other Unix versions use different schemes. 123227825Stheraven 124227825StheravenSHLIB_DLLVERSION The version number for shared libraries that determines API 125227825Stheraven compatibility between readline versions and the underlying 126227825Stheraven system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but 127227825Stheraven can be overridden at configuration time by defining DLLVERSION 128227825Stheraven in the environment. 129227825Stheraven 130227825StheravenSHLIB_DOT The character used to separate the name of the shared library 131227825Stheraven from the suffix and version information. The default is `.'; 132227825Stheraven systems like Cygwin which don't separate version information 133227825Stheraven from the library name should set this to the empty string. 134227825Stheraven 135227825StheravenSHLIB_STATUS Set this to `supported' when you have defined the other 136227825Stheraven necessary variables. Make uses this to determine whether 137227825Stheraven or not shared library creation should be attempted. 138227825Stheraven 139227825StheravenYou should look at the existing stanzas in support/shobj-conf for ideas. 140227825Stheraven 141227825StheravenOnce you have updated support/shobj-conf, re-run configure and type 142227825Stheraven`make shared'. The shared libraries will be created in the shlib 143227825Stheravensubdirectory. 144227825Stheraven 145227825StheravenIf shared libraries are created, `make install' will install them. 146227825StheravenYou may install only the shared libraries by running `make 147227825Stheraveninstall-shared' from the top-level build directory. Running `make 148227825Stheraveninstall' in the shlib subdirectory will also work. If you don't want 149227825Stheravento install any created shared libraries, run `make install-static'. 150227825Stheraven 151227825StheravenDocumentation 152227825Stheraven============= 153227825Stheraven 154227825StheravenThe documentation for the Readline and History libraries appears in 155227825Stheraventhe `doc' subdirectory. There are three texinfo files and a 156227825StheravenUnix-style manual page describing the facilities available in the 157227825StheravenReadline library. The texinfo files include both user and 158227825Stheravenprogrammer's manuals. HTML versions of the manuals appear in the 159227825Stheraven`doc' subdirectory as well. 160227825Stheraven 161227825StheravenReporting Bugs 162227825Stheraven============== 163227825Stheraven 164227825StheravenBug reports for Readline should be sent to: 165227825Stheraven 166227825Stheraven bug-readline@gnu.org 167227825Stheraven 168227825StheravenWhen reporting a bug, please include the following information: 169227825Stheraven 170227825Stheraven * the version number and release status of Readline (e.g., 4.2-release) 171227825Stheraven * the machine and OS that it is running on 172227825Stheraven * a list of the compilation flags or the contents of `config.h', if 173227825Stheraven appropriate 174227825Stheraven * a description of the bug 175227825Stheraven * a recipe for recreating the bug reliably 176227825Stheraven * a fix for the bug if you have one! 177227825Stheraven 178227825StheravenIf you would like to contact the Readline maintainer directly, send mail 179227825Stheravento bash-maintainers@gnu.org. 180227825Stheraven 181227825StheravenSince Readline is developed along with bash, the bug-bash@gnu.org mailing 182227825Stheravenlist (mirrored to the Usenet newsgroup gnu.bash.bug) often contains 183227825StheravenReadline bug reports and fixes. 184227825Stheraven 185227825StheravenChet Ramey 186227825Stheravenchet@po.cwru.edu 187227825Stheraven