bloomberg/bde — pull request #147 by apaprocki (2014-11-11 18:33:05+00:00)
Title: build: Fix Solaris application of linker flag -lrt in bsl/bdl.

Previously, `-lrt` was added to `BDE_ENDLDFLAGS` in `bsl.defs` for all
components, which places it outside of the `$(BDE_DYNAMIC)` scope and
causes linking to fail since there is no static `librt`. This was only
added in `bsl.defs` for `bsls`, but `bsls.opts` already properly
defines the `BDE_ENDLDFLAGS` to link `-lrt` dynamically. The unneeded
application of `-lrt` in `bsl.defs` is removed.

```
[bsls_alignedbuffer.t.cpp.79.o (ERROR)] <<<<<<<<<<
ld: fatal: library -lrt: not found
ld: fatal: file processing errors. No output written to bde/build/groups/bsl/bsls/bsls_alignedbuffer.t
>>>>>>>>>>
```

The new datetime test drivers in `bdlt` use `clock_gettime`. That
function is provided by `-lrt` on Solaris and nothing adds it to the
command line when linking the test drivers. The file `bdlt.opts` is
added to properly add `-lrt` to `BDE_ENDLDFLAGS` to ensure the three
specified test drivers link correctly.

```
[bdlt_currenttime.t.cpp.326.o (ERROR)] <<<<<<<<<<
Undefined first referenced
symbol in file
clock_gettime groups/bsl/libbsl.a(bsls_systemtime.cpp.78.o)
ld: fatal: symbol referencing errors. No output written to bdl/bdlt/bdlt_currenttime.t
>>>>>>>>>>
[bdlt_intervalconversionutil.t.cpp.337.o (ERROR)] <<<<<<<<<<
Undefined first referenced
symbol in file
clock_gettime groups/bsl/libbsl.a(bsls_systemtime.cpp.78.o)
ld: fatal: symbol referencing errors. No output written to bdl/bdlt/bdlt_intervalconversionutil.t
>>>>>>>>>>
[bdlt_localtimeoffset.t.cpp.338.o (ERROR)] <<<<<<<<<<
Undefined first referenced
symbol in file
clock_gettime groups/bsl/libbsl.a(bsls_systemtime.cpp.78.o)
ld: fatal: symbol referencing errors. No output written to bde/build/groups/bdl/bdlt/bdlt_localtimeoffset.t
>>>>>>>>>>
```

Unneeded flags in `bsl.defs` for DG-UX and the old Solaris Forte6
compiler are removed.

Tested that full build of all code and test drivers works on Solaris with these changes.