Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ coldstart: boot/ocamlrun$(EXE) runtime/libcamlrun.$(A)
$(MAKE) -C stdlib OCAMLRUN='$$(ROOTDIR)/$<' USE_BOOT_OCAMLC=true all
rm -f $(addprefix boot/, libcamlrun.$(A) $(LIBFILES))
cp $(addprefix stdlib/, $(LIBFILES)) boot
cd boot; $(LN) ../runtime/libcamlrun.$(A) .
cd boot && $(LN_S) ../runtime/libcamlrun.$(A) .

# Recompile the core system using the bootstrap compiler
.PHONY: coreall
Expand Down Expand Up @@ -911,7 +911,7 @@ flexlink.opt$(EXE): \
flexlink.exe
cp $(FLEXDLL_SOURCE_DIR)/flexlink.exe $@
rm -f $(OPT_BINDIR)/flexlink$(EXE)
cd $(OPT_BINDIR); $(LN) $(call ROOT_FROM, $(OPT_BINDIR))/$@ flexlink$(EXE)
cd $(OPT_BINDIR) && $(LN_S) $(call ROOT_FROM, $(OPT_BINDIR))/$@ flexlink$(EXE)

else

Expand Down Expand Up @@ -1102,7 +1102,7 @@ endif
# to add otherlibs/dynlink/native to the search path as well

otherlibs/dynlink/dynlink.cmx : otherlibs/dynlink/native/dynlink.cmx
cd otherlibs/dynlink; $(LN) native/dynlink.cmx .
cd otherlibs/dynlink && $(LN_S) native/dynlink.cmx .

DYNLINK_DEPEND_DUMMY_FILES = \
otherlibs/dynlink/dynlink.ml \
Expand Down Expand Up @@ -1147,28 +1147,28 @@ beforedepend:: lambda/runtimedef.ml
# Choose the right machine-dependent files

asmcomp/arch.mli: asmcomp/$(ARCH)/arch.mli
@cd asmcomp; $(LN) $(ARCH)/arch.mli .
@cd asmcomp && $(LN_S) $(ARCH)/arch.mli .

asmcomp/arch.ml: asmcomp/$(ARCH)/arch.ml
@cd asmcomp; $(LN) $(ARCH)/arch.ml .
@cd asmcomp && $(LN_S) $(ARCH)/arch.ml .

asmcomp/proc.ml: asmcomp/$(ARCH)/proc.ml
@cd asmcomp; $(LN) $(ARCH)/proc.ml .
@cd asmcomp && $(LN_S) $(ARCH)/proc.ml .

asmcomp/selection.ml: asmcomp/$(ARCH)/selection.ml
@cd asmcomp; $(LN) $(ARCH)/selection.ml .
@cd asmcomp && $(LN_S) $(ARCH)/selection.ml .

asmcomp/CSE.ml: asmcomp/$(ARCH)/CSE.ml
@cd asmcomp; $(LN) $(ARCH)/CSE.ml .
@cd asmcomp && $(LN_S) $(ARCH)/CSE.ml .

asmcomp/reload.ml: asmcomp/$(ARCH)/reload.ml
@cd asmcomp; $(LN) $(ARCH)/reload.ml .
@cd asmcomp && $(LN_S) $(ARCH)/reload.ml .

asmcomp/scheduling.ml: asmcomp/$(ARCH)/scheduling.ml
@cd asmcomp; $(LN) $(ARCH)/scheduling.ml .
@cd asmcomp && $(LN_S) $(ARCH)/scheduling.ml .

asmcomp/stackframe.ml: asmcomp/$(ARCH)/stackframe.ml
@cd asmcomp; $(LN) $(ARCH)/stackframe.ml .
@cd asmcomp && $(LN_S) $(ARCH)/stackframe.ml .

