06508a5 by fbp at 2000-12-08 1
**********************************************************************
2ef6b12 by dums at 2008-06-22 2
* 	INSTALL file for STLport                                         *
06508a5 by fbp at 2000-12-08 3
*                                                                    *
4
**********************************************************************
5
d26635e by complement at 2005-11-01 6
STLport is a full ANSI C++ Standard library.
06508a5 by fbp at 2000-12-08 7
7e27662 by fbp at 2001-05-11 8
This distribution contains STLport sources only, no binaries.
43156eb by ptr at 2005-04-18 9
To use STLport iostreams, locale and complex numbers, you have to build STLport
10
library from sources in "build/lib" directory and link your programs with it.
06508a5 by fbp at 2000-12-08 11
d26635e by complement at 2005-11-01 12
Starting with 5.0 the 'wrapper' mode is not supported anymore. You cannot use native
13
compiler iostreams implementation with STLport STL (see doc/FAQ for explanations).
14
Now you have to choose between STLport iostreams or no iostreams.
06508a5 by fbp at 2000-12-08 15
16
==== Unpacking and installing STLport ==========
17
18
1) Unpack STLport archive to a directory accessible during compilation.
43156eb by ptr at 2005-04-18 19
   NOTE: DO NOT overwrite header files coming with the compiler, even if you made
20
   a backup - this won't work! Most probably, you've already unpacked the archive before
06508a5 by fbp at 2000-12-08 21
   reading this file though ;)
22
23
2) Make sure "stlport" directory of this distribution comes before compiler's one 
d26635e by complement at 2005-11-01 24
   in your include paths when you compile the project.
06508a5 by fbp at 2000-12-08 25
7e27662 by fbp at 2001-05-11 26
   Note: for SunPro CC 5.0 and higher, there used to be special directory "stlport/SC5"
27
	 this is now obsolete, please make sure you do not use it anymore.
06508a5 by fbp at 2000-12-08 28
29
3) Make sure you do not rename this "stlport" subdirectory -
30
   that may result in compilation errors.
31
d26635e by complement at 2005-11-01 32
   NOTE:  Your compiler should be recognized by STLport source code with no configuring.
33
          Please edit appropriate configuration header for your compiler
34
          directly if you have to make compiler-specific configuration changes
46fba53 by dums at 2008-06-18 35
          (see stlport/stl/config). 
06508a5 by fbp at 2000-12-08 36
ecd8762 by dums at 2008-07-02 37
4)  Run:
9496a4d by fbp at 2001-05-16 38
2ef6b12 by dums at 2008-06-22 39
    configure --help
40
41
    Depending on your environment, Windows command shell or Unix like shell,
42
    configure.bat or configure script will be run respectively. For Windows users
43
    running configure script is mandatory in order to declare the compiler you are
44
    going to use.
45
46
5)  Go to "build/lib" subdirectory. It contains various makefiles for different
43156eb by ptr at 2005-04-18 47
    compilers and 'make' utilities (GNU Make and Microsoft's nmake supported).
9496a4d by fbp at 2001-05-16 48
49
    Verify you can do command line compiles. IDE users may have to do something 
50
    special, like add environment variables (for Microsoft) or install 
51
    additional compiler components (for Metrowerks), before they can use their 
46fba53 by dums at 2008-06-18 52
    command line compilers (see doc/README.xxxx for additionnal information).
9496a4d by fbp at 2001-05-16 53
2ef6b12 by dums at 2008-06-22 54
    configure script should have already created a Makefile file so that you only
55
    have to call 'make' or 'nmake' (for some platforms GNU make might be hidden
56
    behind 'gmake').
57
d26635e by complement at 2005-11-01 58
    IMPORTANT:
9496a4d by fbp at 2001-05-16 59
d26635e by complement at 2005-11-01 60
    If you DO NOT plan to use STLport iostreams and/or locale implementation but just
61
    the STL, you do not have to build the library.
9496a4d by fbp at 2001-05-16 62
 
8328278 by dums at 2006-11-04 63
    If you have decided to disable STLport iostreams and locale using _STLP_NO_IOSTREAMS
64
    configuration macro in stlport/stl/config/user_config.h, you may stop reading here.
06508a5 by fbp at 2000-12-08 65
66
6e1115a by fbp at 2001-09-06 67
==== Building STLport iostreams library ==========
06508a5 by fbp at 2000-12-08 68
43156eb by ptr at 2005-04-18 69
Below are step-by-step instructions to build STLport streams library. This is a general
d26635e by complement at 2005-11-01 70
build process description, for a more detailed one check README files in the doc folder:
06508a5 by fbp at 2000-12-08 71
ecd8762 by dums at 2008-07-02 72
5)  Using appropriate make command (make or nmake), do
06508a5 by fbp at 2000-12-08 73
2ef6b12 by dums at 2008-06-22 74
      make clean install
43156eb by ptr at 2005-04-18 75
2ef6b12 by dums at 2008-06-22 76
    to build the STLport libraries. Make files are set up to build several different
43156eb by ptr at 2005-04-18 77
    flavors - debug/nondebug, static/dynamic versions. But not all flavors will be build
2ef6b12 by dums at 2008-06-22 78
    by default. See build/lib/README for other make targets.
43156eb by ptr at 2005-04-18 79
f8c8307 by dums at 2006-01-30 80
    Note: 'install' target work slightly different than usual - it installs libraries into
2ef6b12 by dums at 2008-06-22 81
    <STLport root dir>/lib and bin catalogs, NOT IN SYSTEM CATALOG. You can do the system
d26635e by complement at 2005-11-01 82
    install by just copying stlport and lib folder to the destination of your choise. For
83
    example on UNIX-like platforms this can be done with the following commands:
