Skip to content

Commit

Permalink
update-distcc-symlinks: create symlinks in $prefix
Browse files Browse the repository at this point in the history
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
  • Loading branch information
asheplyakov committed Jul 21, 2021
1 parent b94b751 commit ef795d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Makefile.in
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion update-distcc-symlinks.py
Expand Up @@ -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()
Expand Down

0 comments on commit ef795d4

Please sign in to comment.