# Preprocess the code emitters
cvt_emit = tools/cvt_emit$(EXE)
Expand Down Expand Up @@ -1693,7 +1693,7 @@ runtime: stdlib/libcamlrun.$(A)
.PHONY: makeruntime
makeruntime: runtime-all
stdlib/libcamlrun.$(A): runtime-all
cd stdlib; $(LN) ../runtime/libcamlrun.$(A) .
cd stdlib && $(LN_S) ../runtime/libcamlrun.$(A) .
clean::
rm -f $(addprefix runtime/, *.o *.obj *.a *.lib *.so *.dll)
rm -f $(addprefix runtime/, ocamlrun ocamlrund ocamlruni ocamlruns sak)
Expand All @@ -1711,9 +1711,9 @@ runtimeopt: stdlib/libasmrun.$(A)
.PHONY: makeruntimeopt
makeruntimeopt: runtime-allopt
stdlib/libasmrun.$(A): runtime-allopt
cd stdlib; $(LN) ../runtime/libasmrun.$(A) .
cd stdlib && $(LN_S) ../runtime/libasmrun.$(A) .
stdlib/libcomprmarsh.$(A): runtime/libcomprmarsh.$(A)
cd stdlib; $(LN) ../runtime/libcomprmarsh.$(A) .
cd stdlib && $(LN_S) ../runtime/libcomprmarsh.$(A) .

clean::
rm -f stdlib/libasmrun.a stdlib/libasmrun.lib
Expand Down
2 changes: 1 addition & 1 deletion Makefile.build_config.in
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ ZINC_RUNTIME_ID_HI = @zinc_runtime_id_hi@
ZINC_RUNTIME_ID = @zinc_runtime_id_lo@$(ZINC_RUNTIME_ID_HI)

# Platform-dependent command to create symbolic links
LN = @ln@
LN_S = @LN_S@

# Tool to generate manifests for managed assemblies and unmanaged side-by-side
# assemblies, for the Windows targets.
Expand Down
8 changes: 4 additions & 4 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ INSTALL_DESPATCH_install_MKDIR = \

MK_LINK = \
(cd "$(INSTALL_SECTION_$(2))$(addprefix /,$(3))" && \
$(LN) $(call QUOTE_SINGLE,$(1)) $(call QUOTE_SINGLE,$(4)))
$(LN_S) $(call QUOTE_SINGLE,$(1)) $(call QUOTE_SINGLE,$(4)))

INSTALL_DESPATCH_install_ITEM = \
$(INSTALL_CMD_$(2)) $(1) \
Expand All @@ -243,7 +243,7 @@ INSTALL_DESPATCH_display_MKDIR = \
-> MKDIR $(INSTALL_SECTION_$(1))$(addprefix /,$(2))) $(SH_AND)

