summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2012-01-16 09:05:37 +0000
committerAlain Frisch <alain@frisch.fr>2012-01-16 09:05:37 +0000
commitbfb35c4fce698c2dacbe5eab2f2a7086cff79b3c (patch)
treeb80eb1438d915b37e06d230d6a7e8d047b17e0a9
parentee95e9fd9125c4b8dcff20be96dab9e5ba509ebb (diff)
downloadocaml-bfb35c4fce698c2dacbe5eab2f2a7086cff79b3c.tar.gz
#5478: makes it possible to specify a custom 'ar' command.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12027 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--Makefile1
-rw-r--r--Makefile.nt1
-rw-r--r--config/Makefile-templ3
-rw-r--r--config/Makefile.mingw3
-rw-r--r--config/Makefile.mingw643
-rw-r--r--config/Makefile.msvc3
-rw-r--r--config/Makefile.msvc64120
-rwxr-xr-xconfigure3
-rw-r--r--myocamlbuild_config.mli1
-rw-r--r--utils/ccomp.ml5
-rw-r--r--utils/config.mlbuild1
-rw-r--r--utils/config.mli2
-rw-r--r--utils/config.mlp1
13 files changed, 145 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a8f442e520..6cde4d5b45 100644
--- a/Makefile
+++ b/Makefile
@@ -383,6 +383,7 @@ utils/config.ml: utils/config.mlp config/Makefile
-e 's|%%BYTECCLIBS%%|$(BYTECCLIBS)|' \
-e 's|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|' \
-e 's|%%RANLIBCMD%%|$(RANLIBCMD)|' \
+ -e 's|%%ARCMD%%|$(ARCMD)|' \
-e 's|%%CC_PROFILE%%|$(CC_PROFILE)|' \
-e 's|%%ARCH%%|$(ARCH)|' \
-e 's|%%MODEL%%|$(MODEL)|' \
diff --git a/Makefile.nt b/Makefile.nt
index 69b8d6a4d6..a7d6aedb9c 100644
--- a/Makefile.nt
+++ b/Makefile.nt
@@ -323,6 +323,7 @@ utils/config.ml: utils/config.mlp config/Makefile
-e "s|%%BYTECCLIBS%%|$(BYTECCLIBS)|" \
-e "s|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|" \
-e 's|%%RANLIBCMD%%|$(RANLIBCMD)|' \
+ -e 's|%%ARCMD%%|$(ARCMD)|' \
-e 's|%%BINUTILS_NM%%|$(BINUTILS_NM)|' \
-e 's|%%BINUTILS_OBJCOPY%%|$(BINUTILS_OBJCOPY)|' \
-e "s|%%ARCH%%|$(ARCH)|" \
diff --git a/config/Makefile-templ b/config/Makefile-templ
index fc8b9a0259..626d30e842 100644
--- a/config/Makefile-templ
+++ b/config/Makefile-templ
@@ -86,6 +86,9 @@ RANLIBCMD=ranlib
#RANLIB=ar rs
#RANLIBCMD=
+### How to invoke ar
+#ARCMD=ar
+
### Shared library support
# Extension for shared libraries: so if supported, a if not supported
#SO=so
diff --git a/config/Makefile.mingw b/config/Makefile.mingw
index e3b794d80f..0aea48ceb7 100644
--- a/config/Makefile.mingw
+++ b/config/Makefile.mingw
@@ -120,6 +120,9 @@ SYSLIB=-l$(1)
RANLIB=$(TOOLPREF)ranlib
RANLIBCMD=$(TOOLPREF)ranlib
+### The ar command
+ARCMD=$(TOOLPREF)ar
+
############# Configuration for the native-code compiler
### Name of architecture for the native-code compiler
diff --git a/config/Makefile.mingw64 b/config/Makefile.mingw64
index d88a03e158..d4a0564114 100644
--- a/config/Makefile.mingw64
+++ b/config/Makefile.mingw64
@@ -120,6 +120,9 @@ SYSLIB=-l$(1)
RANLIB=$(TOOLPREF)ranlib
RANLIBCMD=$(TOOLPREF)ranlib
+### The ar command
+ARCMD=$(TOOLPREF)ar
+
############# Configuration for the native-code compiler
### Name of architecture for the native-code compiler
diff --git a/config/Makefile.msvc b/config/Makefile.msvc
index 0f6eb4cc9f..592aff8874 100644
--- a/config/Makefile.msvc
+++ b/config/Makefile.msvc
@@ -115,6 +115,9 @@ SYSLIB=$(1).lib
RANLIB=echo
RANLIBCMD=
+### The ar command
+ARCMD=
+
############# Configuration for the native-code compiler
### Name of architecture for the native-code compiler
diff --git a/config/Makefile.msvc64 b/config/Makefile.msvc64
index 64e09d1f76..6457556cd9 100644
--- a/config/Makefile.msvc64
+++ b/config/Makefile.msvc64
@@ -120,6 +120,126 @@ SYSLIB=$(1).lib
RANLIB=echo
RANLIBCMD=
+#########################################################################
+# #
+# OCaml #
+# #
+# Xavier Leroy, projet Cristal, INRIA Rocquencourt #
+# #
+# Copyright 1999 Institut National de Recherche en Informatique et #
+# en Automatique. All rights reserved. This file is distributed #
+# under the terms of the GNU Library General Public License, with #
+# the special exception on linking described in file ../LICENSE. #
+# #
+#########################################################################
+
+# $Id$
+
+# Configuration for Windows, Visual C++ compiler
+
+######### General configuration
+
+PREFIX=C:/ocamlms
+
+### Where to install the binaries.
+BINDIR=$(PREFIX)/bin
+
+### Where to install the standard library
+LIBDIR=$(PREFIX)/lib
+
+### Where to install the stub DLLs
+STUBLIBDIR=$(LIBDIR)/stublibs
+
+### Where to install the info files
+DISTRIB=$(PREFIX)
+
+### Where to install the man pages
+MANDIR=$(PREFIX)/man
+
+########## Toolchain and OS dependencies
+
+TOOLCHAIN=msvc
+CCOMPTYPE=msvc
+O=obj
+A=lib
+S=asm
+SO=s.obj
+DO=d.obj
+EXE=.exe
+EXT_DLL=.dll
+EXT_OBJ=.$(O)
+EXT_LIB=.$(A)
+EXT_ASM=.$(S)
+MANEXT=1
+SHARPBANGSCRIPTS=false
+PTHREAD_LINK=
+X11_INCLUDES=
+X11_LINK=
+DBM_INCLUDES=
+DBM_LINK=
+BYTECCRPATH=
+SUPPORTS_SHARED_LIBRARIES=true
+SHAREDCCCOMPOPTS=
+NATIVECCPROFOPTS=
+NATIVECCRPATH=
+ASM=ml /nologo /coff /Cp /c /Fo
+ASPP=
+ASPPPROFFLAGS=
+PROFILING=noprof
+DYNLINKOPTS=
+DEBUGGER=ocamldebugger
+CC_PROFILE=
+SYSTHREAD_SUPPORT=true
+EXTRALIBS=
+CMXS=cmxs
+NATDYNLINK=true
+RUNTIMED=noruntimed
+
+########## Configuration for the bytecode compiler
+
+### Which C compiler to use for the bytecode interpreter.
+BYTECC=cl /nologo -D_CRT_SECURE_NO_DEPRECATE
+
+### Additional compile-time options for $(BYTECC). (For static linking.)
+BYTECCCOMPOPTS=/Ox /MD
+
+### Additional link-time options for $(BYTECC). (For static linking.)
+BYTECCLINKOPTS=
+
+### Additional compile-time options for $(BYTECC). (For building a DLL.)
+DLLCCCOMPOPTS=/Ox /MD
+
+### Libraries needed
+BYTECCLIBS=advapi32.lib ws2_32.lib
+NATIVECCLIBS=advapi32.lib ws2_32.lib
+
+### How to invoke the C preprocessor
+CPP=cl /nologo /EP
+
+### Flexlink
+FLEXLINK=flexlink -merge-manifest
+FLEXDIR=$(shell $(FLEXLINK) -where)
+IFLEXDIR=-I"$(FLEXDIR)"
+MKDLL=$(FLEXLINK)
+MKEXE=$(FLEXLINK) -exe -link /STACK:16777216
+MKMAINDLL=$(FLEXLINK) -maindll
+
+### How to build a static library
+MKLIB=link /lib /nologo /out:$(1) $(2)
+#ml let mklib out files opts = Printf.sprintf "link /lib /nologo /out:%s %s %s" out opts files;;
+MKSHAREDLIBRPATH=
+
+### Canonicalize the name of a system library
+SYSLIB=$(1).lib
+#ml let syslib x = x ^ ".lib";;
+
+### The ranlib command
+RANLIB=echo
+RANLIBCMD=
+
+### The ar command
+ARCMD=
+
############# Configuration for the native-code compiler
### Name of architecture for the native-code compiler
diff --git a/configure b/configure
index 1ba6272c9e..94aed58af8 100755
--- a/configure
+++ b/configure
@@ -780,6 +780,9 @@ else
echo "RANLIBCMD=" >> Makefile
fi
+echo "ARCMD=ar" >> Makefile
+
+
# Do #! scripts work?
if (SHELL=/bin/sh; export SHELL; (./sharpbang || ./sharpbang2) >/dev/null); then
diff --git a/myocamlbuild_config.mli b/myocamlbuild_config.mli
index 3345a5701b..5eec980326 100644
--- a/myocamlbuild_config.mli
+++ b/myocamlbuild_config.mli
@@ -16,6 +16,7 @@ val libdir : string
val manext : string
val ranlib : string
val ranlibcmd : string
+val arcmd : string
val sharpbangscripts : bool
val bng_arch : string
val bng_asm_level : string
diff --git a/utils/ccomp.ml b/utils/ccomp.ml
index 881223ef9f..66525e5b9e 100644
--- a/utils/ccomp.ml
+++ b/utils/ccomp.ml
@@ -73,9 +73,10 @@ let create_archive archive file_list =
command(Printf.sprintf "link /lib /nologo /out:%s %s"
quoted_archive (quote_files file_list))
| _ ->
+ assert(String.length Config.ar > 0);
let r1 =
- command(Printf.sprintf "ar rc %s %s"
- quoted_archive (quote_files file_list)) in
+ command(Printf.sprintf "%s rc %s %s"
+ Config.ar quoted_archive (quote_files file_list)) in
if r1 <> 0 || String.length Config.ranlib = 0
then r1
else command(Config.ranlib ^ " " ^ quoted_archive)
diff --git a/utils/config.mlbuild b/utils/config.mlbuild
index 1598bee52c..367c204e7b 100644
--- a/utils/config.mlbuild
+++ b/utils/config.mlbuild
@@ -55,6 +55,7 @@ let native_c_compiler = sf "%s %s" C.nativecc C.nativecccompopts
let native_c_libraries = C.nativecclibs
let native_pack_linker = C.packld
let ranlib = C.ranlibcmd
+let ar = C.arcmd
let cc_profile = C.cc_profile
let mkdll = C.mkdll
let mkexe = C.mkexe
diff --git a/utils/config.mli b/utils/config.mli
index 897edb6da2..78fe77c6af 100644
--- a/utils/config.mli
+++ b/utils/config.mli
@@ -46,6 +46,8 @@ val mkmaindll: string
(* The linker command line to build main programs as dlls. *)
val ranlib: string
(* Command to randomize a library, or "" if not needed *)
+val ar: string
+ (* Name of the ar command, or "" if not needed (MSVC) *)
val cc_profile : string
(* The command line option to the C compiler to enable profiling. *)
diff --git a/utils/config.mlp b/utils/config.mlp
index 1883cfa520..35e56e7513 100644
--- a/utils/config.mlp
+++ b/utils/config.mlp
@@ -44,6 +44,7 @@ let native_c_compiler = "%%NATIVECC%%"
let native_c_libraries = "%%NATIVECCLIBS%%"
let native_pack_linker = "%%PACKLD%%"
let ranlib = "%%RANLIBCMD%%"
+let ar = "%%ARCMD%%"
let cc_profile = "%%CC_PROFILE%%"
let mkdll = "%%MKDLL%%"
let mkexe = "%%MKEXE%%"