[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[openap-cvs] : openap-main/scripts mklibs,1.1.1.1,1.2
From: |
David Kimdon <address@hidden> |
Subject: |
[openap-cvs] : openap-main/scripts mklibs,1.1.1.1,1.2 |
Date: |
Wed, 31 Jul 2002 14:44:04 -0400 |
Update of /cvsroot/openap/openap-main/scripts
In directory subversions:/tmp/cvs-serv26105
Modified Files:
mklibs
Log Message:
update to Debian cvs mklibs revision 1.8
Index: mklibs
===================================================================
RCS file: /cvsroot/openap/openap-main/scripts/mklibs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- mklibs 18 Jul 2002 19:57:02 -0000 1.1.1.1
+++ mklibs 31 Jul 2002 18:44:02 -0000 1.2
@@ -5,8 +5,6 @@
# Copyright 2001 by Falk Hueffner <address@hidden>
# & Goswin Brederlow <address@hidden>
#
-# Hacked by David Kimdon to support uClibc.
-#
# mklibs.sh by Marcus Brinkmann <address@hidden>
# used as template
#
@@ -176,13 +174,18 @@
def find_pic(lib):
base_name = so_pattern.match(lib).group(1)
for path in lib_path:
- for file in glob.glob(path + "/" + base_name + "*.a"):
+ for file in glob.glob(path + "/" + base_name + "*_pic.a"):
if os.access(file, os.F_OK):
return resolve_link(file)
return ""
# Find a PIC .map file for the library
def find_pic_map(lib):
+ base_name = so_pattern.match(lib).group(1)
+ for path in lib_path:
+ for file in glob.glob(path + "/" + base_name + "*_pic.map"):
+ if os.access(file, os.F_OK):
+ return resolve_link(file)
return ""
#################### main ####################
@@ -214,7 +217,6 @@
lib_path = []
dest_path = "DEST"
ldlib = "LDLIB"
-default_lib_path = "yes"
libc_extras_dir = "/usr/lib/libc_pic"
target = ""
so_pattern = re.compile("(.*)\.so(\.\d+)*")
@@ -228,31 +230,28 @@
lib_path.extend(string.split(arg, ":"))
elif opt in ("-d", "--dest-dir"):
dest_path = arg
- elif opt in ("-D", "--no-default-lib"):
- default_lib_path = "no"
elif opt == "--ldlib":
ldlib = arg
elif opt == "--libc-extras-dir":
libc_extras_dir = arg
elif opt == "--target":
target = arg + "-"
- elif opt == "--help":
+ elif opt in ("--help", "-h"):
print "Usage: mklibs [OPTION]... -d DEST FILE ..."
print "Make a set of minimal libraries for FILE(s) in DEST."
print
print " -d, --dest-dir DIRECTORY create libraries in DIRECTORY"
print " -L DIRECTORY[:DIRECTORY]... add DIRECTORY(s) to the library
search path"
- print " --ldlib=3DLDLIB use LDLIB for the dynamic
linker"
+ print " --ldlib LDLIB use LDLIB for the dynamic linker"
print " --libc-extras-dir DIRECTORY look for libc extra files in
DIRECTORY"
+ print " --target TARGET prepend TARGET- to the gcc and
binutils calls"
print " -v, --verbose explain what is being done"
- print " --help display this help and exit"
+ print " -h, --help display this help and exit"
sys.exit(0)
else:
print "WARNING: unknown option: " + opt + "\targ: " + arg
-
-if default_lib_path == "yes":
- lib_path.extend(["/lib/", "/usr/lib/", "/usr/X11R6/lib/"])
+lib_path.extend(["/lib/", "/usr/lib/", "/usr/X11R6/lib/"])
if ldlib == "LDLIB":
ldlib = os.getenv("ldlib")
@@ -386,15 +385,15 @@
if not ldlib:
ldlib = "ld-" + re.match("libc-(.*).so",
so_file_name).group(1) + ".so"
extra_flags = find_lib(ldlib)
- extra_pre_obj = "" #libc_extras_dir + "/soinit.o"
- extra_post_obj = "" #libc_extras_dir + "/sofini.o"
+ extra_pre_obj = libc_extras_dir + "/soinit.o"
+ extra_post_obj = libc_extras_dir + "/sofini.o"
else:
extra_flags = ""
extra_pre_obj = ""
extra_post_obj = ""
map_file = find_pic_map(library)
- #if map_file:
- # extra_flags = extra_flags + " -Wl,--version-script=" +
map_file
+ if map_file:
+ extra_flags = extra_flags + " -Wl,--version-script=" + map_file
if library_symbols_used[library].elems():
joined_symbols = "-u" +
string.join(library_symbols_used[library].elems(), " -u")
else:
@@ -428,20 +427,15 @@
for lib in regexpfilter(os.listdir(dest_path), "(.*-so)$").elems():
os.remove(dest_path + "/" + lib)
-# FIXME: ld-uClibc-0.9.12.so isn't showing up for some reason unless I move
this to here
+# Canonicalize library names.
+for lib in regexpfilter(os.listdir(dest_path), "(.*so[.\d]*)$").elems():
+ soname = regexpfilter(command(target + "readelf", "--dynamic", "-W",
+ dest_path + "/" + lib),
+ ".*SONAME.*\[(.*)\].*").elems()[0]
+ debug(DEBUG_VERBOSE, "Moving %s to %s." % (lib, soname))
+ os.rename(dest_path + "/" + lib, dest_path + "/" + soname)
+
# Make the dynamic linker executable
ld_file = find_lib(ldlib)
ld_file_name = os.path.basename(ld_file)
-command(target + "objcopy", "--strip-unneeded -R .note -R .comment",
- ld_file, dest_path + "/" + ld_file_name)
os.chmod(dest_path + "/" + ld_file_name, 0755)
-
-for lib in regexpfilter(os.listdir(dest_path), "(.*so[.\d]*)$").elems():
- print soname
- print dest_path + "/" + lib
- soname = regexpfilter(command("readelf", "--all", dest_path + "/" + lib),
- ".*SONAME.*\[(.*)\].*").elems()[0]
- try:
- os.symlink(lib, dest_path + "/" + soname)
- except OSError:
- pass
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [openap-cvs] : openap-main/scripts mklibs,1.1.1.1,1.2,
David Kimdon <address@hidden> <=