1 |
george 07/12/27 08:51:48 |
2 |
|
3 |
Modified: gnatbuild.eclass |
4 |
Log: |
5 |
updated gnatbuild.eclass to support primary compilers (#151343) |
6 |
|
7 |
Revision Changes Path |
8 |
1.35 eclass/gnatbuild.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnatbuild.eclass?rev=1.35&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnatbuild.eclass?rev=1.35&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnatbuild.eclass?r1=1.34&r2=1.35 |
13 |
|
14 |
Index: gnatbuild.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/gnatbuild.eclass,v |
17 |
retrieving revision 1.34 |
18 |
retrieving revision 1.35 |
19 |
diff -u -r1.34 -r1.35 |
20 |
--- gnatbuild.eclass 10 Oct 2007 18:17:58 -0000 1.34 |
21 |
+++ gnatbuild.eclass 27 Dec 2007 08:51:47 -0000 1.35 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2006 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnatbuild.eclass,v 1.34 2007/10/10 18:17:58 george Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnatbuild.eclass,v 1.35 2007/12/27 08:51:47 george Exp $ |
27 |
# |
28 |
# Author: George Shapovalov <george@g.o> |
29 |
# Belongs to: ada herd <ada@g.o> |
30 |
@@ -17,10 +17,13 @@ |
31 |
IUSE="nls" |
32 |
# multilib is supported via profiles now, multilib usevar is deprecated |
33 |
|
34 |
-DEPEND="!dev-lang/gnat" |
35 |
+DEPEND=">=app-admin/eselect-gnat-1.3" |
36 |
RDEPEND="app-admin/eselect-gnat" |
37 |
|
38 |
-#PROVIDE="virtual/gnat" |
39 |
+# Note! |
40 |
+# It may not be safe to source this at top level. Only source inside local |
41 |
+# functions! |
42 |
+GnatCommon="/usr/share/gnat/lib/gnat-common.bash" |
43 |
|
44 |
#---->> globals and SLOT <<---- |
45 |
|
46 |
@@ -88,7 +91,8 @@ |
47 |
DATAPATH=${PREFIX}/share/${PN}-data/${CTARGET}/${SLOT} |
48 |
# ATTN! the one below should match the path defined in eselect-gnat module |
49 |
CONFIG_PATH="/usr/share/gnat/eselect" |
50 |
-gnat_config_file="${D}/${CONFIG_PATH}/${CTARGET}-${PN}-${SLOT}" |
51 |
+gnat_profile="${CTARGET}-${PN}-${SLOT}" |
52 |
+gnat_config_file="${CONFIG_PATH}/${gnat_profile}" |
53 |
|
54 |
|
55 |
# ebuild globals |
56 |
@@ -142,27 +146,27 @@ |
57 |
local abi=$2 |
58 |
local var |
59 |
|
60 |
- echo >> ${gnat_config_file} |
61 |
+ echo >> "${D}/${gnat_config_file}" |
62 |
if ! is_multilib ; then |
63 |
- echo " ctarget=${CTARGET}" >> ${gnat_config_file} |
64 |
+ echo " ctarget=${CTARGET}" >> "${D}/${gnat_config_file}" |
65 |
else |
66 |
- echo "[${abi}]" >> ${gnat_config_file} |
67 |
+ echo "[${abi}]" >> "${D}/${gnat_config_file}" |
68 |
var="CTARGET_${abi}" |
69 |
if [[ -n ${!var} ]] ; then |
70 |
- echo " ctarget=${!var}" >> ${gnat_config_file} |
71 |
+ echo " ctarget=${!var}" >> "${D}/${gnat_config_file}" |
72 |
else |
73 |
var="CHOST_${abi}" |
74 |
if [[ -n ${!var} ]] ; then |
75 |
- echo " ctarget=${!var}" >> ${gnat_config_file} |
76 |
+ echo " ctarget=${!var}" >> "${D}/${gnat_config_file}" |
77 |
else |
78 |
- echo " ctarget=${CTARGET}" >> ${gnat_config_file} |
79 |
+ echo " ctarget=${CTARGET}" >> "${D}/${gnat_config_file}" |
80 |
fi |
81 |
fi |
82 |
fi |
83 |
|
84 |
var="CFLAGS_${abi}" |
85 |
if [[ -n ${!var} ]] ; then |
86 |
- echo " cflags=${!var}" >> ${gnat_config_file} |
87 |
+ echo " cflags=${!var}" >> "${D}/${gnat_config_file}" |
88 |
fi |
89 |
} |
90 |
|
91 |
@@ -172,19 +176,17 @@ |
92 |
|
93 |
dodir ${CONFIG_PATH} |
94 |
|
95 |
- echo "[global]" > ${gnat_config_file} |
96 |
- echo " version=${CTARGET}-${SLOT}" >> ${gnat_config_file} |
97 |
- echo " binpath=${BINPATH}" >> ${gnat_config_file} |
98 |
- echo " libexecpath=${LIBEXECPATH}" >> ${gnat_config_file} |
99 |
- echo " ldpath=${LIBPATH}" >> ${gnat_config_file} |
100 |
- echo " manpath=${DATAPATH}/man" >> ${gnat_config_file} |
101 |
- echo " infopath=${DATAPATH}/info" >> ${gnat_config_file} |
102 |
-# echo " alias_cc=gcc" >> ${compiler_config_file} |
103 |
-# echo " stdcxx_incdir=${STDCXX_INCDIR##*/}" >> ${compiler_config_file} |
104 |
- echo " bin_prefix=${CTARGET}" >> ${gnat_config_file} |
105 |
+ echo "[global]" > "${D}/${gnat_config_file}" |
106 |
+ echo " version=${CTARGET}-${SLOT}" >> "${D}/${gnat_config_file}" |
107 |
+ echo " binpath=${BINPATH}" >> "${D}/${gnat_config_file}" |
108 |
+ echo " libexecpath=${LIBEXECPATH}" >> "${D}/${gnat_config_file}" |
109 |
+ echo " ldpath=${LIBPATH}" >> "${D}/${gnat_config_file}" |
110 |
+ echo " manpath=${DATAPATH}/man" >> "${D}/${gnat_config_file}" |
111 |
+ echo " infopath=${DATAPATH}/info" >> "${D}/${gnat_config_file}" |
112 |
+ echo " bin_prefix=${CTARGET}" >> "${D}/${gnat_config_file}" |
113 |
|
114 |
for abi in $(get_all_abis) ; do |
115 |
- add_profile_eselect_conf "${gnat_config_file}" "${abi}" |
116 |
+ add_profile_eselect_conf "${D}/${gnat_config_file}" "${abi}" |
117 |
done |
118 |
} |
119 |
|
120 |
@@ -277,6 +279,18 @@ |
121 |
if should_we_eselect_gnat; then |
122 |
do_gnat_config |
123 |
fi |
124 |
+ |
125 |
+ # if primary compiler list is empty, add this profile to the list, so |
126 |
+ # that users are not left without active compilers (making sure that |
127 |
+ # libs are getting built for at least one) |
128 |
+ elog "" |
129 |
+ . ${GnatCommon} || die "failed to source common code" |
130 |
+ if [[ ! -f ${PRIMELIST} ]] || [[ ! -s ${PRIMELIST} ]]; then |
131 |
+ echo "${gnat_profile}" > ${PRIMELIST} |
132 |
+ elog "The list of primary compilers was empty and got assigned ${gnat_profile}." |
133 |
+ fi |
134 |
+ elog "Please edit ${PRIMELIST} and list there gnat profiles intended" |
135 |
+ elog "for common use." |
136 |
} |
137 |
|
138 |
|
139 |
@@ -517,7 +531,7 @@ |
140 |
# Looks like we need an access to the bootstrap compiler here too |
141 |
# as gnat apparently wants to compile something during the installation |
142 |
# The spotted obuser was xgnatugn, used to process gnat_ugn_urw.texi, |
143 |
- # during prepping the documentation. |
144 |
+ # during preparison of the docs. |
145 |
export PATH="${GNATBOOT}/bin:${PATH}" |
146 |
GNATLIB="${GNATBOOT}/lib/gnatgcc/${BOOT_TARGET}/${BOOT_SLOT}" |
147 |
|
148 |
@@ -545,13 +559,6 @@ |
149 |
|
150 |
cd "${GNATBUILD}" |
151 |
make DESTDIR=${D} install || die |
152 |
-# # The install itself. Straight make DESTDIR=${D} install causes access |
153 |
-# # violation (unlink of gprmake). A siple workaround for now. |
154 |
-# cd "${GNATBUILD}" |
155 |
-# make DESTDIR=${D} bindir="${D}${BINPATH}" install || die |
156 |
-# mv "${D}${D}${PREFIX}/${CTARGET}" "${D}${PREFIX}" \ |
157 |
-# || die "please post the fialed mv line to #178140" |
158 |
-# rm -rf "${D}var" |
159 |
|
160 |
#make a convenience info link |
161 |
dosym ${DATAPATH}/info/gnat_ugn_unw.info ${DATAPATH}/info/gnat.info |
162 |
|
163 |
|
164 |
|
165 |
-- |
166 |
gentoo-commits@g.o mailing list |