2 package org
.de
.metux
.unitool
.db
;
4 import org
.de
.metux
.unitool
.base
.*;
5 import org
.de
.metux
.unitool
.db
.*;
6 import org
.de
.metux
.util
.*;
8 // FIXME: move this to sub-package
9 public class StoreLibtool
11 private static String
_fixstr(String str
)
19 private static String
_fixstr(String
[] str
)
25 for (int x
=0; x
<str
.length
; x
++)
35 public static void store(ObjectInfo inf
, String lo_file
)
38 "# "+lo_file
+" - a libtool object file\n"+
39 "# Generated by ltmain.sh - GNU libtool 1.5.0a\n"+
41 "# Well, in fact it is generated by unitool's libtool emulation\n"+
43 "# Name of the PIC object\n"+
44 "pic_object='"+inf
.object_pic
+"'\n"+
46 "# Name of the non-PIC object\n"+
47 "non_pic_object='"+inf
.object_nonpic
+"'\n"+
50 StoreFile
.store(lo_file
,text
);
53 public static void store(ObjectInfo inf
)
55 store(inf
,inf
.lo_file
);
58 public static void store(LibraryInfo inf
, String la_file
)
60 String fn_short
= PathNormalizer
.basename(la_file
);
62 // compute dependencies
65 if (inf
.dependency_names
!=null)
66 for (int x
=0; x
<inf
.dependency_names
.length
; x
++)
67 depnames
+= " "+inf
.dependency_names
[x
];
70 "# "+fn_short
+" - a libbtool library file\n"+
71 "# Generated by ltmain.sh - GNU libtool 1.5.0a\n"+
73 "# Well, in fact generated by unitool \n"+
76 "# The name that we can dlopen(3).\n"+
77 "dlname='"+_fixstr(inf
.dlname
)+"'\n"+
79 "# Names of this library.\n"+
80 "library_names='"+_fixstr(inf
.dynamic_libnames
)+"'\n"+
82 "# The name of the static archive.\n"+
83 "old_library='"+_fixstr(inf
.arname
)+"'\n"+
85 "dependency_libs='"+depnames
+"'\n"+
87 "# Version information for "+inf
.name
+".\n"+
88 "current="+inf
.version_current
+"\n"+
89 "age="+inf
.version_age
+"\n"+
90 "revision="+inf
.version_revision
+"\n"+
92 "release='"+_fixstr(inf
.release
)+"'\n"+
94 "# Is this an already installed library ?\n"+
95 "installed="+(inf
.installed ?
"yes" : "no")+"\n"+
97 "# Files to dlopen/dlpreopen\n"+
98 "dlopen='"+_fixstr(inf
.param_dlopen
)+"'\n"+
99 "dlpreopen='"+_fixstr(inf
.param_dlpreopen
)+"'\n"+
101 "# Directory that library needs to be installed in\n"+
102 "libdir='"+_fixstr(inf
.libdir
)+"'\n"+
105 StoreFile
.store(la_file
, text
);