diff options
author | Alexey Sheplyakov <asheplyakov@altlinux.org> | 2021-07-21 11:51:20 +0400 |
---|---|---|
committer | Alexey Sheplyakov <asheplyakov@altlinux.org> | 2021-07-21 12:07:31 +0400 |
commit | ef795d4fa8b04ee0227377a207514221f5b33451 (patch) | |
tree | 9b9a277739ccb61fc6318ce4438e3835a6819361 | |
parent | b94b751aef444e0e9e5224730891650d03d12a4d (diff) | |
download | distcc-git-ef795d4fa8b04ee0227377a207514221f5b33451.tar.gz |
update-distcc-symlinks: create symlinks in $prefix
distccd looks for approved compilers in $prefix/lib/distcc.
However update-distcc-symlinks always creates symlinks in /usr/lib.
Thus if distcc is installed in a custom directory (`--prefix=/opt`,
or `--prefix=$HOME`) distccd will refuse compilation jobs even
after running `update-distcc-symlinks`.
This patch adjusts `update-distcc-symlinks` so it creates
symlinks in $prefix/lib/distcc. As a side effect it's possible
to use `update-distcc-symlinks` without root permissions.
Related: #431
-rw-r--r-- | Makefile.in | 4 | ||||
-rwxr-xr-x | update-distcc-symlinks.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in index 51f4072..db895d0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -515,7 +515,9 @@ lsdistcc@EXEEXT@: $(lsdistcc_obj) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(lsdistcc_obj) $(LIBS) update-distcc-symlinks: $(update_distcc_symlinks_PY) - cp $< $@ + sed -e "s;\@prefix\@;${prefix};g" $< > $@.tmp + chmod +x $@.tmp + mv $@.tmp $@ h_exten@EXEEXT@: $(h_exten_obj) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(h_exten_obj) $(LIBS) diff --git a/update-distcc-symlinks.py b/update-distcc-symlinks.py index bc5cff2..9f29288 100755 --- a/update-distcc-symlinks.py +++ b/update-distcc-symlinks.py @@ -2,7 +2,7 @@ import subprocess, string, os, stat, re -distcc_dir = "/usr/lib/distcc" +distcc_dir = "@prefix@/lib/distcc" gcc_dir = "/usr/lib/gcc" gcccross_dir = "/usr/lib/gcc-cross" old_symlinks = set() |