diff options
author | CoprDistGit <infra@openeuler.org> | 2024-10-05 13:47:38 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-10-05 13:47:38 +0000 |
commit | 69e7afdb85a5b83ef746994fa96d2f259072983f (patch) | |
tree | a8265af768af7605cb18638d9d5af43d7d58cbb0 /ccache.csh.in | |
parent | 9d835d18dad0aaadead88bcbc4b395b8cce9f914 (diff) |
automatic import of ccache
Diffstat (limited to 'ccache.csh.in')
-rw-r--r-- | ccache.csh.in | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ccache.csh.in b/ccache.csh.in new file mode 100644 index 0000000..4edbb51 --- /dev/null +++ b/ccache.csh.in @@ -0,0 +1,26 @@ +# Use ccache by default. Users who don't want that can setenv the +# CCACHE_DISABLE environment variable in their personal profile. + +if ( "$path" !~ *@LIBDIR@/ccache* ) then + set path = ( @LIBDIR@/ccache $path ) +endif + +# If @CACHEDIR@ is writable, use a shared cache there, except for root. +# Users who don't want that even if they have the write permission can setenv +# the CCACHE_DIR environment variable to another location and possibly unsetenv +# the CCACHE_UMASK environment variable in their personal profile. + +if ( $?CCACHE_DIR ) then + if ( ! -w "$CCACHE_DIR" ) then + # Reset broken settings maybe inherited when switching users (#651023). + unsetenv CCACHE_DIR + unsetenv CCACHE_UMASK + endif +else if ( $uid != 0 ) then + if ( -w @CACHEDIR@ && -d @CACHEDIR@ ) then + # Set up the shared cache. + setenv CCACHE_DIR @CACHEDIR@ + setenv CCACHE_UMASK 002 + unsetenv CCACHE_HARDLINK + endif +endif |