Magellan Linux

Contents of /trunk/include/gcc-toolchain.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32910 - (show annotations) (download)
Tue Jul 23 22:30:24 2019 UTC (5 years, 3 months ago) by niro
File size: 1906 byte(s)
-added uninstall_gcc_library() function
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 # cleanup, only keep the libs, everything else get provided by the dev-package
68 zapmost ${BINDIR}/usr/$(mlibdir) "${libs}" || die
69 # multilib as well
70 if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]]
71 then
72 zapmost ${BINDIR}/usr/lib "${libs}" || die
73 fi
74
75 # cleanup the rest, keep only libs
76 zapmost ${BINDIR} /usr/$(mlibdir) $([[ $(mlibdir) != lib ]] && echo "/usr/lib") || die
77 }
78
79 delete_dev_package_libs()
80 {
81 local libs="$@"
82 local i
83
84 # cleanup, the solibs are provided by the non-dev package
85 for i in ${libs}
86 do
87 rm ${BINDIR}/usr/$(mlibdir)/${i} || die
88 # multilib as well
89 if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]]
90 then
91 rm ${BINDIR}/usr/lib/${i} || die
92 fi
93 done
94 }