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