summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/ccomp.ml12
-rw-r--r--utils/ccomp.mli1
2 files changed, 13 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
diff --git a/utils/ccomp.mli b/utils/ccomp.mli
index 423854014..12242aea2 100644
--- a/utils/ccomp.mli
+++ b/utils/ccomp.mli
@@ -17,3 +17,4 @@ val command: string -> int
val run_command: string -> unit
val compile_file: string -> int
val create_archive: string -> string list -> int
+val expand_libname: string -> string