Unified · Split
| @@ -215,12 +215,12 @@ ifneq ($(BCHECK_O),) · 214 unmodified lines | ||
| 215 | 215 | $(INSTALL) -m644 $(BCHECK_O) "$(tccdir)" |
| 216 | 216 | endif |
| 217 | 217 | $(INSTALL) -m644 $(addprefix include/,$(TCC_INCLUDES)) "$(tccdir)/include" |
| 218 | − mkdir -p "$(docdir)" | |
| 219 | − $(INSTALL) -m644 tcc-doc.html "$(docdir)" | |
| 220 | 218 | mkdir -p "$(libdir)" |
| 221 | 219 | $(INSTALL) -m644 libtcc.a "$(libdir)" |
| 222 | 220 | mkdir -p "$(includedir)" |
| 223 | 221 | $(INSTALL) -m644 libtcc.h "$(includedir)" |
| 222 | + mkdir -p "$(docdir)" | |
| 223 | + -$(INSTALL) -m644 tcc-doc.html "$(docdir)" | |
| 224 | 224 | |
| 225 | 225 | uninstall: |
| 226 | 226 | rm -fv $(foreach P,$(PROGS),"$(bindir)/$P") |
| @@ -284,6 +284,9 @@ libxxx.a. The library is searched in the paths specified by the · 283 unmodified lines | ||
| 284 | 284 | Generate a shared library instead of an executable (@option{-o} option |
| 285 | 285 | must also be given). |
| 286 | 286 | |
| 287 | +@item -soname name | |
| 288 | +set name for shared library to be used at runtime | |
| 289 | + | |
| 287 | 290 | @item -static |
| 288 | 291 | Generate a statically linked executable (default is a shared linked |
| 289 | 292 | executable) (@option{-o} option must also be given). |
| @@ -310,6 +313,9 @@ Binary image (only for executable output) · 20 unmodified lines | ||
| 310 | 313 | COFF output format (only for executable output for TMS320C67xx target) |
| 311 | 314 | @end table |
| 312 | 315 | |
| 316 | +@item -Wl,-rpath=path | |
| 317 | +Set custom library search path | |
| 318 | + | |
| 313 | 319 | @end table |
| 314 | 320 | |
| 315 | 321 | Debugger options: |
| @@ -442,6 +442,8 @@ int parse_args(TCCState *s, int argc, char **argv) · 441 unmodified lines | ||
| 442 | 442 | { |
| 443 | 443 | error("target %s not found", p); |
| 444 | 444 | } |
| 445 | + } else if (strstart(optarg, "-rpath=", &p)) { | |
| 446 | + s->rpath = p; | |
| 445 | 447 | } else { |
| 446 | 448 | error("unsupported linker option '%s'", optarg); |
| 447 | 449 | } |
| @@ -434,6 +434,8 @@ struct TCCState { · 433 unmodified lines | ||
| 434 | 434 | |
| 435 | 435 | /* soname as specified on the command line (-soname) */ |
| 436 | 436 | const char *soname; |
| 437 | + /* rpath as specified on the command line (-Wl,-rpath=) */ | |
| 438 | + const char *rpath; | |
| 437 | 439 | |
| 438 | 440 | /* if true, all symbols are exported */ |
| 439 | 441 | int rdynamic; |
| @@ -1563,6 +1563,10 @@ int elf_output_file(TCCState *s1, const char *filename) · 1562 unmodified lines | ||
| 1563 | 1563 | if (dllref->level == 0) |
| 1564 | 1564 | put_dt(dynamic, DT_NEEDED, put_elf_str(dynstr, dllref->name)); |
| 1565 | 1565 | } |
| 1566 | + | |
| 1567 | + if (s1->rpath) | |
| 1568 | + put_dt(dynamic, DT_RPATH, put_elf_str(dynstr, s1->rpath)); | |
| 1569 | + | |
| 1566 | 1570 | /* XXX: currently, since we do not handle PIC code, we |
| 1567 | 1571 | must relocate the readonly segments */ |
| 1568 | 1572 | if (file_type == TCC_OUTPUT_DLL) { |
| @@ -1570,7 +1574,6 @@ int elf_output_file(TCCState *s1, const char *filename) · 1 unmodified line | ||
| 1570 | 1574 | put_dt(dynamic, DT_SONAME, put_elf_str(dynstr, s1->soname)); |
| 1571 | 1575 | put_dt(dynamic, DT_TEXTREL, 0); |
| 1572 | 1576 | } |
| 1573 | − | |
| 1574 | 1577 | /* add necessary space for other entries */ |
| 1575 | 1578 | saved_dynamic_data_offset = dynamic->data_offset; |
| 1576 | 1579 | dynamic->data_offset += sizeof(ElfW(Dyn)) * EXTRA_RELITEMS; |