MKLINK_display = \
echo $(call QUOTE_SINGLE,-> LN \
echo $(call QUOTE_SINGLE,-> LN_S \
$(abspath $(INSTALL_SECTION_$(2))$(addprefix /,$(3))/$(1)) -> \
$(if $(4),$(4),$(notdir $(1))))

Expand Down Expand Up @@ -311,7 +311,7 @@ ADD_LINE = $(call INVOKE, echo, $(2)) >> $(1)
# These can then be munged to a cd + ln combination in the fixup script.
# If symlinks are not supported, $1 is instead used to create an additional copy
# of the file, using the .install file.
ifeq "$(firstword $(LN))" "ln"
ifeq "$(firstword $(LN_S))" "ln"
RECORD_SYMLINK_TO_INSTALL = \
$(call ADD_LINE, $(ROOTDIR)/create-symlinks, \
$(patsubst lib%,lib,$(2))$(addprefix /,$(3)) $(4) $(5))
Expand Down Expand Up @@ -402,7 +402,7 @@ INSTALL_DESPATCH_opam_BEGIN = \
# then munge clone-* and create-symlinks into the fixup script.
INSTALL_DESPATCH_opam_END = \
$(OCAMLRUN) ./ocaml$(EXE) $(STDLIBFLAGS) \
tools/opam/generate.ml $(INSTALL_MODE) $(OPAM_PACKAGE_NAME) '$(LN)'
tools/opam/generate.ml $(INSTALL_MODE) $(OPAM_PACKAGE_NAME) '$(LN_S)'

# Generate $(OPAM_PACKAGE_NAME)-clone.sh (INSTALL_MODE=clone)

Expand Down
7 changes: 6 additions & 1 deletion Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ LDFLAGS?=@LDFLAGS@
CPP=@CPP@

### How to invoke ar
ARCMD=@AR@
AR=@AR@
ARFLAGS=@ARFLAGS@

### Extension of object files
O=@OBJEXT@
Expand Down Expand Up @@ -226,6 +227,10 @@ NATIVE_RUNTIME_ID=@native_runtime_id@

# Deprecated variables

## Variables deprecated since OCaml 5.5

ARCMD=@AR@

## Variables deprecated since OCaml 5.3

OCAMLC_CFLAGS=@bytecode_cflags@
Expand Down
12 changes: 6 additions & 6 deletions Makefile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ cross-flexdll: | $(BYTE_BINDIR) $(OPT_BINDIR)
rm -f $(FLEXDLL_SOURCE_DIR)/flexlink.exe
$(MAKE) -C $(FLEXDLL_SOURCE_DIR) $(FLEXLINK_BUILD_ENV) \
NATDYNLINK=false LINKFLAGS= flexlink.exe support
$(LN) $(FLEXDLL_SOURCE_DIR)/flexlink.exe flexlink.opt.exe
$(LN) flexlink.opt.exe flexlink.byte.exe
$(LN_S) $(FLEXDLL_SOURCE_DIR)/flexlink.exe flexlink.opt.exe
$(LN_S) flexlink.opt.exe flexlink.byte.exe
cp flexlink.byte.exe $(BYTE_BINDIR)/flexlink
cd $(BYTE_BINDIR) && $(LN) flexlink flexlink.exe
cd $(BYTE_BINDIR) && $(LN_S) flexlink flexlink.exe
cp $(addprefix $(FLEXDLL_SOURCE_DIR)/, $(FLEXDLL_OBJECTS)) $(ROOTDIR)
cp flexlink.opt.exe $(OPT_BINDIR)/flexlink
cd $(OPT_BINDIR) && $(LN) flexlink flexlink.exe
cd $(OPT_BINDIR) && $(LN_S) flexlink flexlink.exe

INSTALL_OVERRIDES=build_ocamldoc=false WITH_DEBUGGER= OCAMLRUN=ocamlrun

Expand All @@ -116,7 +116,7 @@ installcross:
$(addprefix toplevel/, \
$(foreach ext,cmi cmt cmti cmx, native/nat__dummy__.$(ext)) \
all__dummy__.cmx topstart.o native/tophooks.cmi)
$(LN) `command -v ocamllex` lex/ocamllex.opt$(EXE)
$(LN) `command -v ocamlyacc` yacc/ocamlyacc.opt$(EXE)
cd lex && $(LN_S) `command -v ocamllex` ocamllex.opt$(EXE)
cd yacc && $(LN_S) `command -v ocamlyacc` ocamlyacc.opt$(EXE)
# Real installation
$(MAKE) install $(INSTALL_OVERRIDES)
4 changes: 2 additions & 2 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ AC_DEFUN([OCAML_CHECK_LN_ON_WINDOWS], [
AS_IF([m4_normalize(MSYS=winsymlinks:nativestrict
CYGWIN=winsymlinks:nativestrict
ln -sf configure conftestLink 2>/dev/null)],
[ln='ln -sf'],
[ln='cp -pf']
[LN_S='ln -sf'],
[LN_S='cp -pRf']
)
AC_MSG_RESULT([$ln])
])
Expand Down
22 changes: 15 additions & 7 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ AC_SUBST([oc_native_cppflags])
AC_SUBST([systhread_support])
AC_SUBST([ocamlsrcdir])
AC_SUBST([unix_or_win32])
AC_SUBST([ln])
AC_SUBST([LN_S])
AC_SUBST([ocamlyacc_wstr_module])
AC_SUBST([outputexe])
AC_SUBST([outputobj])
Expand Down Expand Up @@ -198,6 +198,7 @@ AC_SUBST([shebangscripts])
AC_SUBST([launch_method])
AC_SUBST([launch_method_target])
AC_SUBST([AR])
AC_SUBST([ARFLAGS])
AC_SUBST([mklib])
AC_SUBST([supports_shared_libraries])
AC_SUBST([natdynlink])
Expand Down Expand Up @@ -461,6 +462,8 @@ AS_CASE([$target],

# Environment variables that are taken into account

AC_ARG_VAR([AR], [Archive-maintaining program])
AC_ARG_VAR([ARFLAGS], [Flags to give the archive-maintaining program])
AC_ARG_VAR([AS], [which assembler to use])
AC_ARG_VAR([ASPP], [which assembler (with preprocessor) to use])
AC_ARG_VAR([PARTIALLD], [how to build partial (relocatable) object files])
Expand Down Expand Up @@ -881,7 +884,7 @@ AS_CASE([$target],
# In config/Makefile.mingw*, we had:
# TARGET=i686-w64-mingw32 and x86_64-w64-mingw32
# TOOLPREF=$(TARGET)-
# ARCMD=$(TOOLPREF)ar
# AR=$(TOOLPREF)ar
# However autoconf and libtool seem to use ar
# So we let them do, at the moment
[*-pc-windows],
Expand All @@ -895,7 +898,8 @@ AS_CASE([$target],
mklib="link -lib -nologo $machine /out:\$(1) \$(2)"
],
[
mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2)"
: ${ARFLAGS:=rc}
mklib="rm -f \$(1) && ${AR} ${ARFLAGS} \$(1) \$(2)"
])

## In cross-compilation mode, can we run executables produced?
Expand Down Expand Up @@ -945,7 +949,7 @@ AS_CASE([$cygwin_build_env,$host],
[true,*-w64-mingw32*|true,*-pc-windows],
[OCAML_CHECK_LN_ON_WINDOWS
ocamlsrcdir="$(LC_ALL=C.UTF-8 cygpath -w -- "$srcdir_abs")"],
[ln='ln -sf'
[LN_S='ln -sf'
ocamlsrcdir="$srcdir_abs"])

# Whether ar supports @FILE arguments
Expand Down
4 changes: 2 additions & 2 deletions testsuite/in_prefix/Makefile.test
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ endif

test-in-prefix: $(DRIVER) ../tools/main_in_c.$(O) ../tools/poisonedruntime$(EXE)
@rm -f ocamlrun*
@$(LN) $(ROOTDIR)/runtime/ocamlrun$(EXE) test-$(RUNTIME_NAME)
@$(LN_S) $(ROOTDIR)/runtime/ocamlrun$(EXE) test-$(RUNTIME_NAME)
@$(MKDIR) poisoned-runtime
@cd poisoned-runtime \
&& $(LN) ../../tools/poisonedruntime$(EXE) $(RUNTIME_NAME)
&& $(LN_S) ../../tools/poisonedruntime$(EXE) $(RUNTIME_NAME)
@$< $(DRIVER_ARGS)
@rm -rf poisoned-runtime
@rm -f test-ocamlrun*
Expand Down
2 changes: 1 addition & 1 deletion tools/opam/generate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Parameters are the following Makefile variables:
$1 = $(INSTALL_MODE) (opam or clone)
$2 = $(OPAM_PACKAGE_NAME)
$3 = $(LN) *)
$3 = $(LN_S) *)

let exit_because fmt = Printf.ksprintf (fun s -> prerr_endline s; exit 1) fmt

Expand Down
Loading