Contents of /smage/trunk/include/gcc-toolchain.sminc
Parent Directory | Revision Log
Revision 13765 -
(show annotations)
(download)
Tue Oct 29 21:06:32 2019 UTC (4 years, 10 months ago) by niro
File size: 2165 byte(s)
Tue Oct 29 21:06:32 2019 UTC (4 years, 10 months ago) by niro
File size: 2165 byte(s)
-only run zapmost and clean if the target directories exist, this fixes issues with empty libvtv pkgs
1 | # $Id$ |
2 | # gcc toolchain functions |
3 | |
4 | # helper functions |
5 | lang_enabled() |
6 | { |
7 | local lang="$1" |
8 | |
9 | if [[ ${MyLanguages//${lang}} != ${MyLanguages} ]] |
10 | then |
11 | return 0 |
12 | else |
13 | return 1 |
14 | fi |
15 | } |
16 | |
17 | install_gcc_library() |
18 | { |
19 | local library="$1" |
20 | |
21 | cd ${SRCDIR}/build |
22 | mmake -C ${CHOST}/${library} DESTDIR=${BINDIR} install-toolexeclibLTLIBRARIES || die |
23 | if [[ $(mlibdir) != lib ]] |
24 | then |
25 | if [ -d ${CHOST}/32/${library} ] |
26 | then |
27 | mmake -C ${CHOST}/32/${library} DESTDIR=${BINDIR} install-toolexeclibLTLIBRARIES || die |
28 | fi |
29 | fi |
30 | } |
31 | |
32 | uninstall_gcc_library() |
33 | { |
34 | local library="$1" |
35 | |
36 | cd ${SRCDIR}/build |
37 | mmake -C ${CHOST}/${library} DESTDIR=${BINDIR} uninstall-toolexeclibLTLIBRARIES || die |
38 | if [[ $(mlibdir) != lib ]] |
39 | then |
40 | if [ -d ${CHOST}/32/${library} ] |
41 | then |
42 | mmake -C ${CHOST}/32/${library} DESTDIR=${BINDIR} uninstall-toolexeclibLTLIBRARIES || die |
43 | fi |
44 | fi |
45 | } |
46 | |
47 | versionize_all_bins() |
48 | { |
49 | local bin |
50 | |
51 | for bin in $(find ${BINDIR}/usr/bin -type f) |
52 | do |
53 | # only rename unversionized bins |
54 | if [[ ${bin//${PVER}} = ${bin} ]] && [[ ! -e ${bin}-${PVER} ]] |
55 | then |
56 | echo ${bin} |
57 | mv ${bin} ${bin}-${PVER} || die |
58 | ln -snf $(basename ${bin}-${PVER}) ${bin} || die |
59 | fi |
60 | done |
61 | } |
62 | |
63 | keep_dev_package_libs() |
64 | { |
65 | local libs="$@" |
66 | |
67 | # run zapmost only if the directories exists, which fixes empy libvtv issues |
68 | if [[ -d ${BINDIR}/usr/$(mlibdir) ]] |
69 | then |
70 | # cleanup, only keep the libs, everything else get provided by the dev-package |
71 | zapmost ${BINDIR}/usr/$(mlibdir) "${libs}" || die |
72 | fi |
73 | # multilib as well |
74 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] |
75 | then |
76 | zapmost ${BINDIR}/usr/lib "${libs}" || die |
77 | fi |
78 | |
79 | # cleanup the rest, keep only libs |
80 | zapmost ${BINDIR} /usr/$(mlibdir) $([[ $(mlibdir) != lib ]] && echo "/usr/lib") || die |
81 | } |
82 | |
83 | delete_dev_package_libs() |
84 | { |
85 | local libs="$@" |
86 | local i |
87 | |
88 | # cleanup, the solibs are provided by the non-dev package |
89 | for i in ${libs} |
90 | do |
91 | # run cleanup only if the directories exists, which fixes empy libvtv issues |
92 | if [[ -d ${BINDIR}/usr/$(mlibdir) ]] |
93 | then |
94 | rm ${BINDIR}/usr/$(mlibdir)/${i} || die |
95 | fi |
96 | # multilib as well |
97 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] |
98 | then |
99 | rm ${BINDIR}/usr/lib/${i} || die |
100 | fi |
101 | done |
102 | } |