-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
2023 lines (1512 loc) · 82.1 KB
/
Copy pathREADME
File metadata and controls
2023 lines (1512 loc) · 82.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
$Id$
Apache C++ Standard Library (STDCXX) 5.0.0
------------------------------------------
0 Index
--------
Index ............................................................ 0
Contents ......................................................... 1
Compatibility ................................................ 1.1
Requirements ..................................................... 2
Unpacking Instructions ........................................... 3
Source Directory Structure ....................................... 4
Library Files ................................................ 4.1
Library Utilities ............................................ 4.2
Locales ...................................................... 4.3
Test Suite Files ............................................. 4.4
Examples and Tutorials ....................................... 4.5
Build Directory Structure .................................... 4.6
VisualStudio Build Directory Structure ................... 4.6.1
Library Build Instructions ....................................... 5
VisualStudio Setup Instructions .............................. 5.1
Library Installation ............................................. 6
Library Installation on UNIX Systems ......................... 6.1
Library Installation on Microsoft Windows .................... 6.2
Test Suite Build Instructions .................................... 7
VisualStudio Test Suite Build Instructions ................... 7.1
Library Configuration ............................................ 8
Header config.h (and config.log) ............................. 8.1
Headers rw/_config.h and rw/_defs.h .......................... 8.2
Configuration Macros ......................................... 8.3
Platform Identification Macros ........................... 8.3.1
Compiler Configuration Macros ............................ 8.3.2
Runtime Library Configuration Macros ..................... 8.3.3
C Library Configuration Macros ........................... 8.3.4
Macros Controlling Strings ............................... 8.3.5
Macros Controlling Iostreams ............................. 8.3.6
Macros Controlling Locale ................................ 8.3.7
Macros Controlling Implementation Properties ............. 8.3.8
Other Configuration Macros ............................... 8.3.9
Macros Controlling Extensions ........................... 8.3.10
Library Organization ............................................. 9
Organization of Headers ...................................... 9.1
Organization of Sources ...................................... 9.2
Platform Notes .................................................. 10
Apogee C++ .................................................. 10.1
Borland C++ ................................................. 10.2
Comeau C++ .................................................. 10.3
Compaq/HP C++ ............................................... 10.4
EDG eccp .................................................... 10.5
GNU gcc ..................................................... 10.6
HP aCC ...................................................... 10.7
IBM VisualAge C++ ........................................... 10.8
Intel C++ ................................................... 10.9
KAI C++ .................................................... 10.10
Metrowerks CodeWarrior ..................................... 10.11
Microsoft Visual Studio .................................... 10.12
SGI MIPSpro ................................................ 10.13
Siemens CDS++ .............................................. 10.14
Sun C++ .................................................... 10.15
1 Contents
-----------
This file is part of version 5.0.0 of the Apache C++ Standard
Library (STDCXX), an Open Source implementation of the C++ Standard
Library conforming to INCITS/ISO/IEC 14882-2003 Programming
Languages -- C++.
The distribution consists of this file and a compressed (gzipped)
tar file containing the header and source files comprising the
Apache implementation of the C++ Standard Library, the configuration
infrastructure required to characterize the platform on which the
library is to be built, and a set of scripts and makefiles to build
the library. In addition, a license (LICENSE.txt) and a notice
(NOTICE.txt) files are provided. Read LICENSE.txt to understand the
licensing requirements of the Apache C++ Standard Library. The
NOTICE.txt file contains a list of copyrights that apply to the
same.
In addition, the distribution also contains the Apache C++ Standard
Library test suite, a set of example programs demonstrating the use
of the library, plus scripts and makefiles to build and run the test
suite and the examples and report their results.
The primary audience targeted by this document is library
maintainers, developers, and those porting the library to new
platforms. The purpose of the document is to describe in detail the
process of unpacking, configuring, building, and testing the
library.
1.1 Compatibility
------------------
[TO DO: Explain the compatibility of this version with prior ones.]
2 Requirements
---------------
The following utilities are required in addition to the standard set
of POSIX utilities in order to unpack and build the library, test
suite (*), and examples (*) on a UNIX system.
* Where available.
o GNU gunzip
o GNU make, version 3.70 or later (referred to as gmake here)
o C++ compiler and linker
3 Unpacking Instructions
-------------------------
The distribution consists entirely of a single file named either
stdcxx-X.Y.Z.tar.gz for a final release, or
stdcxx-X.Y.Z-YYYYMMDD.tar.gz for snapshots.
To unpack the tarball, execute the following command:
$ gunzip -c stdcxx-X.Y.Z.tar.gz | tar -xf -
Above, X, Y, and Z are the major, minor, and micro version number of
the library, respectively, and the optional -YYYYMMDD part is the
date of the snapshot. The date part of the file name will be missing
if the tarball is a final release rather than a snapshot.
The script above will expand the tarball and create a single
directory named stdcxx-X.Y.Z (or stdcxx-X.Y.Z-YYYYMMDD/ for a
snapshot). This directory is referred to a ${TOPDIR} throughout the
rest of this document.
4 Source Directory Structure
-----------------------------
The infrastructure described in this document expects that source
files and any support scripts are organized in a directory tree
described below. If the files are arranged otherwise you will need
to move them to the expected directories in order to accommodate
this requirement and use the infrastructure.
${TOPDIR}/bin/ executable scripts
| doc/index.html documentation index
| generate.bat (obsolete)
| configure.bat Windows configuration script
| ChangeLog log of changes
| GNUmakefile master makefile
| LICENSE.txt license file
| NOTICE.txt copyright notices
| README this file
|
+- etc/
| +- config/GNUmakefile.* makefiles
| | | /*.config compiler config files
| | | /makefile.* common definitions and rules
| | | /runall.sh testsuite run script
| | +- src/ configuration sources and
| | | scripts
| | +- windows/generate.wsf solution generation script
| | /configure.wsf configuration script
| | /build.wsf solution build script
| | /makelog.wsf log creation script
| | /runall.wsf testsuite run script
| | /*.js utility scripts
| | /*.config compiler config files
| +- nls/ locale definitions and
| | charmaps
| +- charmaps/ character set description files
| +- src/ locale definition files
+- examples/ set of examples and tutorials
| +- include/*.h common example headers
| +- manual/*.cpp example sources
| +- tutorial/*.cpp tutorial sources
+- include/* public library headers
| +- ansi/* C++ C library headers
| +- loc/_*.{h,c,cc} private locale headers
| +- rw/_*.{h,c,cc} other private library headers
+- src/*.cpp library sources
+- util/*.{h,c,cc,cpp} utility headers and sources
+- tests/ test suite files
| +- include/*.h common test headers
| +- */*.cpp test suite sources
+- ../rwtest test suite infrastructure
+- rw/
| +- rwtest/*.h test suite infrastructure
| headers
+- src/*.cpp test suite infrastructure
sources
4.1 Library Files
------------------
The public interface to the library consists of the following header
files specified by the C++ International Standard:
+------------+------------+------------+------------+------------+
|<algorithm> |<iomanip> |<list> |<ostream> |<streambuf> |
+------------+------------+------------+------------+------------+
|<bitset> |<ios> |<locale> |<queue> |<string> |
+------------+------------+------------+------------+------------+
|<complex> |<iosfwd> |<map> |<set> |<typeinfo> |
+------------+------------+------------+------------+------------+
|<deque> |<iostream> |<memory> |<sstream> |<utility> |
+------------+------------+------------+------------+------------+
|<exception> |<istream> |<new> |<stack> |<valarray> |
+------------+------------+------------+------------+------------+
|<fstream> |<iterator> |<numeric> |<stdexcept> |<vector> |
+------------+------------+------------+------------+------------+
|<functional>|<limits> | | | |
+------------+------------+------------+------------+------------+
These header files are contained in the ${TOPDIR}/include/
directory. Some of them have corresponding .cc and .c files in the
same directory. Those are private files that contain definitions of
out of line template functions, member functions of class templates,
or static data members of class templates.
The facilities of the Standard C library are exposed via the
following header files (along with their deprecated forms, i.e.,
files having the same name except for the leading letter 'c' and the
.h suffix) contained in the ${TOPDIR}/include/ansi/ directory:
+------------+------------+------------+------------+------------+
|<cassert> |<ciso646> |<csetjmp> |<cstdio> |<ctime> |
+------------+------------+------------+------------+------------+
|<cctype> |<climits> |<csignal> |<cstdlib> |<cwchar> |
+------------+------------+------------+------------+------------+
|<cerrno> |<clocale> |<cstdarg> |<cstring> |<cwctype> |
+------------+------------+------------+------------+------------+
|<cfloat> |<cmath> |<cstddef> | | |
+------------+------------+------------+------------+------------+
Any other header files not mandated by the C++ Standard are
contained in the include/rw/ or include/loc subdirectories. Their
names start with an underscore, to prevent potential clashes with
any user headers, and end in a .h suffix. Some of them may have
corresponding .c and .cc files.
In addition to header files, the library consists of a set of
private source files. Source files may have a .cpp, .s or .S
extension (for C++ or assembly source, respectively) and are
contained in the src/ subdirectory of the library source tree.
4.2 Library Utilities
----------------------
Several utility programs are provided in complete source form along
with the library sources. They are: exec, gencat, locale and
localedef. The header and source files for these utilities are
contained in the ${TOPDIR}/util/ directory. The exec and gencat
utilities are part of the test harness and are not intended to be
used directly. The localedef utility is used to build locales from
locale definition files and character set description files.
Locales generated by the utility can be read by the locale utility
and used by the Apache C++ Standard Library's localization library.
4.3 Locales
------------
Locale definition files suitable for processing by the localedef
utility are provided in the ${TOPDIR}/etc/nls/src/
directory. Character set description files that accompany the locale
definition files are provided in the ${TOPDIR}/etc/nls/charmaps/
directory. These files are copies of those distributed with GNU libc
2.2.
4.4 Test Suite Files
---------------------
The test suite consists of a set of three components: a makefile,
the exec test utility residing in ${BUILDDIR}/bin/exec, the test
driver library, rwtest, in ${TOPDIR}/tests/include/, and a large
number of test source files, residing in several subdirectories
under ${TOPDIR}/tests/.
Each test program links with the test driver library,
${BUILDDIR}/rwtest/librwtest.a, which contains code for command line
processing. When the tests are run by the test harness, they produce
output files which are then read and analyzed by the exec
utility. The utility writes the test results to stdandard output in
a tabular format, with columns indicating the exit status of each
test, the number of failed assertions, the total number of
assertions, the number of runtime warnings, and the amount of time
each test took to run. For more information refer to the help
output of the exec utility.
4.5 Examples and Tutorials
---------------------------
Two sets of example and tutorial programs are provided under the
${TOPDIR}/examples/ directory, in subdirectories manual/ and
tutorial/. The vast majority of example programs write their
results to standard output, and some of them also read their
standard input. When running the example programs via the test
harness, the standard input of each example is redirected from the
corresponding .in file (if one exists) in the in/ subdirectory, and
the standard output is compared with the corresponding .out file (if
it exists) in the out/ subdirectory to make sure the two match.
4.6 Build Directory Structure
------------------------------
The directory tree created and partially populated by the master
makefile, ${TOPDIR}/GNUmakefile, has the following structure (the ->
symbol indicates a symbolic link from the file on the left to the
one on the right):
${BUILDDIR}/GNUmakefile -> ${TOPDIR}/GNUmakefile
| /makefile.in generated makefile
| /makefile.common-> ${TOPDIR}/makefile.common
| /makefile.rules -> ${TOPDIR}/makefile.rules
| /run -> ${TOPDIR}/etc/config/runall.sh
+- bin/GNUmakefile -> ${TOPDIR}/etc/config/GNUmakefile.bin
| /*.{o,...} binaries and temporary files
| /.depend/*.d dependencies
+- examples/GNUmakefile -> ${TOPDIR}/etc/config/GNUmakefile.exm
| /run -> ${TOPDIR}/etc/config/runall.sh
| /*.{o,...} binaries and temporary files
| /.depend/*.d dependencies
+- include/GNUmakefile -> ${TOPDIR}/etc/config/GNUmakefile.cfg
| /config.h generated config header
| /*.{o,...} binaries and temporary files
| /.depend/*.d dependencies
+- lib/GNUmakefile -> ${TOPDIR}/etc/config/GNUmakefile.lib
| /*.{a,o,so,...} binaries and temporary files
| /.depend/*.d dependencies
+- nls/* -> binary locale files
+- rwtest/GNUmakefile.rwt->${TOPDIR}/etc/config/GNUmakefile.rwt
| /*.{a,o,so,...} binaries and temporary files
| /.depend/*.d dependencies
+- plumhall/GNUmakefile -> ${TOPDIR}/etc/config/GNUmakefile.ph
| /*.{d,o,...} binaries and temporary files
+- tests/GNUmakefile -> ${TOPDIR}/etc/config/GNUmakefile.tst
/*.{o,...} binaries and temporary files
/.depend/*.d dependencies
4.6.1 VisualStudio Directory Structure
---------------------------------------
The directory tree created and partially populated by the configure
script, ${TOPDIR}/configure.bat, has the following structure:
${BUILDDIR}/build_${CONFIG}.bat Root build script
| /*.{html,...} Temporary files
+- ${CONFIG}/${CONFIG}.sln Root solution
| /${CONFIG}_ex.sln Examples solution
| /${CONFIG}_loc.sln Locales solution
| /${CONFIG}_run.sln Run examples/tests solution
| /${CONFIG}_tst.sln Tests solution
| /${CONFIG}_tstloc.sln Locales tests solution
| /${CONFIG}slngen.log Configuration log file
+- Projects/*.vcproj Project files
| /examples/*.vcproj Examples project files
| /locales/*.vcproj Locales project files
| /tests/*.vcproj Tests project files
| /util/*.vcproj Utilities project files
.
. ...${BUILDTYPE} directories generated by running build script
.
+- ${BUILDTYPE}/bin/*.{exe,...} Binaries and temporary files
/examples/*.{exe,...} Binaries and temporary files
/include/config.h Generated config header
/lib/*.{dll,lib,...} Binaries and temporary files
/src/*.{obj,...} Temporary files
/tests/*.{obj,...} Binaries and temporary files
/src/*.{obj,...} Temporary files
5 Library Build Instructions
-----------------------------
To build the library, test suite (*), and examples (*), perform the
following steps: (* Where available.)
o $ cd stdcxx-X.Y.Z/
$ ls # this is ${TOPDIR}
bin doc generate.bat LICENSE.txt src
ChangeLog etc GNUmakefile NOTICE.txt tests
configure.bat examples include README util
o $ gmake BUILDDIR=<build-dir> \
[ BUILDTYPE=<build-type> \
| BUILDMODE=<build-mode> ] \
[ CONFIG=<config-file> ]
<build-dir> is the pathname of the build directory where you want
to perform the build; the directory will be created
(as will all its required subdirectories)
this is a required argument
<build-type> is one of {
8s, 8d, 11s, 11d, 12s, 12d, 15s, 15d,
8S, 8D, 11S, 11D, 12S, 12D, 15S, 15D
}
The numeric part of <build-type> determines the
presence or absence of support for debugging,
whether optimization is or isn't enabled, and the
thread safety level of the library, as follows:
-- optimization enabled: even numbers (i.e., 8 and
12)
-- debugging enabled: odd numbers (i.e., 11 and 15)
-- thread safe code: 12 and 15
The single letter following the numeric part of
<build-type> determines whether an archive or shared
library is built, and whether narrow (32-bit) code
or wide (64-bit) code should be generated:
-- s and S implies an archive library
-- d and D implies a shared library
-- lowercase letter implies narrow (32-bit) code
-- capital letter implies wide (64-bit) code
The <build-type> argument is optional. When not
specified a build type of 11s is assumed.
<build-mode> is a comma-separated list of keywords describing how
to build the library and the rest of the
binaries. The following arguments are recognized:
dcethreads - create a thread-safe library, use DCE
threads
debug - include debugging information
optimized - optimized
pthreads - create a thread safe library, use POSIX
threads
shared - create a shared library (archive is default)
shared,archive - create an AIX shared archive
threads - create a thread-safe library, use Solaris
threads
wide - generate wide (64-bit) code
Note that exactly one of BUILDTYPE and BUILDMODE must be defined.
<config-file> name (not pathname) of a config file containing
compiler options; the available configuration files
are:
acc.config - for HP aCC
como.config - for Comeau C++
eccp.config - for EDG eccp
gcc.config - for gcc
icc.config - for Intel C++ on Linux
mipspro.config - for SGI MIPSpro
osf_cxx.config - for Compaq/HP C++
reliant_cds.config - for Siemens CDS++
sunpro.config - for Sun C++
vacpp.config - for IBM VisualAge C++ and XL C/C++
this argument is optional, the default is gcc.config
o Example:
$ gmake BUILDDIR=/tmp/g++-15d \
BUILDTYPE=15d \
CONFIG=gcc.config
or equivalently
$ gmake BUILDDIR=/tmp/g++-15d \
BUILDMODE=debug,shared,pthreads \
CONFIG=gcc.config
This command will create a build directory rooted at ${BUILDDIR},
run the configuration scripts, and build a thread-safe shared
library with debugging information included and debugging
facilities enabled. If the build is successful, the library will
be located in ${BUILDDIR}/lib/ and will be named
libstd${BUILDTYPE}.so.X.Y.Z (libstd${BUILDTYPE}.a if building an
archive). A symbolic link named libstd${BUILDTYPE}.so in the
same directory will also be created pointing to the shared
library. Public library headers are in ${TOPDIR}/include/ and its
subdirectories, the generated config.h is in
${BUILDDIR}/include/.
o To change preprocessor, compiler, or linker options you can
either set the make variables CPPOPTS, CXXOPTS, and LDOPTS on the
command line (recommended, except with HP aCC) or modify
${BUILDDIR}/makefile.in. The second option is recommended when
compiling with HP aCC (as the compiler looks for environment
variables with the same names).
o To reconfigure and/or rebuild the library (perhaps after changing
a preprocessor, compiler, or linker option), follow these steps:
$ cd ${BUILDDIR}
$ gmake -Cinclude [ config ] # configure
$ gmake config # same
$ gmake lib # build the library
$ gmake examples # build examples
$ gmake util # build utility programs
$ gmake rwtest # build the test driver
$ gmake tests # build tests
$ gmake locales # build locale databases
Alternatively, you can cd into the respective subdirectories and
just type gmake:
$ (cd ${BUILDDIR}/include && gmake) # configure
$ (cd ${BUILDDIR}/lib && gmake) # build the library
$ (cd ${BUILDDIR}/bin && gmake) # build utilities
$ (cd ${BUILDDIR}/examples && gmake) # build examples
$ (cd ${BUILDDIR}/tests && gmake) # build tests
$ (cd ${BUILDDIR}/bin && gmake locales) # build locale databases
Parallel builds (gmake -j[N]) are possible in any directory
except for ${BUILDDIR}/include/.
To remove intermediate files from the build directory, use one of
the following commands:
$ cd ${BUILDDIR}
$ gmake clean # remove all object files
$ gmake dependclean # remove .d files (dependencies)
$ gmake realclean # remove all temporary files
5.1 VisualStudio Setup Instructions
------------------------------------
To generate a Microsoft VisualStudio solution (for .NET 2003 or 2005
only) follow the step below.
o > CD stdlib-X.Y.Z\stdlib
> DIR /D # this is ${TOPDIR}
GNUmakefile etc examples configure.bat include src tests
If your distribution does not contain the test suite and/or the
examples, the output will look like so:
> DIR /D # this is ${TOPDIR}
GNUmakefile etc configure.bat include src
o > .\configure.bat [/BUILDDIR:<builddir>] [/CONFIG:<config>]
<builddir> is the pathname of the build directory where to create
the solution and projects; the directory will be
created (as will all its required subdirectories)
The <builddir> argument is optional. When not
specified a current directory is assumed.
<config> name (not pathname) of a config file containing
compiler options; the available configuration options
are:
icc-9.0 - for Intel C++ 9.0
icc-9.1 - for Intel C++ 9.1
icc-10.0 - for Intel C++ 10.0
icc-10.0-x64 - for Intel C++ 10.0 (x64 platform)
msvc-7.0 - for Microsoft Visual C++ .NET
msvc-7.1 - for Microsoft Visual C++ .NET 2003
msvc-8.0 - for Microsoft Visual C++ .NET 2005
msvc-8.0-x64 - for Microsoft Visual C++ .NET 2005
(x64 platform)
msvcex-8.0 - for Microsoft Visual C++ Express
2005
The <config> argument is optional. When not
specified, the suitable config file will be selected
automatically.
o Example:
> configure.bat /BUILDDIR:C:\stdcxx /CONFIG:msvc-7.1
This command will create a build directory rooted at ${BUILDDIR},
the solution file ${BUILDDIR}\msvc-7.1\msvc-7.1.sln, the project
files in directory ${BUILDDIR}\msvc-7.1\Projects, and batch file
${BUILDDIR}\build_msvc-7.1.bat.
To build the library, test suite (*), and examples (*), perform the
following steps: (* Where available.)
o > cd ${BUILDDIR}
o > build_msvc-7.1.bat [<build-types>]
<build-types> is one or more of {
8s, 8d, 11s, 11d, 12s, 12d, 15s, 15d
}
The numeric part of <build-type> determines the
presence or absence of support for debugging,
whether optimization is or isn't enabled, and the
thread safety level of the library, as follows:
-- optimization enabled: even numbers (i.e., 8 and
12)
-- debugging enabled: odd numbers (i.e., 11 and 15)
-- thread safe code: 12 and 15
The single letter following the numeric part of
<build-type> determines whether a static or dynamic
library is built:
-- s implies an static library
-- d implies a dynamic library
The <build-types> argument is optional. When not
specified a build type of 11s is assumed.
o Example:
> build_msvc-7.1.bat 15d
run the configuration scripts, and build a thread-safe dynamic
library with debugging information included and debugging
facilities enabled. If the build is successful, the library will
be located in ${BUILDDIR}\msvc-7.1\${BUILDTYPE}\lib\ and will be
named libstd${BUILDTYPE}.dll (libstd${BUILDTYPE}.lib if building
a static library). Public library headers are in
${TOPDIR}\include\ and its subdirectories, the generated config.h
is in ${BUILDDIR}\msvc-7.1\${BUILDTYPE}\include\.
Alternatively, you can run Microsoft Visual Studio IDE, open the
generated solution file, select the desired solution configuration
and invoke "Build"->"Build Solution" command.
6 Library Installation
-----------------------
When using the installed library be sure to define any macros also
defined on the command line when building the library. These are:
_RWSTDDEBUG to enable debugging support in the library; when using
compilers that do not provide an option to enable thread safety or
to select a thread library, the following macros may also have to be
defined: _RWSTD_POSIX_THREADS, _RWSTD_SOLARIS_THREADS,
_RWSTD_DCE_THREADS, and _RWSTDDEBUG. Failing to do so, or failing
to specify the same compiler options that affect the binary
compatibility of the library leads to undefined behavior of the
produced executables.
6.1 Library Installation on UNIX Systems
-----------------------------------------
To install the library, including all required headers, the
utilities that are intended for distribution, and the full set of
locales, follow the following steps:
o $ cd ${BUILDDIR}
o $ gmake install PREFIX=<installation-directory>
The second command will build the library, the utilities, and the
full set of locales, create the specified installation directory if
it doesn't exist yet, and install in it the final product (including
library headers). The structure of the installation directory is as
follows:
${PREFIX}
|
+- bin/locale utility programs
| /localedef
+- etc/rwstderr.cat message catalog
+- include/*{,.cc} library headers
| /config.h generated configuration header
+- lib/libstd*.[a|so] archive or .so symbolic link
| libstd*.so.5.0.0 versioned shared library
+- nls/*/* codeset and locale databases
To specify a subset of locales to install instead of the full set,
define the LOCALES make variable to the desired set of locale
names. For example, to install only the en_US.ISO-8859-1 and
de_DE@UTF-8 locales, enter:
o $ cd ${BUILDDIR}
o $ gmake install PREFIX=<installation-directory> \
LOCALES="en_US.ISO-8859-1 de_DE@UTF-8"
To use the installed library to compile and link C++ programs, set
your compiler's preprocessor search path (typically via the -I
command line option) to point to ${PREFIX}/include, and the linker
search path (typically via the -L command line option) to point to
${PREFIX}/lib, and specify the base name of the library (typically
via the -l command line option).
For example, to compile a C++ program, t.cpp, in the current working
directory with Sun C++ using stdcxx instead of the compiler's native
C++ Standard Library, and link it with the stdcxx library named
libstd12d (i.e., a narrow or 32-bit, optimized, reentrant, shared
library), enter:
o CC -I${PREFIX}/include -mt -library=%none -c -o t.o t.cpp
o CC -L${PREFIX}/lib -mt -library=%none t.o -lstd12d -o prog
This will produce ane executable file named prog that depends on the
stdcxx shared library libstd12d.so. To run the executable, set your
runtime loader path to point to ${PREFIX}/lib before invoking prog.
This is typically done like so (the name of the envrionment variable
may be different depending on the operating system):
o LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PREFIX}/lib ./prog
7 Test Suite Build Instructions
--------------------------------
When available, the test suite can be built by following the
following steps.
o $ cd ${BUILDDIR}
$ gmake [ rwtest ][ tests ] [ examples ]
The rwtest library is a prerequisite for the test programs (gmake
rwtest).
From ${BUILDDIR}, you can proceed to build the tests and the
examples, either individually or all at the same time. You can
either navigate into the respective subdirectories (i.e.,
${BUILDDIR}/tests/, or ${BUILDDIR}/examples/) and type gmake [
target ] to build there or you can build directly from
${BUILDDIR} by typing gmake tests or gmake examples.
The library sources and headers are expected to reside in
${TOPDIR}/src/ and ${TOPDIR}/include/, respectively, tests(*) in
${TOPDIR}/tests/ and examples(*) in ${TOPDIR}/examples/. The .d
(dependencies) , .o (object) files and the executables are placed
in the respective subdirectories of ${BUILDDIR}.
* Where available.
To run the tests(*) or examples(*), cd into ${BUILDDIR}/tests/ or
${BUILDDIR}/examples/, respectively, and type gmake run. For
best results you should be using bash and an xterm. To make sure
that you use bash either set your SHELL environment variable or
set the SHELL makefile variable on the command line to the
pathname of bash on your system.
By default, the output of gmake run is formatted and colorized.
If your terminal cannot deal with the escape sequences used to
produce colors you can make it monochrome by setting your RUNOPTS
make variable to -m on the command line (see
${TOPDIR}/etc/config/runall.sh for other options).
* Where available.
7.1 VisualStudio Test Suite Build Instructions
-----------------------------------------------
When available, the test suite can be built by following the
following steps.
o Run Microsoft Visual Studio IDE, open the generated solution
file and select the desired solution configuration.
To build the examples select the .stdcxx_examples project and
invoke "Build"->"Build .stdcxx_examples" command.
To build the tests select the .stdcxx_tests project and invoke
"Build"->"Build .stdcxx_tests" command.
To run the examples select the .stdcxx_runexamples project and
invoke "Build"->"Build .stdcxx_runexamples" command.
To run the tests select the .stdcxx_runtests project and invoke
"Build"->"Build .stdcxx_runtests" command.
8 Library Configuration
------------------------
8.1 Heade config.h (and config.log)
------------------------------------
The library is configured (or reconfigured) for the platform (i.e.,
the compiler and operating system) it is to be built by executing
the following command in the ${BUILDDIR}/include/ directory:
$ gmake config
This command generates a new config.h header file in the
${BUILDDIR}/include/ directory (replacing an existing one only if
the new one differs) containing configuration macros describing to
the library the properties of the platform. Executing the config
target writes the details of the configuration, including the
executed commands, into a log file named config.log. This file is
helpful in detecting configuration problems when porting the library
to new environments.
8.2 rw/_config.h and rw/_defs.h
--------------------------------
The generated config.h header is #included by a single private
library header, ${TOPDIR}/include/rw/_config.h. The purpose of this
header is to provide a central place for the maintainers of the
project to manually override the configuration macros #defined in
the automatically generated config.h (e.g., by #undefining them when
they are #defined incorrectly or vice versa) based on their
knowledge of the platform.
The header is divided into three sets of sections: one for the
hardware architecture, one for each supported compiler, and one for
each supported operating system. Each section may #define or
#undefine object-like configuration macros. As a matter of
convention, function-like macros are not #defined in this header.
The ${TOPDIR}/rw/_config.h header is #included by a single library
header, ${TOPDIR}/include/rw/_defs.h. The purpose of this header is
to #define convenience function-like macros, typically based on the
value of one or more object-like configuration macros #defined in
${BUILDDIR}/include/config.h and/or ${TOPDIR}/include/rw/_config.h,
that can then be easily used in the library headers and sources
without the need for complicated, hard-to-read preprocessor
conditionals. The idea is that all the complicated, unsightly logic
is tucked away in one central place and the rest of the code is
clean, even if obfuscated by macros.
Every other library header, whether public or private, #includes the
${TOPDIR}/include/rw/_defs.h header.
8.3 Configuration Macros
-------------------------
The library and the testsuite make use of a large number of macros
to adjust their interface and behavior to the capabilities of the
compiler, the underlying C libraries, and the operating system.
Many of the macro definitions are generated during the
autoconfiguration of the library and placed in
${BUILDDIR}/include/config.h. Some (but not necessarily all) of the
important macros are described here. This list is intended as a
reference for maintainers or porters of the library.
The symbols in square brackets next to the macros below have the
following meaning:
- abi: Affects the binary (ABI or functional) compatibility of the
library. The macro must be consistently #defined to the same value
(or consistently #undefined) during the compilation of the library
as well while using it.
- auto: Automatically determined and #defined during configuration
- lib: Affects library builds. The macro is not to be set except
when building the library.
- over: May be #defined or overridden on the command line or by
editing one of the two config headers either when building the
library or when using it (except for those marked lib).
In addition, whenever a macro with the same root but a different
suffix appears in the description a modified regular expression
syntax has been used to abbreviate the list.
8.3.1 Platform Identification Macros
-------------------------------------
The configuration infrastructure #defines a number of macros some of
which can and should be used instead of similar such macros #defined
by some compilers.
o _RWSTD_OS_<os-name>
The name of the macro depends on the name of the operating system
typically reported by the uname utility:
_RWSTD_OS_AIX: AIX
_RWSTD_OS_DARWIN: Apple Darwin
_RWSTD_OS_FREEBSD: FreeBSD
_RWSTD_OS_HP_UX: HP-UX
_RWSTD_OS_IRIX64: IRIX
_RWSTD_OS_LINUX: Linux
_RWSTD_OS_NETBSD: NetBSD
_RWSTD_OS_OSF1: Tru64 UNIX
_RWSTD_OS_SUNOS: SunOS and Solaris
_RWSTD_OS_WINDOWS: Microsoft Windows
o _RWSTD_OS_SYSNAME
This macro expands to a string literal with the name of the
operating system (the output of uname).
o _RWSTD_OS_RELEASE
This macro expands to a string literal with the name of the
operating system release (the output of uname -r).
o _RWSTD_OS_VERSION
This macro expands to a string literal with the name of the
operating system version (the output of uname -v).
o _RWSTD_OS_MAJOR
This macro expands to the major operating system version as a
constant integer expressions suitable for use in #if
preprocessing directives.
o _RWSTD_OS_MINOR
This macro expands to the minor operating system version as a
constant integer expressions suitable for use in #if
preprocessing directives.
o _RWSTD_OS_MICRO
This macro expands to the micro operating system version as a
constant integer expressions suitable for use in #if
preprocessing directives.
8.3.2 Compiler Configuration Macros
------------------------------------
o _RWSTD_NO_CONST_CAST [auto, over]
o _RWSTD_NO_DYNAMIC_CAST [auto, over]
o _RWSTD_NO_REINTERPRET_CAST [auto, over]
o _RWSTD_NO_STATIC_CAST [auto, over]
#defined when the respective cast operator is not available or
does not function properly. In such cases, the ordinary
(C-style) cast is used instead.
o _RWSTD_NO_EXCEPTION_SPECIFICATION [auto]
#defined when function exception specification is not supported
or not functioning properly. All function exception
specifications in the source code are removed.
o _RWSTD_NO_EXPORT [auto, over]
#defined when the export keyword is not supported or when the
export feature does not work as expected.
o _RWSTD_NO_EXPORT_KEYWORD [auto, over]
#defined when the export keyword is not supported.
o _RWSTD_NO_FUNCTION_TRY_BLOCK [auto]
#defined when the function try block syntax is not supported.
o _RWSTD_NO_EXCEPTIONS [auto, lib]
#defined when exceptions are not supported or disabled. All try
keywords in the source code are removed, catch expands to while
(0) with the assumption that an optimizing compiler will remove
the block.
o _RWSTD_NO_EXPLICIT_INSTANTIATION [abi, auto, lib]
#defined when explicit template instantiation isn't supported.
o _RWSTD_NO_EXPLICIT_CTOR_INSTANTIATION [auto]
#defined when explicit template instantiation of constructors
isn't supported.
o _RWSTD_NO_EXPLICIT_FUNC_INSTANTIATION [abi, auto, lib]
#defined when explicit function template instantiation isn't
supported.
o _RWSTD_NO_EXPLICIT_INSTANTIATION_BEFORE_DEFINITION [auto, lib]
#defined when class templates cannot be explicitly instantiated
lexically before the definitions of all their members defined
outside their bodies.
o _RWSTD_NO_EXPLICIT_INSTANTIATION_WITH_IMPLICIT_INCLUSION [auto]
#defined when explicit template instantiation isn't supported in
conjunction with the implicit inclusion of template definition
files (i.e., the .c or .cc files).
o _RWSTD_NO_EXPLICIT_MEMBER_INSTANTIATION [auto]
#defined when the explicit instantiation of member functions of
class templates isn't supported.
o _RWSTD_NO_EXTERN_TEMPLATE [auto, over]
When #defined, the extern template C++ extension is not supported
by the compiler.
o _RWSTD_NO_IMPLICIT_INSTANTIATION [auto]
#defined when the explicit instantiation of a template that
references another template doesn't cause the implicit
instantiation of the other template.
o _RWSTD_NO_INSTANTIATE_DEFAULT_ARGS
#defined when the explicit instantiation of a function template
with a default argument causes the instantiation of the argument.
o _RWSTD_NO_HONOR_STD