17
17
defaultflags = "-O3 -g -fasynchronous-unwind-tables -mtune=generic -march=%s" % arch
18
18
if get .buildTYPE () == "emul32" : defaultflags += " -m32"
19
19
# this is getting ridiculous, also gdb3 breaks resulting binary
20
- #sysflags = get.CFLAGS().replace("-fstack-protector", "").replace("-D_FORTIFY_SOURCE=2", "").replace("-funwind-tables", "").replace("-fasynchronous-unwind-tables", "")
21
20
#sysflags = "-mtune=generic -march=x86-64" if get.ARCH() == "x86_64" else "-mtune=generic -march=i686"
22
21
23
22
### helper functions ###
@@ -30,6 +29,9 @@ def removePisiLinuxSection(_dir):
30
29
i = os .path .join (root , name )
31
30
shelltools .system ('objcopy -R ".comment.PISILINUX.OPTs" -R ".note.gnu.build-id" %s' % i )
32
31
32
+ ldconf32bit = """/lib32
33
+ /usr/lib32
34
+ """
33
35
34
36
def setup ():
35
37
shelltools .export ("LANGUAGE" ,"C" )
@@ -45,6 +47,7 @@ def setup():
45
47
shelltools .makedirs ("build" )
46
48
shelltools .cd ("build" )
47
49
options = "--prefix=/usr \
50
+ --libdir=/usr/lib \
48
51
--mandir=/usr/share/man \
49
52
--infodir=/usr/share/info \
50
53
--libexecdir=/usr/lib/misc \
@@ -62,6 +65,7 @@ def setup():
62
65
--with-tls"
63
66
if get .buildTYPE () == "emul32" :
64
67
options += "\
68
+ --libdir=/usr/lib32 \
65
69
--enable-multi-arch i686-pc-linux-gnu \
66
70
"
67
71
@@ -76,7 +80,7 @@ def build():
76
80
shelltools .echo ("configparms" , "bindir=/tmp32" )
77
81
shelltools .echo ("configparms" , "sbindir=/tmp32" )
78
82
shelltools .echo ("configparms" , "rootsbindir=/tmp32" )
79
- shelltools .echo ("configparms" , "datarootdir=/tmp32" )
83
+ shelltools .echo ("configparms" , "datarootdir=/tmp32/share " )
80
84
81
85
autotools .make ()
82
86
@@ -90,69 +94,41 @@ def build():
90
94
91
95
autotools .make ()
92
96
97
+ def check ():
98
+ shelltools .cd ("build" )
99
+ autotools .make ("check || true" )
100
+
101
+
93
102
def install ():
94
103
shelltools .cd ("build" )
95
104
96
105
autotools .rawInstall ("install_root=%s" % get .installDIR ())
97
- if get .buildTYPE () == "emul32" :
98
- pisitools .removeDir ("/tmp32" )
99
-
100
- # Remove our options section from crt stuff
101
- #removePisiLinuxSection("%s/usr/%s/" % (get.installDIR(), cfg["libdir"]))
102
-
103
-
104
- ### real actions start here ###
105
- #def setup():
106
- #if multibuild:
107
- #libcSetup(config["multiarch"])
108
106
109
- #libcSetup(config["system"] )
107
+ pisitools . dodir ( "/etc/ld.so.conf.d" )
110
108
109
+ if get .buildTYPE () != "emul32" :
110
+ #Install locales once.
111
+ autotools .rawInstall ("install_root=%s localedata/install-locales" % get .installDIR ())
111
112
112
- #def build():
113
- #if multibuild:
114
- #libcBuild(config["multiarch"])
113
+ # Remove our options section from crt stuff
114
+ removePisiLinuxSection ("%s/usr/lib/" % get .installDIR ())
115
115
116
- #libcBuild(config["system"])
117
-
118
-
119
- # FIXME: yes fix me
120
- #def check():
121
- # set_variables(cfg)
122
- # shelltools.chmod("scripts/begin-end-check.pl")
123
- #
124
- # shelltools.cd("build")
125
- #
126
- # shelltools.export("TIMEOUTFACTOR", "16")
127
- # autotools.make("-k check 2>error.log")
128
116
117
+ if get .buildTYPE () == "emul32" :
118
+ pisitools .dosym ("/lib32/ld-linux.so.2" , "/lib/ld-linux.so.2" )
129
119
130
- #def install():
131
- ## we do second arch first, to allow first arch to overwrite headers, etc.
132
- ## stubs-32.h, elf.h, vm86.h comes only with 32bit
133
- #if multibuild:
134
- #libcInstall(config["multiarch"])
135
- ##pisitools.dosym("../lib32/ld-linux.so.2", "/lib/ld-linux.so.2")
136
- ## FIXME: these should be added as additional file, when we can define pkg per arch
137
- #pisitools.dodir("/etc/ld.so.conf.d")
138
- #shelltools.echo("%s/etc/ld.so.conf.d/60-glibc-32bit.conf" % get.installDIR(), ldconf32bit)
120
+ shelltools .echo ("%s/etc/ld.so.conf.d/60-glibc-32bit.conf" % get .installDIR (), ldconf32bit )
139
121
140
- #libcInstall(config["system"])
122
+ # Remove our options section from crt stuff
123
+ removePisiLinuxSection ("%s/usr/lib32/" % get .installDIR ())
141
124
142
- ## localedata can be shared between archs
143
- #shelltools.cd(config["system"]["builddir"])
144
- #autotools.rawInstall("install_root=%s localedata/install-locales" % get.installDIR())
125
+ pisitools .removeDir ("/tmp32" )
145
126
146
- ## now we do generic stuff
147
- #shelltools.cd(pkgworkdir)
148
127
149
128
# We'll take care of the cache ourselves
150
129
if shelltools .isFile ("%s/etc/ld.so.cache" % get .installDIR ()):
151
130
pisitools .remove ("/etc/ld.so.cache" )
152
131
153
- # It previously has 0755 perms which was killing things
154
- #shelltools.chmod("%s/usr/%s/misc/pt_chown" % (get.installDIR(), config["system"]["libdir"]), 04711)
155
-
156
132
# Prevent overwriting of the /etc/localtime symlink
157
133
if shelltools .isFile ("%s/etc/localtime" % get .installDIR ()):
158
134
pisitools .remove ("/etc/localtime" )
@@ -171,5 +147,6 @@ def install():
171
147
#if shelltools.isFile("%s/usr/sbin/%s" % (get.installDIR(), i)):
172
148
#pisitools.remove("/usr/sbin/%s" % i)
173
149
174
- #pisitools.dodoc("BUGS", "ChangeLog*", "CONFORMANCE", "NAMESPACE", "NEWS", "PROJECTS", "README*", "LICENSES")
150
+ shelltools .cd (".." )
151
+ pisitools .dodoc ("BUGS" , "ChangeLog*" , "CONFORMANCE" , "NAMESPACE" , "NEWS" , "PROJECTS" , "README*" , "LICENSES" )
175
152
0 commit comments