43156eb by ptr at 2005-04-18 84
85
      su
86
      tar cf - stlport | (cd /usr/local/include; tar xf -)
87
      chmod -R a+r /usr/local/include/stlport
88
      chown -R root:root /usr/local/include/stlport
89
      (cd lib; tar cf - --exclude=CVS --exclude=.cvsignore .) | (cd /usr/local/lib; tar xf -)
90
      chown -R root:root /usr/local/lib/libstlport*
91
      exit
06508a5 by fbp at 2000-12-08 92
f8c8307 by dums at 2006-01-30 93
    Note: System install is optional, most of compilers/linkers support searching for includes
94
    and libs throught out the whole filesystem, just check your documentation on how to achieve
d26635e by complement at 2005-11-01 95
    this.
43156eb by ptr at 2005-04-18 96
f8c8307 by dums at 2006-01-30 97
    If you use cross-compiler, you can find libraries in the <STLport root dir>/lib/<target platform>
43156eb by ptr at 2005-04-18 98
    catalog.
06508a5 by fbp at 2000-12-08 99
100
6)  If build fails, you may choose to :
f8c8307 by dums at 2006-01-30 101
     - try fixing the build ;)
06508a5 by fbp at 2000-12-08 102
     - wait until somebody else will submit corresponding changes to be incorporated in next STLport 
d26635e by complement at 2005-11-01 103
       release/snapshot.
06508a5 by fbp at 2000-12-08 104
bfe25e9 by complement at 2005-11-01 105
    In case you do patch STLport, please submit your patches to
106
    https://sourceforge.net/tracker/?atid=766246&group_id=146814&func=browse
06508a5 by fbp at 2000-12-08 107
108
==== Linking your application with STLport library ==========
109
43156eb by ptr at 2005-04-18 110
7) Check the build:
111
d26635e by complement at 2005-11-01 112
    Example:
113
    
114
    - under Linux and other Unixes:
115
43156eb by ptr at 2005-04-18 116
    cd build/test/unit
2ef6b12 by dums at 2008-06-22 117
    make install
d26635e by complement at 2005-11-01 118
    ../../../bin/stl_unit_test
119
    ../../../bin-g/stl_unit_test
120
121
    - under Windows:
122
123
    cd build\test\unit
2ef6b12 by dums at 2008-06-22 124
    nmake install
d26635e by complement at 2005-11-01 125
    cd ..\..\..\bin
2ef6b12 by dums at 2008-06-22 126
    stl_unit_test
127
    stl_unit_testd
128
    stl_unit_teststld
43156eb by ptr at 2005-04-18 129
06508a5 by fbp at 2000-12-08 130
8) Supply the "lib" subdirectory to the library search path and add desired 
131
   library to the list of libraries to link with.
132
   Examples (imagine you have mytest.cpp in the same directory as this file is):
f8c8307 by dums at 2006-01-30 133
	With GCC     : g++ -pthread -I./stlport mytest.cpp -L./lib/ -lstlport
d26635e by complement at 2005-11-01 134
	With DEC CC  : cxx -I./stlport mytest.cpp -L./lib/ -lstlport
135
	With SUN CC  : CC -mt -I./stlport mytest.cpp -L./lib/ -lstlport
06508a5 by fbp at 2000-12-08 136
	.....
2ef6b12 by dums at 2008-06-22 137
   For several compilers supporting auto linking feature (VC++, Borland, DMC),
138
   you do not have to specify "stlport.M.m.lib" explicitly, as it is being choosen
139
   and forced to link automatically by "#pragma"'s in compiler config files 
140
   Appropriate version is being selected based on compiler options and _STLP_DEBUG
141
   setting. All you have to do is to set library search path for the linker.
142
06508a5 by fbp at 2000-12-08 143
	Example :
144
           cl.exe /I.\stlport mytest.cpp /link /libpath:.\lib /MD
145
f8c8307 by dums at 2006-01-30 146
9) If you linked your application with shared STLport library (.so or .dll), please 
ecd8762 by dums at 2008-07-02 147
   make suze that your .so or .dll can be found by the dynamic linker. 
f8c8307 by dums at 2006-01-30 148
   Under Windows, the paths searched depend on the particular flavor, see the MSDN 
ecd8762 by dums at 2008-07-02 149
   documentation for LoadLibrary at http://msdn.microsoft.com. The easiest ways are to
f8c8307 by dums at 2006-01-30 150
   either modify the PATH environment variable or copy all .dll's next to the 
ecd8762 by dums at 2008-07-02 151
   executable like it is done per default when unit tests executable are put next
152
   to dlls. 
f8c8307 by dums at 2006-01-30 153
   Under Linux, the environment variable LD_LIBRARY_PATH can be adjusted to point
2ef6b12 by dums at 2008-06-22 154
   to the dir containing .so. See the manpage for ld.so for more info.
f8c8307 by dums at 2006-01-30 155
156
10) STLport builds only multithreaded libraries, so your application should be compiled
157
   as multithreaded, too. Use -pthread (or -pthreads on Solaris) option for GCC, -mt for SunPro,
d26635e by complement at 2005-11-01 158
   /MT for VC, and so on. Sometimes you should define _REENTRANT or something else, depends
159
   upon platform/compiler. See compiler's and linker's options on command line when you build
2ef6b12 by dums at 2008-06-22 160
   unit tests (build/test/unit) for reference. The last is useful for ANY platform.
d26635e by complement at 2005-11-01 161
162
11) Don't hesitate to read READMEs (doc/README*, build/lib/README*, build/test/unit/README*)
163
   and doc/FAQ.
164
165
12) Have fun!
06508a5 by fbp at 2000-12-08 166