···15071507$(DEPDIR)/runtime/%.npic.$(D): \
15081508 OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) $(ocamlrun_CPPFLAGS)
1509150915101510-## Compilation of runtime C files
15101510+## Compilation of C files
1511151115121512-# The COMPILE_C_FILE macro below receives as argument the pattern
15131513-# that corresponds to the name of the generated object file
15141514-# (without the extension, which is added by the macro)
15151515-define COMPILE_C_FILE
15121512+# There are two scenarios in which a C object may need to be rebuilt:
15131513+# 1. The C source file is newer than the object
15141514+# 2. A file #include'd by the C source file is newer than the object
15151515+#
15161516+# When the C source file is newer than the object, we do not have to care about
15171517+# which included files are newer, we just have to be sure that all the files
15181518+# which may be #include'd definitely exist.
15191519+#
15201520+# GCC and clang can both generate the precise dependency information
15211521+# needed for (2) as part of compiling the C file. We therefore use C dependency
15221522+# information lazily.
15231523+15241524+# All C files must depend on the _presence_ of the $(runtime_BUILT_HEADERS). If
15251525+# a C file actually uses one of these headers, then the dependency will be
15261526+# recorded in the .d file (and becomes a real dependency, not an order-only
15271527+# dependency).
15281528+runtime_MISSING_BUILT_HEADERS = \
15291529+ $(filter-out $(wildcard $(runtime_BUILT_HEADERS)), $(runtime_BUILT_HEADERS))
15301530+15311531+# COMPILE_C_FILE generates the compilation rules for C objects
15321532+# $1 = target pattern for the generated object file (without the .$(O))
15331533+# $2 = source pattern for the C source file (without the .c)
15341534+# $3 = optional; if non-empty suppresses the generation of dependency rules
15351535+define DO_COMPILE_C_FILE
15161536ifeq "$(COMPUTE_DEPS)" "true"
15171517-ifneq "$(1)" "%"
15181518-# -MG would ensure that the dependencies are generated even if the files listed
15191519-# in $$(runtime_BUILT_HEADERS) haven't been assembled yet. However,
15201520-# this goes subtly wrong if the user has the headers installed,
15211521-# as gcc will pick up a dependency on those instead and the local
15221522-# ones will not be generated. For this reason, we don't use -MG and
15231523-# instead include $(runtime_BUILT_HEADERS) in the order only dependencies
15241524-# to ensure that they exist before dependencies are computed.
15251525-$(DEPDIR)/$(1).$(D): runtime/%.c | $(DEPDIR)/runtime $(runtime_BUILT_HEADERS)
15261526- $$(V_CCDEPS)$$(DEP_CC) $$(OC_CPPFLAGS) $$(CPPFLAGS) $$< -MT \
15271527- 'runtime/$$*$(subst runtime/%,,$(1)).$(O)' -MF $$@
15281528-endif # ifneq "$(1)" "%"
15291529-$(1).$(O): $(2).c
15371537+# Secondary expansion means we can use @D to depend on the directory being
15381538+# created.
15391539+$(1).$(O): $(2).c \
15401540+ $(if $(3),,| $(DEPDIR)/$$$$(@D) $(runtime_MISSING_BUILT_HEADERS))
15301541else
15311542$(1).$(O): $(2).c \
15321543 $(runtime_CONFIGURED_HEADERS) $(runtime_BUILT_HEADERS) \
15331544 $(RUNTIME_HEADERS)
15341545endif # ifeq "$(COMPUTE_DEPS)" "true"
15351546 $$(V_CC)$$(CC) $$(OC_CFLAGS) $$(CFLAGS) $$(OC_CPPFLAGS) $$(CPPFLAGS) \
15361536- $$(OUTPUTOBJ)$$@ -c $$<
15471547+ $$(OUTPUTOBJ)$$@ \
15481548+ $(if $(3),,$(call DEP_FLAGS,$$@,$(DEPDIR)/$$(@:.$(O)=.$(D)))) \
15491549+ -c $$<
15501550+# This is skipped if either $(COMPUTE_DEPS) is false or $(3) is non-empty
15511551+ifeq "$(COMPUTE_DEPS)$(3)" "true"
15521552+# MSVC doesn't emit usable dependency information, but if GCC is available
15531553+# then it can instead be called in order to generate the .d file.
15541554+ifneq "$(CC)" "$(DEP_CC)"
15551555+ $$(V_CCDEPS)$$(DEP_CC) $(DEP_CPPFLAGS) $$(OC_CPPFLAGS) $$(CPPFLAGS) $$< \
15561556+ -MM -MT $$@ -MF $(DEPDIR)/$$(@:.$(O)=.$(D))
15571557+endif # ifneq "$(CC)" "$(DEP_CC)"
15581558+endif # ifeq "$(COMPUTE_DEPS)$(3)" "true"
15371559endef
1538156015391539-$(DEPDIR)/runtime:
15611561+# The additional call expands the optional $(3) to an empty string
15621562+COMPILE_C_FILE = \
15631563+ $(call DO_COMPILE_C_FILE,$(1),$(2),$\
15641564+ $(if $(filter-out undefined,$(origin 3)),$(3)))
15651565+15661566+.PRECIOUS: $(DEPDIR)/%
15671567+$(DEPDIR)/%:
15401568 $(MKDIR) $@
1541156915421570runtime_OBJECT_TYPES = % %.b %.bd %.bi %.bpic
···15561584$(foreach runtime_OBJECT_TYPE,$(subst %,,$(runtime_OBJECT_TYPES)), \
15571585 $(eval \
15581586 runtime/dynlink$(runtime_OBJECT_TYPE).$(O): $(ROOTDIR)/Makefile.config))
15871587+15881588+$(eval $(call COMPILE_C_FILE,yacc/%,yacc/%,no-deps))
1559158915601590## Compilation of runtime assembly files
15611591···1593162315941624## Runtime dependencies
1595162515961596-runtime_DEP_FILES := $(addsuffix .b, \
15971597- $(basename $(runtime_BYTECODE_C_SOURCES) runtime/instrtrace))
15981598-ifeq "$(NATIVE_COMPILER)" "true"
15991599-runtime_DEP_FILES += $(addsuffix .n, $(basename $(runtime_NATIVE_C_SOURCES)))
16001600-endif
16011601-runtime_DEP_FILES += $(addsuffix d, $(runtime_DEP_FILES)) \
16021602- $(addsuffix i, $(runtime_DEP_FILES)) \
16031603- $(addsuffix pic, $(runtime_DEP_FILES))
16041604-runtime_DEP_FILES := $(addsuffix .$(D), $(runtime_DEP_FILES))
16051605-16061606-ifeq "$(COMPUTE_DEPS)" "true"
16071607-include $(addprefix $(DEPDIR)/, $(runtime_DEP_FILES))
16081608-endif
16261626+RUNTIME_DEP_FILES := $(wildcard $(DEPDIR)/runtime/*.$(D))
16271627+.PHONY: $(RUNTIME_DEP_FILES)
16281628+include $(RUNTIME_DEP_FILES)
1609162916101630.PHONY: runtime
16111631runtime: stdlib/libcamlrun.$(A)
···19451965$(eval $(call COMPILE_C_FILE,ocamltest/%.b,ocamltest/%))
19461966$(eval $(call COMPILE_C_FILE,ocamltest/%.n,ocamltest/%))
1947196719481948-ifeq "$(COMPUTE_DEPS)" "true"
19491949-include $(addprefix $(DEPDIR)/, $(ocamltest_C_FILES:.c=.$(D)))
19501950-endif
19511951-19521952-ocamltest_DEP_FILES = $(addprefix $(DEPDIR)/, $(ocamltest_C_FILES:.c=.$(D)))
19531953-19541954-$(ocamltest_DEP_FILES): | $(DEPDIR)/ocamltest
19551955-19561956-$(DEPDIR)/ocamltest:
19571957- $(MKDIR) $@
19581958-19591959-$(ocamltest_DEP_FILES): $(DEPDIR)/ocamltest/%.$(D): ocamltest/%.c
19601960- $(V_CCDEPS)$(DEP_CC) $(OC_CPPFLAGS) $(CPPFLAGS) $< -MT '$*.$(O)' -MF $@
19681968+ocamltest_DEPEND_FILES := $(wildcard $(DEPDIR)/ocamltest/*.$(D))
19691969+.PHONY: $(ocamltest_DEPEND_FILES)
19701970+include $(ocamltest_DEPEND_FILES)
1961197119621972ocamltest/%: CAMLC = $(BEST_OCAMLC) $(STDLIBFLAGS)
19631973···2035204520362046testsuite/tools/poisonedruntime$(EXE): testsuite/tools/poisonedruntime.$(O)
20372047 $(V_MKEXE)$(call MKEXE_VIA_CC,$@,$^)
20482048+20492049+$(eval $(call COMPILE_C_FILE,\
20502050+ testsuite/tools/main_in_c,testsuite/tools/main_in_c,no-deps))
20512051+$(eval $(call COMPILE_C_FILE,\
20522052+ testsuite/tools/poisonedruntime,testsuite/tools/poisonedruntime,no-deps))
2038205320392054ocamltest_BYTECODE_LINKFLAGS = -custom -g
20402055···22762291endif
2277229222782293# Check that the stack limit is reasonable (Unix-only)
22942294+$(eval $(call COMPILE_C_FILE,tools/checkstack,tools/checkstack,no-deps))
22792295.PHONY: checkstack
22802296ifeq "$(UNIX_OR_WIN32)" "unix"
22812297checkstack: tools/checkstack$(EXE)
···30593075 lib, $(INSTALL_LIBDIR_COMPILERLIBS))
30603076endif
3061307730783078+.PHONY: .depend
30623079include .depend
3063308030643081# Include the cross-compiler recipes only when relevant
+7-1
Makefile.build_config.in
···7272INSTALL_OCAMLNAT = @install_ocamlnat@
73737474# The command to generate C dependency information
7575-DEP_CC=@DEP_CC@ -MM
7575+DEP_CC=@DEP_CC@
7676+DEP_CPPFLAGS=@DEP_CPPFLAGS@
7777+ifeq "@compute_deps@-$(CC)" "true-$(DEP_CC)"
7878+DEP_FLAGS = $(addprefix @DEP_CC_PREFIX@,-MMD -MT $(1) -MF $(2))
7979+else
8080+DEP_FLAGS =
8181+endif
7682COMPUTE_DEPS=@compute_deps@
77837884BUILD_PATH_LOGICAL = @srcdir_abs@
+3-6
Makefile.common
···537537538538# The rule to compile C files
539539540540-# This rule is similar to GNU make's implicit rule, except that it is more
541541-# general (it supports both .o and .obj)
540540+# Cancel GNU Make's implicit C compilation rule
541541+%.o: %.c
542542543543+# These are still here as they are shared with otherlibs/
543544ifeq "$(COMPUTE_DEPS)" "true"
544545RUNTIME_HEADERS :=
545546REQUIRED_HEADERS :=
···548549 $(wildcard $(ROOTDIR)/runtime/caml/*.h)
549550REQUIRED_HEADERS := $(RUNTIME_HEADERS) $(wildcard *.h)
550551endif
551551-552552-%.$(O): %.c $(REQUIRED_HEADERS)
553553- $(V_CC)$(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(CPPFLAGS) \
554554- $(OUTPUTOBJ)$@ -c $<
555552556553$(DEPDIR):
557554 $(MKDIR) $@
+185-170
configure
···739739CC_FOR_BUILD
740740flexlink
741741ac_ct_RC
742742-CPP
743742ac_ct_DEP_CC
744744-DEP_CC
743743+CPP
745744LT_SYS_LIBRARY_PATH
746745OTOOL64
747746OTOOL
···951950encode_C_literal
952951SAK
953952SAK_BUILD
953953+DEP_CC_PREFIX
954954+DEP_CPPFLAGS
955955+DEP_CC
954956ocaml_cc_vendor
955957CC
956958LINEAR_MAGIC_NUMBER
···34633465CMT_MAGIC_NUMBER=Caml1999T037
3464346634653467LINEAR_MAGIC_NUMBER=Caml1999L037
34683468+34693469+34703470+346634713467347234683473···1481714822esac
148181482314819148241482014820-case $host in #(
1482114821- sparc-sun-solaris*) :
1482214822- DEP_CC="false" ;; #(
1482314823- *-pc-windows) :
1482414824- if test -n "$ac_tool_prefix"; then
1482514825- for ac_prog in $DEP_CC gcc cc x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc
1482614826- do
1482714827- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1482814828-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1482914829-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1483014830-printf %s "checking for $ac_word... " >&6; }
1483114831-if test ${ac_cv_prog_DEP_CC+y}
1483214832-then :
1483314833- printf %s "(cached) " >&6
1483414834-else $as_nop
1483514835- if test -n "$DEP_CC"; then
1483614836- ac_cv_prog_DEP_CC="$DEP_CC" # Let the user override the test.
1483714837-else
1483814838-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1483914839-for as_dir in $PATH
1484014840-do
1484114841- IFS=$as_save_IFS
1484214842- case $as_dir in #(((
1484314843- '') as_dir=./ ;;
1484414844- */) ;;
1484514845- *) as_dir=$as_dir/ ;;
1484614846- esac
1484714847- for ac_exec_ext in '' $ac_executable_extensions; do
1484814848- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
1484914849- ac_cv_prog_DEP_CC="$ac_tool_prefix$ac_prog"
1485014850- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
1485114851- break 2
1485214852- fi
1485314853-done
1485414854- done
1485514855-IFS=$as_save_IFS
1485614856-1485714857-fi
1485814858-fi
1485914859-DEP_CC=$ac_cv_prog_DEP_CC
1486014860-if test -n "$DEP_CC"; then
1486114861- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DEP_CC" >&5
1486214862-printf "%s\n" "$DEP_CC" >&6; }
1486314863-else
1486414864- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
1486514865-printf "%s\n" "no" >&6; }
1486614866-fi
1486714867-1486814868-1486914869- test -n "$DEP_CC" && break
1487014870- done
1487114871-fi
1487214872-if test -z "$DEP_CC"; then
1487314873- ac_ct_DEP_CC=$DEP_CC
1487414874- for ac_prog in $DEP_CC gcc cc x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc
1487514875-do
1487614876- # Extract the first word of "$ac_prog", so it can be a program name with args.
1487714877-set dummy $ac_prog; ac_word=$2
1487814878-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1487914879-printf %s "checking for $ac_word... " >&6; }
1488014880-if test ${ac_cv_prog_ac_ct_DEP_CC+y}
1488114881-then :
1488214882- printf %s "(cached) " >&6
1488314883-else $as_nop
1488414884- if test -n "$ac_ct_DEP_CC"; then
1488514885- ac_cv_prog_ac_ct_DEP_CC="$ac_ct_DEP_CC" # Let the user override the test.
1488614886-else
1488714887-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1488814888-for as_dir in $PATH
1488914889-do
1489014890- IFS=$as_save_IFS
1489114891- case $as_dir in #(((
1489214892- '') as_dir=./ ;;
1489314893- */) ;;
1489414894- *) as_dir=$as_dir/ ;;
1489514895- esac
1489614896- for ac_exec_ext in '' $ac_executable_extensions; do
1489714897- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
1489814898- ac_cv_prog_ac_ct_DEP_CC="$ac_prog"
1489914899- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
1490014900- break 2
1490114901- fi
1490214902-done
1490314903- done
1490414904-IFS=$as_save_IFS
1490514905-1490614906-fi
1490714907-fi
1490814908-ac_ct_DEP_CC=$ac_cv_prog_ac_ct_DEP_CC
1490914909-if test -n "$ac_ct_DEP_CC"; then
1491014910- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DEP_CC" >&5
1491114911-printf "%s\n" "$ac_ct_DEP_CC" >&6; }
1491214912-else
1491314913- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
1491414914-printf "%s\n" "no" >&6; }
1491514915-fi
1491614916-1491714917-1491814918- test -n "$ac_ct_DEP_CC" && break
1491914919-done
1492014920-1492114921- if test "x$ac_ct_DEP_CC" = x; then
1492214922- DEP_CC="false"
1492314923- else
1492414924- case $cross_compiling:$ac_tool_warned in
1492514925-yes:)
1492614926-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
1492714927-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
1492814928-ac_tool_warned=yes ;;
1492914929-esac
1493014930- DEP_CC=$ac_ct_DEP_CC
1493114931- fi
1493214932-fi
1493314933- ;; #(
1493414934- *) :
1493514935- DEP_CC="$CC" ;;
1493614936-esac
1493714937-1493814938-case $enable_dependency_generation in #(
1493914939- yes) :
1494014940- if test "$DEP_CC" = "false"
1494114941-then :
1494214942- as_fn_error $? "The MSVC ports cannot generate dependency information. Install gcc (or another CC-like compiler)" "$LINENO" 5
1494314943-else $as_nop
1494414944- compute_deps=true
1494514945-fi ;; #(
1494614946- no) :
1494714947- compute_deps=false ;; #(
1494814948- *) :
1494914949- if test -e .git
1495014950-then :
1495114951- if test "$DEP_CC" = "false"
1495214952-then :
1495314953- compute_deps=false
1495414954-else $as_nop
1495514955- compute_deps=true
1495614956-fi
1495714957-else $as_nop
1495814958- compute_deps=false
1495914959-fi ;;
1496014960-esac
1496114961-1496214962-case $target in #(
1496314963- # In config/Makefile.mingw*, we had:
1496414964- # TARGET=i686-w64-mingw32 and x86_64-w64-mingw32
1496514965- # TOOLPREF=$(TARGET)-
1496614966- # ARCMD=$(TOOLPREF)ar
1496714967- # However autoconf and libtool seem to use ar
1496814968- # So we let them do, at the moment
1496914969- *-pc-windows) :
1497014970-1497114971- mkexe_via_cc_extra_cmd=' && $(call MERGEMANIFESTEXE,$(1))'
1497214972- libext=lib
1497314973- AR=""
1497414974- if test "$target_cpu" = "x86_64"
1497514975-then :
1497614976- machine="-machine:AMD64 "
1497714977-else $as_nop
1497814978- machine=""
1497914979-fi
1498014980- mklib="link -lib -nologo $machine /out:\$(1) \$(2)"
1498114981- ;; #(
1498214982- *) :
1498314983-1498414984- mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2)"
1498514985- ;;
1498614986-esac
1498714987-1498814825## Find vendor of the C compiler
1498914826ac_ext=c
1499014827ac_cpp='$CPP $CPPFLAGS'
···1517815015 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cc_vendor" >&5
1517915016printf "%s\n" "$ocaml_cc_vendor" >&6; }
15180150171501815018+1501915019+DEP_CC_PREFIX=''
1502015020+case $host in #(
1502115021+ sparc-sun-solaris*) :
1502215022+ DEP_CC="false" ;; #(
1502315023+ *-pc-windows) :
1502415024+ case $ocaml_cc_vendor in #(
1502515025+ msvc-*-clang-*) :
1502615026+ DEP_CC="$CC"
1502715027+ DEP_CC_PREFIX='/clang:' ;; #(
1502815028+ *) :
1502915029+ if test -n "$ac_tool_prefix"; then
1503015030+ for ac_prog in $DEP_CC x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc gcc cc
1503115031+ do
1503215032+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1503315033+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1503415034+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1503515035+printf %s "checking for $ac_word... " >&6; }
1503615036+if test ${ac_cv_prog_DEP_CC+y}
1503715037+then :
1503815038+ printf %s "(cached) " >&6
1503915039+else $as_nop
1504015040+ if test -n "$DEP_CC"; then
1504115041+ ac_cv_prog_DEP_CC="$DEP_CC" # Let the user override the test.
1504215042+else
1504315043+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1504415044+for as_dir in $PATH
1504515045+do
1504615046+ IFS=$as_save_IFS
1504715047+ case $as_dir in #(((
1504815048+ '') as_dir=./ ;;
1504915049+ */) ;;
1505015050+ *) as_dir=$as_dir/ ;;
1505115051+ esac
1505215052+ for ac_exec_ext in '' $ac_executable_extensions; do
1505315053+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
1505415054+ ac_cv_prog_DEP_CC="$ac_tool_prefix$ac_prog"
1505515055+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
1505615056+ break 2
1505715057+ fi
1505815058+done
1505915059+ done
1506015060+IFS=$as_save_IFS
1506115061+1506215062+fi
1506315063+fi
1506415064+DEP_CC=$ac_cv_prog_DEP_CC
1506515065+if test -n "$DEP_CC"; then
1506615066+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DEP_CC" >&5
1506715067+printf "%s\n" "$DEP_CC" >&6; }
1506815068+else
1506915069+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
1507015070+printf "%s\n" "no" >&6; }
1507115071+fi
1507215072+1507315073+1507415074+ test -n "$DEP_CC" && break
1507515075+ done
1507615076+fi
1507715077+if test -z "$DEP_CC"; then
1507815078+ ac_ct_DEP_CC=$DEP_CC
1507915079+ for ac_prog in $DEP_CC x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc gcc cc
1508015080+do
1508115081+ # Extract the first word of "$ac_prog", so it can be a program name with args.
1508215082+set dummy $ac_prog; ac_word=$2
1508315083+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1508415084+printf %s "checking for $ac_word... " >&6; }
1508515085+if test ${ac_cv_prog_ac_ct_DEP_CC+y}
1508615086+then :
1508715087+ printf %s "(cached) " >&6
1508815088+else $as_nop
1508915089+ if test -n "$ac_ct_DEP_CC"; then
1509015090+ ac_cv_prog_ac_ct_DEP_CC="$ac_ct_DEP_CC" # Let the user override the test.
1509115091+else
1509215092+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1509315093+for as_dir in $PATH
1509415094+do
1509515095+ IFS=$as_save_IFS
1509615096+ case $as_dir in #(((
1509715097+ '') as_dir=./ ;;
1509815098+ */) ;;
1509915099+ *) as_dir=$as_dir/ ;;
1510015100+ esac
1510115101+ for ac_exec_ext in '' $ac_executable_extensions; do
1510215102+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
1510315103+ ac_cv_prog_ac_ct_DEP_CC="$ac_prog"
1510415104+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
1510515105+ break 2
1510615106+ fi
1510715107+done
1510815108+ done
1510915109+IFS=$as_save_IFS
1511015110+1511115111+fi
1511215112+fi
1511315113+ac_ct_DEP_CC=$ac_cv_prog_ac_ct_DEP_CC
1511415114+if test -n "$ac_ct_DEP_CC"; then
1511515115+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DEP_CC" >&5
1511615116+printf "%s\n" "$ac_ct_DEP_CC" >&6; }
1511715117+else
1511815118+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
1511915119+printf "%s\n" "no" >&6; }
1512015120+fi
1512115121+1512215122+1512315123+ test -n "$ac_ct_DEP_CC" && break
1512415124+done
1512515125+1512615126+ if test "x$ac_ct_DEP_CC" = x; then
1512715127+ DEP_CC="false"
1512815128+ else
1512915129+ case $cross_compiling:$ac_tool_warned in
1513015130+yes:)
1513115131+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
1513215132+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
1513315133+ac_tool_warned=yes ;;
1513415134+esac
1513515135+ DEP_CC=$ac_ct_DEP_CC
1513615136+ fi
1513715137+fi
1513815138+1513915139+ # The C compiler may not be targetting Windows, so explicitly include
1514015140+ # the _WIN32 define
1514115141+ DEP_CPPFLAGS=-D_WIN32 ;;
1514215142+esac ;; #(
1514315143+ *) :
1514415144+ DEP_CC="$CC" ;;
1514515145+esac
1514615146+1514715147+case $enable_dependency_generation in #(
1514815148+ yes) :
1514915149+ if test "$DEP_CC" = "false"
1515015150+then :
1515115151+ as_fn_error $? "The MSVC ports cannot generate dependency information. Install gcc (or another CC-like compiler)" "$LINENO" 5
1515215152+else $as_nop
1515315153+ compute_deps=true
1515415154+fi ;; #(
1515515155+ no) :
1515615156+ compute_deps=false ;; #(
1515715157+ *) :
1515815158+ if test -e .git
1515915159+then :
1516015160+ if test "$DEP_CC" = "false"
1516115161+then :
1516215162+ compute_deps=false
1516315163+else $as_nop
1516415164+ compute_deps=true
1516515165+fi
1516615166+else $as_nop
1516715167+ compute_deps=false
1516815168+fi ;;
1516915169+esac
1517015170+1517115171+case $target in #(
1517215172+ # In config/Makefile.mingw*, we had:
1517315173+ # TARGET=i686-w64-mingw32 and x86_64-w64-mingw32
1517415174+ # TOOLPREF=$(TARGET)-
1517515175+ # ARCMD=$(TOOLPREF)ar
1517615176+ # However autoconf and libtool seem to use ar
1517715177+ # So we let them do, at the moment
1517815178+ *-pc-windows) :
1517915179+1518015180+ mkexe_via_cc_extra_cmd=' && $(call MERGEMANIFESTEXE,$(1))'
1518115181+ libext=lib
1518215182+ AR=""
1518315183+ if test "$target_cpu" = "x86_64"
1518415184+then :
1518515185+ machine="-machine:AMD64 "
1518615186+else $as_nop
1518715187+ machine=""
1518815188+fi
1518915189+ mklib="link -lib -nologo $machine /out:\$(1) \$(2)"
1519015190+ ;; #(
1519115191+ *) :
1519215192+1519315193+ mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2)"
1519415194+ ;;
1519515195+esac
15181151961518215197## In cross-compilation mode, can we run executables produced?
1518315198# At the moment, it's required, but the fact is used in C99 function detection
+18-7
configure.ac
···131131AC_SUBST([LINEAR_MAGIC_NUMBER], [LINEAR__MAGIC_NUMBER])
132132AC_SUBST([CC])
133133AC_SUBST([ocaml_cc_vendor])
134134+AC_SUBST([DEP_CC])
135135+AC_SUBST([DEP_CPPFLAGS])
136136+AC_SUBST([DEP_CC_PREFIX])
134137AC_SUBST([SAK_BUILD])
135138AC_SUBST([SAK])
136139AC_SUBST([encode_C_literal])
···839842OCAML_WITH_NONEXECSTACK_NOTE
840843OCAML_ASM_SIZE_TYPE_DIRECTIVES
841844845845+## Find vendor of the C compiler
846846+OCAML_CC_VENDOR
847847+848848+DEP_CC_PREFIX=''
842849AS_CASE([$host],
843850 [sparc-sun-solaris*],
844851 [DEP_CC="false"],
845852 [*-pc-windows],
846846- [AC_CHECK_TOOLS(
847847- [DEP_CC],
848848- [$DEP_CC gcc cc x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc],
849849- [false])],
853853+ [AS_CASE([$ocaml_cc_vendor],
854854+ [msvc-*-clang-*],
855855+ [DEP_CC="$CC"
856856+ DEP_CC_PREFIX='/clang:'],
857857+ [AC_CHECK_TOOLS(
858858+ [DEP_CC],
859859+ [$DEP_CC x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc gcc cc],
860860+ [false])
861861+ # The C compiler may not be targetting Windows, so explicitly include
862862+ # the _WIN32 define
863863+ DEP_CPPFLAGS=-D_WIN32])],
850864 [DEP_CC="$CC"])
851865852866AS_CASE([$enable_dependency_generation],
···882896 [
883897 mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2)"
884898 ])
885885-886886-## Find vendor of the C compiler
887887-OCAML_CC_VENDOR
888899889900## In cross-compilation mode, can we run executables produced?
890901# At the moment, it's required, but the fact is used in C99 function detection
+28-12
otherlibs/Makefile.otherlibs.common
···166166%.cmx: %.ml
167167 $(V_OCAMLOPT)$(CAMLOPT) -c $(COMPFLAGS) $(OPTCOMPFLAGS) $<
168168169169+ifeq "$(COMPUTE_DEPS)" "true"
170170+%.b.$(O): %.c $(REQUIRED_HEADERS) | $(DEPDIR)
171171+ $(V_CC)$(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(CPPFLAGS) \
172172+ $(OUTPUTOBJ)$@ $(call DEP_FLAGS,$@,$(DEPDIR)/$(@:.$(O)=.$(D))) -c $<
173173+# MSVC doesn't emit usable dependency information, but if GCC is available
174174+# then it can instead be called in order to generate the .d file.
175175+ifneq "$(CC)" "$(DEP_CC)"
176176+ $(V_CCDEPS)$(DEP_CC) $(DEP_CPPFLAGS) $(OC_CPPFLAGS) $(CPPFLAGS) $< \
177177+ -MM -MT $@ -MF $(DEPDIR)/$(@:.$(O)=.$(D))
178178+endif # ifneq "$(CC)" "$(DEP_CC)"
179179+180180+%.n.$(O): %.c $(REQUIRED_HEADERS) | $(DEPDIR)
181181+ $(V_CC)$(CC) $(OC_CFLAGS) $(CFLAGS) \
182182+ $(OC_CPPFLAGS) $(CPPFLAGS) $(OUTPUTOBJ)$@ \
183183+ $(call DEP_FLAGS,$@,$(DEPDIR)/$(@:.$(O)=.$(D))) -c $<
184184+# MSVC doesn't emit usable dependency information, but if GCC is available
185185+# then it can instead be called in order to generate the .d file.
186186+ifneq "$(CC)" "$(DEP_CC)"
187187+ $(V_CCDEPS)$(DEP_CC) $(OC_CPPFLAGS) $(CPPFLAGS) $< -MM -MT $@ \
188188+ -MF $(DEPDIR)/$(@:.$(O)=.$(D))
189189+endif # ifneq "$(CC)" "$(DEP_CC)"
190190+else
169191%.b.$(O): %.c $(REQUIRED_HEADERS)
170192 $(V_CC)$(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(CPPFLAGS) \
171193 $(OUTPUTOBJ)$@ -c $<
172194173173-%.n.$(O): OC_CFLAGS += $(OC_NATIVE_CFLAGS)
174174-175195%.n.$(O): %.c $(REQUIRED_HEADERS)
176196 $(V_CC)$(CC) $(OC_CFLAGS) $(CFLAGS) \
177197 $(OC_CPPFLAGS) $(CPPFLAGS) $(OUTPUTOBJ)$@ -c $<
198198+endif # ifeq "$(COMPUTE_DEPS)" "true"
199199+200200+%.n.$(O): OC_CFLAGS += $(OC_NATIVE_CFLAGS)
178201179202ifeq "$(COMPUTE_DEPS)" "true"
180203ifneq "$(COBJS_BYTECODE)" ""
181181-include $(addprefix $(DEPDIR)/, $(COBJS_BYTECODE:.$(O)=.$(D)))
182182-ifeq "$(NATIVE_COMPILER)" "true"
183183-include $(addprefix $(DEPDIR)/, $(COBJS_NATIVE:.$(O)=.$(D)))
204204+GENERATED_DEPEND_FILES := $(wildcard $(DEPDIR)/*.$(D))
205205+.PHONY: $(GENERATED_DEPEND_FILES)
206206+include $(GENERATED_DEPEND_FILES)
184207endif
185208endif
186186-endif
187187-188188-$(DEPDIR)/%.b.$(D): %.c | $(DEPDIR)
189189- $(V_CCDEPS)$(DEP_CC) $(OC_CPPFLAGS) $(CPPFLAGS) $< -MT '$*.b.$(O)' -MF $@
190190-191191-$(DEPDIR)/%.n.$(D): %.c | $(DEPDIR)
192192- $(V_CCDEPS)$(DEP_CC) $(OC_CPPFLAGS) $(CPPFLAGS) $< -MT '$*.n.$(O)' -MF $@