|
@@ -3,7 +3,6 @@
|
|
|
|
|
|
|
|
import sys, os, string, subprocess, shutil, fileinput, multiprocessing, re, resource
|
|
import sys, os, string, subprocess, shutil, fileinput, multiprocessing, re, resource
|
|
|
|
|
|
|
|
-
|
|
|
|
|
def replaceAll(fd,searchExp,replaceExp):
|
|
def replaceAll(fd,searchExp,replaceExp):
|
|
|
for line in fileinput.input(fd, inplace=1):
|
|
for line in fileinput.input(fd, inplace=1):
|
|
|
if searchExp in line:
|
|
if searchExp in line:
|
|
@@ -29,7 +28,6 @@ glibcParent = "" # glibc parent directory
|
|
|
glibcDir = "" # glibc dir (ex. glibc-2.19)
|
|
glibcDir = "" # glibc dir (ex. glibc-2.19)
|
|
|
buildDir = "glibc-build"
|
|
buildDir = "glibc-build"
|
|
|
installDir = os.path.dirname(home) + '/Runtime/'
|
|
installDir = os.path.dirname(home) + '/Runtime/'
|
|
|
-do_install = False
|
|
|
|
|
commandStr = ""
|
|
commandStr = ""
|
|
|
commandOutput = ""
|
|
commandOutput = ""
|
|
|
quiet = False
|
|
quiet = False
|
|
@@ -40,15 +38,13 @@ for arg in sys.argv[1:]:
|
|
|
quiet = True
|
|
quiet = True
|
|
|
if arg == '--debug':
|
|
if arg == '--debug':
|
|
|
debug_flags = "-g"
|
|
debug_flags = "-g"
|
|
|
- if arg == 'install':
|
|
|
|
|
- do_install = True
|
|
|
|
|
|
|
+
|
|
|
|
|
+if True:
|
|
|
|
|
|
|
|
#########################################
|
|
#########################################
|
|
|
#### get the locations of directories ###
|
|
#### get the locations of directories ###
|
|
|
#########################################
|
|
#########################################
|
|
|
|
|
|
|
|
-if not do_install:
|
|
|
|
|
-
|
|
|
|
|
if not quiet:
|
|
if not quiet:
|
|
|
iput = raw_input('use {0} as the source of GNU libc? ([y]/n):'.format(glibc)).lower()
|
|
iput = raw_input('use {0} as the source of GNU libc? ([y]/n):'.format(glibc)).lower()
|
|
|
if not iput == 'y' and not iput == '' :
|
|
if not iput == 'y' and not iput == '' :
|
|
@@ -71,6 +67,7 @@ if not do_install:
|
|
|
|
|
|
|
|
buildDir = os.path.abspath(buildDir)
|
|
buildDir = os.path.abspath(buildDir)
|
|
|
print 'using build dir: {0}'.format(buildDir)
|
|
print 'using build dir: {0}'.format(buildDir)
|
|
|
|
|
+
|
|
|
if os.path.isdir(buildDir) :
|
|
if os.path.isdir(buildDir) :
|
|
|
if not quiet:
|
|
if not quiet:
|
|
|
clean = raw_input('clean build (delete {0}, rerun configure, etc.)? ([y]/n): '.format(buildDir))
|
|
clean = raw_input('clean build (delete {0}, rerun configure, etc.)? ([y]/n): '.format(buildDir))
|
|
@@ -86,23 +83,21 @@ if not do_install:
|
|
|
else :
|
|
else :
|
|
|
os.makedirs(buildDir)
|
|
os.makedirs(buildDir)
|
|
|
|
|
|
|
|
-if do_install and not quiet:
|
|
|
|
|
-
|
|
|
|
|
- iput = raw_input('use {0} as the directory to install glibc in? ([y]/n): '.format(installDir)).lower()
|
|
|
|
|
- if not iput == 'y' and not iput == '':
|
|
|
|
|
- installDir = raw_input('the directory to install glibc in: ')
|
|
|
|
|
|
|
+ if not quiet:
|
|
|
|
|
+ iput = raw_input('use {0} as the directory to install glibc in? ([y]/n): '.format(installDir)).lower()
|
|
|
|
|
+ if not iput == 'y' and not iput == '':
|
|
|
|
|
+ installDir = raw_input('the directory to install glibc in: ')
|
|
|
|
|
|
|
|
installDir = os.path.abspath(installDir)
|
|
installDir = os.path.abspath(installDir)
|
|
|
print 'using install dir: {0}'.format(installDir)
|
|
print 'using install dir: {0}'.format(installDir)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+if True:
|
|
|
|
|
|
|
|
################################
|
|
################################
|
|
|
#### doctor glibc's Makefile ###
|
|
#### doctor glibc's Makefile ###
|
|
|
################################
|
|
################################
|
|
|
|
|
|
|
|
-if not do_install:
|
|
|
|
|
-
|
|
|
|
|
os.chdir(buildDir)
|
|
os.chdir(buildDir)
|
|
|
|
|
|
|
|
cflags = '{0} -O2 -U_FORTIFY_SOURCE -fno-stack-protector'.format(debug_flags)
|
|
cflags = '{0} -O2 -U_FORTIFY_SOURCE -fno-stack-protector'.format(debug_flags)
|
|
@@ -138,20 +133,11 @@ link_binaries = [ ( 'elf', 'ld-linux-x86-64.so.2' ),
|
|
|
( 'rt', 'librt.so.1' ),
|
|
( 'rt', 'librt.so.1' ),
|
|
|
( 'libos', 'liblibos.so.1' ) ]
|
|
( 'libos', 'liblibos.so.1' ) ]
|
|
|
|
|
|
|
|
-if not do_install:
|
|
|
|
|
|
|
+if True:
|
|
|
|
|
|
|
|
for (dir, bin) in link_binaries:
|
|
for (dir, bin) in link_binaries:
|
|
|
- if dir != '':
|
|
|
|
|
- print bin + ' -> ' + dir + '/' + bin
|
|
|
|
|
- os.symlink(dir + '/' + bin, bin)
|
|
|
|
|
-
|
|
|
|
|
- print '\n\n\nNow type \'make\' in \'{0}\'\n\n'.format(buildDir)
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if os.path.lexists(installDir + '/' + bin):
|
|
|
|
|
+ continue
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-if do_install:
|
|
|
|
|
-
|
|
|
|
|
- for (dir, bin) in link_binaries:
|
|
|
|
|
print installDir + '/' + bin + ' -> ' + buildDir + '/' + dir + '/' + bin
|
|
print installDir + '/' + bin + ' -> ' + buildDir + '/' + dir + '/' + bin
|
|
|
- if not os.path.lexists(installDir + '/' + bin):
|
|
|
|
|
- os.symlink(os.path.relpath(buildDir + '/' + dir + '/' + bin, installDir), installDir + '/' + bin)
|
|
|
|
|
|
|
+ os.symlink(os.path.relpath(buildDir + '/' + dir + '/' + bin, installDir), installDir + '/' + bin)
|