summaryrefslogtreecommitdiffstats
path: root/utils/ccomp.ml
diff options
context:
space:
mode:
Diffstat (limited to 'utils/ccomp.ml')
-rw-r--r--utils/ccomp.ml12
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/ccomp.ml b/utils/ccomp.ml
index a2d30f327..70706f90a 100644
--- a/utils/ccomp.ml
+++ b/utils/ccomp.ml
@@ -49,3 +49,15 @@ let create_archive archive file_list =
if r1 <> 0 or String.length Config.ranlib = 0
then r1
else command(Config.ranlib ^ " " ^ archive)
+
+let expand_libname name =
+ if String.length name < 2 || String.sub name 0 2 <> "-l"
+ then name
+ else begin
+ let libname =
+ "lib" ^ String.sub name 2 (String.length name - 2) ^ Config.ext_lib in
+ try
+ Misc.find_in_path !Config.load_path libname
+ with Not_found ->
+ libname
+ end