Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef2ecba

Browse files
author
Luboš Luňák
committed
install clang/clang++ wrappers symlinks conditionally again
The idea to make them unconditional is flawed, as it the clang->icerun symlink can be easily confused by the real compiler executable (e.g. in configure scripts checking for the specific compiler), but it doesn't work like one if the real compiler is not installed. Make them again optional, and add a configure option to force them. This reverts commit 5173304 and adds the option.
1 parent 168d4e9 commit ef2ecba

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

client/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ install-exec-local:
2929
$(LN_S) $(bindir)/icecc $(DESTDIR)$(bindir)/icerun
3030

3131
$(mkinstalldirs) $(DESTDIR)$(pkglibexecdir)/bin
32-
for link in g++ gcc c++ cc clang++ clang; do \
32+
for link in g++ gcc c++ cc $(CLANG_SYMLINK_WRAPPERS); do \
3333
rm -f $(DESTDIR)$(pkglibexecdir)/bin/$$link ;\
3434
$(LN_S) $(bindir)/icecc $(DESTDIR)$(pkglibexecdir)/bin/$$link ;\
3535
done
3636

3737
uninstall-local:
3838
rm $(DESTDIR)$(bindir)/icerun
3939

40-
for link in g++ gcc c++ cc clang++ clang; do \
40+
for link in g++ gcc c++ cc $(CLANG_SYMLINK_WRAPPERS); do \
4141
rm $(DESTDIR)$(pkglibexecdir)/bin/$$link ;\
4242
done

configure.ac

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,23 @@ else
304304
fi
305305
fi
306306

307+
AC_ARG_ENABLE(clang-wrappers,
308+
AS_HELP_STRING([--enable-clang-wrappers],
309+
[Use symlink wrappers for clang/clang++.]))
310+
311+
CLANG_SYMLINK_WRAPPERS=
312+
if test "$enable_clang_wrappers" = "yes"; then
313+
CLANG_SYMLINK_WRAPPERS='clang clang++'
314+
elif test "$enable_clang_wrappers" = "no"; then
315+
true # do not enable
316+
else
317+
AC_CHECK_PROG(CLANG,clang,clang)
318+
if test -n "$CLANG"; then
319+
CLANG_SYMLINK_WRAPPERS='clang clang++'
320+
fi
321+
fi
322+
AC_SUBST(CLANG_SYMLINK_WRAPPERS)
323+
307324
AC_CONFIG_FILES([ Makefile ])
308325
AC_CONFIG_FILES([ client/Makefile ])
309326
AC_CONFIG_FILES([ daemon/Makefile ])

0 commit comments

Comments
 (0)