···151151152152/tools/ci/appveyor/appveyor_build.cmd text eol=crlf
153153154154+aclocal.m4 typo.tab
154155configure.ac text eol=lf
155156build-aux/compile text eol=lf
156157build-aux/config.guess text eol=lf
···361361 (Gabriel Scherer, review by Sébastien Hinderer and David Allsopp,
362362 report by Ralph Seichter)
363363364364+- #10135: Overhaul the FlexDLL bootstrap process. It's now fully integrated
365365+ with the default build target and controlled by --with-flexdll which allows
366366+ externally downloaded sources for FlexDLL to be specified. A separate
367367+ non-shared version of the runtime is built, and shared artefacts are no longer
368368+ built twice. When bootstrapping, any flexlink in PATH is now ignored and the
369369+ Cygwin port also supports bootstrapping FlexDLL. flexlink.opt is automatically
370370+ built and installed as part of opt.opt/world.opt.
371371+ (David Allsopp, review by Sébastien Hinderer)
372372+364373- #10156: configure script: fix sockets feature detection.
365374 (Lucas Pluvinage, review by David Allsopp and Damien Doligez)
366375
+121-75
Makefile
···8888EXTRAPATH = PATH="otherlibs/win32unix:$(PATH)"
8989endif
90909191-BOOT_FLEXLINK_CMD=
92919393-ifeq "$(UNIX_OR_WIN32)" "win32"
9494-FLEXDLL_SUBMODULE_PRESENT := $(wildcard flexdll/Makefile)
9595-ifeq "$(FLEXDLL_SUBMODULE_PRESENT)" ""
9292+ifeq "$(BOOTSTRAPPING_FLEXDLL)" "false"
9393+ COLDSTART_DEPS =
9694 BOOT_FLEXLINK_CMD =
9795else
9696+ COLDSTART_DEPS = boot/ocamlruns$(EXE)
9897 BOOT_FLEXLINK_CMD = \
9999- FLEXLINK_CMD="../boot/ocamlrun$(EXE) ../flexdll/flexlink.exe"
100100-endif
101101-else
9898+ FLEXLINK_CMD="../boot/ocamlruns$(EXE) ../boot/flexlink.byte$(EXE)"
10299endif
103100104101expunge := expunge$(EXE)
···135132136133$(foreach program, $(programs), $(eval $(call PROGRAM_SYNONYM,$(program))))
137134135135+USE_RUNTIME_PRIMS = -use-prims ../runtime/primitives
136136+USE_STDLIB = -nostdlib -I ../stdlib
137137+138138+FLEXDLL_OBJECTS = \
139139+ flexdll_$(FLEXDLL_CHAIN).$(O) flexdll_initer_$(FLEXDLL_CHAIN).$(O)
140140+FLEXLINK_BUILD_ENV = \
141141+ MSVC_DETECT=0 OCAML_CONFIG_FILE=../Makefile.config \
142142+ CHAINS=$(FLEXDLL_CHAIN) ROOTDIR=..
143143+144144+boot/ocamlruns$(EXE):
145145+ $(MAKE) -C runtime ocamlruns$(EXE)
146146+ cp runtime/ocamlruns$(EXE) boot/ocamlruns$(EXE)
147147+138148# Start up the system from the distribution compiler
149149+# The process depends on whether FlexDLL is also being bootstrapped.
150150+# Normal procedure:
151151+# - Build the runtime
152152+# - Build the standard library using runtime/ocamlrun
153153+# FlexDLL procedure:
154154+# - Build ocamlruns
155155+# - Build the standard library using boot/ocamlruns
156156+# - Build flexlink and FlexDLL support objects
157157+# - Build the runtime
158158+# runtime/ocamlrun is then installed to boot/ocamlrun and the stdlib artefacts
159159+# are copied to boot/
139160.PHONY: coldstart
140140-coldstart:
161161+coldstart: $(COLDSTART_DEPS)
162162+ifeq "$(BOOTSTRAPPING_FLEXDLL)" "false"
163163+ $(MAKE) -C runtime all
164164+ $(MAKE) -C stdlib \
165165+ OCAMLRUN='$$(ROOTDIR)/runtime/ocamlrun$(EXE)' \
166166+ CAMLC='$$(BOOT_OCAMLC) $(USE_RUNTIME_PRIMS)' all
167167+else
168168+ $(MAKE) -C stdlib OCAMLRUN='$$(ROOTDIR)/boot/ocamlruns$(EXE)' \
169169+ CAMLC='$$(BOOT_OCAMLC)' all
170170+ $(MAKE) -C $(FLEXDLL_SOURCES) $(FLEXLINK_BUILD_ENV) \
171171+ OCAMLRUN='$$(ROOTDIR)/boot/ocamlruns$(EXE)' NATDYNLINK=false \
172172+ OCAMLOPT='$(value BOOT_OCAMLC) $(USE_RUNTIME_PRIMS) $(USE_STDLIB)' \
173173+ flexlink.exe support
174174+ mv $(FLEXDLL_SOURCES)/flexlink.exe boot/flexlink.byte$(EXE)
175175+ cp $(addprefix $(FLEXDLL_SOURCES)/, $(FLEXDLL_OBJECTS)) boot/
141176 $(MAKE) -C runtime $(BOOT_FLEXLINK_CMD) all
177177+endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "false"
142178 cp runtime/ocamlrun$(EXE) boot/ocamlrun$(EXE)
143143- $(MAKE) -C stdlib $(BOOT_FLEXLINK_CMD) \
144144- CAMLC='$$(BOOT_OCAMLC) -use-prims ../runtime/primitives' all
145179 cd boot; rm -f $(LIBFILES)
146180 cd stdlib; cp $(LIBFILES) ../boot
147181 cd boot; $(LN) ../runtime/libcamlrun.$(A) .
···213247 $(MAKE) coreall
214248 $(MAKE) ocaml
215249 $(MAKE) opt-core
250250+ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true"
251251+ $(MAKE) flexlink.opt$(EXE)
252252+endif
216253 $(MAKE) ocamlc.opt
217254 $(MAKE) otherlibraries $(WITH_DEBUGGER) $(WITH_OCAMLDOC) \
218255 $(WITH_OCAMLTEST)
···278315# Different git mechanism displayed depending on whether this source tree came
279316# from a git clone or a source tarball.
280317281281-flexdll/Makefile:
282282- @echo In order to bootstrap FlexDLL, you need to place the sources in
283283- @echo flexdll.
318318+.PHONY: flexdll flexlink flexlink.opt
319319+320320+ifeq "$(BOOTSTRAPPING_FLEXDLL)" "false"
321321+flexdll flexlink flexlink.opt:
322322+ @echo It is no longer necessary to bootstrap FlexDLL with a separate
323323+ @echo make invocation. Simply place the sources for FlexDLL in a
324324+ @echo sub-directory.
284325 @echo This can either be done by downloading a source tarball from
285285- @echo \ http://alain.frisch.fr/flexdll.html
326326+ @echo \ https://github.com/alainfrisch/flexdll/releases
286327 @if [ -d .git ]; then \
287328 echo or by checking out the flexdll submodule with; \
288329 echo \ git submodule update --init; \
···290331 echo or by cloning the git repository; \
291332 echo \ git clone https://github.com/alainfrisch/flexdll.git; \
292333 fi
334334+ @echo "Then pass --with-flexdll=<dir> to configure and build as normal."
293335 @false
294336337337+else
338338+295339.PHONY: flexdll
296296-flexdll: flexdll/Makefile flexlink
297297- $(MAKE) -C flexdll \
298298- OCAML_CONFIG_FILE=../Makefile.config \
299299- MSVC_DETECT=0 CHAINS=$(FLEXDLL_CHAIN) NATDYNLINK=false support
300300-301301-# Bootstrapping flexlink - leaves a bytecode image of flexlink.exe in flexdll/
302302-FLEXLINK_OCAMLOPT = \
303303- ../boot/ocamlrun$(EXE) ../boot/ocamlc \
304304- -use-prims ../runtime/primitives -nostdlib -I ../boot
340340+flexdll: flexdll/Makefile
341341+ @echo WARNING! make flexdll is no longer required
342342+ @echo This target will be removed in a future release.
305343306344.PHONY: flexlink
307307-flexlink: flexdll/Makefile
308308- $(MAKE) -C runtime BOOTSTRAPPING_FLEXLINK=yes ocamlrun$(EXE)
309309- cp runtime/ocamlrun$(EXE) boot/ocamlrun$(EXE)
310310- $(MAKE) -C stdlib \
311311- COMPILER="../boot/ocamlc -use-prims ../runtime/primitives" \
312312- $(filter-out *.cmi,$(LIBFILES))
313313- cd stdlib && cp $(LIBFILES) ../boot/
314314- $(MAKE) -C flexdll MSVC_DETECT=0 OCAML_CONFIG_FILE=../Makefile.config \
315315- CHAINS=$(FLEXDLL_CHAIN) NATDYNLINK=false \
316316- OCAMLOPT="$(FLEXLINK_OCAMLOPT)" \
317317- flexlink.exe
318318- $(MAKE) -C runtime clean
319319- $(MAKE) partialclean
345345+flexlink:
346346+ @echo Bootstrapping just flexlink.exe is no longer supported
347347+ @echo Bootstrapping FlexDLL is now enabled with
348348+ @echo ./configure --with-flexdll
349349+ @false
320350321321-.PHONY: flexlink.opt
322322-flexlink.opt:
323323- cd flexdll && \
324324- mv flexlink.exe flexlink && \
325325- ($(MAKE) OCAML_FLEXLINK="../boot/ocamlrun$(EXE) ./flexlink" \
326326- MSVC_DETECT=0 OCAML_CONFIG_FILE=../Makefile.config \
327327- OCAMLOPT="../ocamlopt.opt$(EXE) -nostdlib -I ../stdlib" \
328328- flexlink.exe || \
329329- (mv flexlink flexlink.exe && false)) && \
330330- mv flexlink.exe flexlink.opt && \
331331- mv flexlink flexlink.exe
351351+ifeq "$(wildcard ocamlopt.opt$(EXE))" ""
352352+ FLEXLINK_OCAMLOPT=../runtime/ocamlrun$(EXE) ../ocamlopt$(EXE)
353353+else
354354+ FLEXLINK_OCAMLOPT=../ocamlopt.opt$(EXE)
355355+endif
356356+357357+flexlink.opt$(EXE):
358358+ $(MAKE) -C $(FLEXDLL_SOURCES) $(FLEXLINK_BUILD_ENV) \
359359+ OCAML_FLEXLINK='$(value OCAMLRUN) $$(ROOTDIR)/boot/flexlink.byte$(EXE)' \
360360+ OCAMLOPT="$(FLEXLINK_OCAMLOPT) -nostdlib -I ../stdlib" flexlink.exe
361361+ mv $(FLEXDLL_SOURCES)/flexlink.exe $@
332362333333-INSTALL_COMPLIBDIR=$(DESTDIR)$(COMPLIBDIR)
334334-INSTALL_FLEXDLLDIR=$(INSTALL_LIBDIR)/flexdll
363363+partialclean::
364364+ rm -f flexlink.opt$(EXE)
365365+endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "false"
335366336336-.PHONY: install-flexdll
337337-install-flexdll:
338338- $(INSTALL_PROG) flexdll/flexlink.exe "$(INSTALL_BINDIR)/flexlink$(EXE)"
339339-ifneq "$(filter-out mingw,$(TOOLCHAIN))" ""
340340- $(INSTALL_DATA) flexdll/default$(filter-out _i386,_$(ARCH)).manifest \
341341- "$(INSTALL_BINDIR)/"
342342-endif
343343- if test -n "$(wildcard flexdll/flexdll_*.$(O))" ; then \
344344- $(MKDIR) "$(INSTALL_FLEXDLLDIR)" ; \
345345- $(INSTALL_DATA) flexdll/flexdll_*.$(O) "$(INSTALL_FLEXDLLDIR)" ; \
346346- fi
367367+INSTALL_COMPLIBDIR = $(DESTDIR)$(COMPLIBDIR)
368368+INSTALL_FLEXDLLDIR = $(INSTALL_LIBDIR)/flexdll
369369+FLEXDLL_MANIFEST = default$(filter-out _i386,_$(ARCH)).manifest
347370348371# Installation
349372.PHONY: install
···424447 if test -n "$(WITH_DEBUGGER)"; then \
425448 $(MAKE) -C debugger install; \
426449 fi
427427-ifeq "$(UNIX_OR_WIN32)" "win32"
428428- if test -n "$(FLEXDLL_SUBMODULE_PRESENT)"; then \
429429- $(MAKE) install-flexdll; \
430430- fi
450450+ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true"
451451+ifeq "$(TOOLCHAIN)" "msvc"
452452+ $(INSTALL_DATA) $(FLEXDLL_SOURCES)/$(FLEXDLL_MANIFEST) \
453453+ "$(INSTALL_BINDIR)/"
431454endif
455455+ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true"
456456+ $(INSTALL_PROG) \
457457+ boot/flexlink.byte$(EXE) "$(INSTALL_BINDIR)/flexlink.byte$(EXE)"
458458+endif # ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true"
459459+ $(MKDIR) "$(INSTALL_FLEXDLLDIR)"
460460+ $(INSTALL_DATA) $(addprefix stdlib/flexdll/, $(FLEXDLL_OBJECTS)) \
461461+ "$(INSTALL_FLEXDLLDIR)"
462462+endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true"
432463 $(INSTALL_DATA) Makefile.config "$(INSTALL_LIBDIR)"
433464ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true"
434465 if test -f ocamlopt$(EXE); then $(MAKE) installopt; else \
435466 cd "$(INSTALL_BINDIR)"; \
436467 $(LN) ocamlc.byte$(EXE) ocamlc$(EXE); \
437468 $(LN) ocamllex.byte$(EXE) ocamllex$(EXE); \
469469+ (test -f flexlink.byte$(EXE) && \
470470+ $(LN) flexlink.byte$(EXE) flexlink$(EXE)) || true; \
438471 fi
439472else
440473 if test -f ocamlopt$(EXE); then $(MAKE) installopt; fi
···501534 $(LN) ocamlc.byte$(EXE) ocamlc$(EXE); \
502535 $(LN) ocamlopt.byte$(EXE) ocamlopt$(EXE); \
503536 $(LN) ocamllex.byte$(EXE) ocamllex$(EXE); \
537537+ (test -f flexlink.byte$(EXE) && \
538538+ $(LN) flexlink.byte$(EXE) flexlink$(EXE)) || true; \
504539 fi
505540else
506541 if test -f ocamlopt.opt$(EXE); then $(MAKE) installoptopt; fi
507542endif
508543 $(MAKE) -C tools installopt
509509- if test -f ocamlopt.opt$(EXE) -a -f flexdll/flexlink.opt ; then \
510510- $(INSTALL_PROG) \
511511- flexdll/flexlink.opt "$(INSTALL_BINDIR)/flexlink$(EXE)" ; \
512512- fi
513544514545.PHONY: installoptopt
515546installoptopt:
···520551 $(LN) ocamlc.opt$(EXE) ocamlc$(EXE); \
521552 $(LN) ocamlopt.opt$(EXE) ocamlopt$(EXE); \
522553 $(LN) ocamllex.opt$(EXE) ocamllex$(EXE)
554554+ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true"
555555+ $(INSTALL_PROG) flexlink.opt$(EXE) "$(INSTALL_BINDIR)"
556556+ cd "$(INSTALL_BINDIR)"; \
557557+ $(LN) flexlink.opt$(EXE) flexlink$(EXE)
558558+endif
523559 $(INSTALL_DATA) \
524560 utils/*.cmx parsing/*.cmx typing/*.cmx bytecomp/*.cmx \
525561 file_formats/*.cmx \
···740776.PHONY: runtime
741777runtime: stdlib/libcamlrun.$(A)
742778779779+ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true"
780780+runtime: $(addprefix stdlib/flexdll/, $(FLEXDLL_OBJECTS))
781781+stdlib/flexdll/flexdll%.$(O): $(FLEXDLL_SOURCES)/flexdll%.$(O) | stdlib/flexdll
782782+ cp $< $@
783783+stdlib/flexdll:
784784+ $(MKDIR) $@
785785+endif
786786+743787.PHONY: makeruntime
744788makeruntime:
745789 $(MAKE) -C runtime $(BOOT_FLEXLINK_CMD) all
···935979# Check that the stack limit is reasonable (Unix-only)
936980.PHONY: checkstack
937981ifeq "$(UNIX_OR_WIN32)" "unix"
938938-checkstack := tools/checkstack
939939-checkstack: $(checkstack)$(EXE)
982982+checkstack: tools/checkstack$(EXE)
940983 $<
941984942942-.INTERMEDIATE: $(checkstack)$(EXE) $(checkstack).$(O)
943943-$(checkstack)$(EXE): $(checkstack).$(O)
944944- $(MKEXE) $(OUTPUTEXE)$@ $<
985985+.INTERMEDIATE: tools/checkstack$(EXE) tools/checkstack.$(O)
986986+tools/checkstack$(EXE): tools/checkstack.$(O)
987987+ $(MAKE) -C tools $(BOOT_FLEXLINK_CMD) checkstack$(EXE)
945988else
946989checkstack:
947990 @
···10911134.PHONY: distclean
10921135distclean: clean
10931136 rm -f boot/ocamlrun boot/ocamlrun.exe boot/camlheader \
10941094- boot/*.cm* boot/libcamlrun.a boot/libcamlrun.lib boot/ocamlc.opt
11371137+ boot/ocamlruns boot/ocamlruns.exe \
11381138+ boot/flexlink.byte boot/flexlink.byte.exe \
11391139+ boot/flexdll_*.o boot/flexdll_*.obj \
11401140+ boot/*.cm* boot/libcamlrun.a boot/libcamlrun.lib boot/ocamlc.opt
10951141 rm -f Makefile.config Makefile.build_config
10961142 rm -f runtime/caml/m.h runtime/caml/s.h
10971097- rm -rf autom4te.cache
11431143+ rm -rf autom4te.cache flexdll-sources
10981144 rm -f config.log config.status libtool
10991145 rm -f tools/eventlog_metadata
11001146 rm -f tools/*.bak
+5
Makefile.build_config.in
···3838# Which document generator: odoc or ocamldoc?
3939DOCUMENTATION_TOOL=@documentation_tool@
4040DOCUMENTATION_TOOL_CMD=@documentation_tool_cmd@
4141+4242+# The location of the FlexDLL sources to use (usually provided as the flexdll
4343+# Git submodule)
4444+FLEXDLL_SOURCES=@flexdir@
4545+BOOTSTRAPPING_FLEXDLL=@bootstrapping_flexdll@
···6262Only the `make` Cygwin package is required. `diffutils` is required if you wish
6363to be able to run the test suite.
64646565-Unless you are also compiling the Cygwin port of OCaml, you should not install
6666-the `gcc-core` or `flexdll` packages. If you do, care may be required to ensure
6767-that a particular build is using the correct installation of `flexlink`.
6565+Unless you are also compiling the Cygwin port of OCaml, you do not need the
6666+`gcc-core` or `flexdll` packages. If you do install them, care may be required
6767+to ensure that a particular build is using the correct installation of
6868+`flexlink`.
68696970[[bmflex]]
7071In addition to Cygwin, FlexDLL must also be installed, which is available from
···7576install FlexDLL is included in your `PATH` environment variable. Note: binary
7677distributions of FlexDLL are compatible only with Visual Studio 2013 and
7778earlier; for Visual Studio 2015 and later, you will need to compile the C
7878-objects from source, or build ocaml using the flexdll target.
7979+objects from source, or configure ocaml with the `--with-flexdll` option.
79808081The base bytecode system (ocamlc, ocaml, ocamllex, ocamlyacc, ...) of all three
8182ports runs without any additional tools.
···245246`mingw64-i686-gcc-core` package for 32-bit and the `mingw64-x86_64-gcc-core`
246247package for 64-bit.
247248248248- - Do not try to use the Cygwin version of flexdll for this port.
249249+ - The Cygwin version of flexdll does not work with this port.
249250250251 - The standalone mingw toolchain from the Mingw-w64 project
251252 (http://mingw-w64.org/) is not supported. Please use the version packaged in
···290291to build entirely from sources. Since OCaml 4.03 and FlexDLL 0.35, it is now
291292possible to bootstrap the two programs simultaneously. The process is identical
292293for both ports. If you choose to compile this way, it is not necessary to
293293-install FlexDLL separately -- indeed, if you do install FlexDLL separately, you
294294-may need to be careful to ensure that `ocamlopt` picks up the correct `flexlink`
295295-in your `PATH`.
294294+install FlexDLL separately.
296295297297-You must place the FlexDLL sources for Version 0.35 or later in the directory
296296+You must extract the FlexDLL sources for Version 0.35 or later in the directory
298297`flexdll/` at the top-level directory of the OCaml distribution. This can be
299298done in one of three ways:
300299···309308+
310309 git submodule update --init
311310312312-OCaml is then compiled as normal for the port you require, except that before
313313-building the compiler itself, you must compile `flexdll`, i.e.:
311311+OCaml is then compiled normally for the port you require.
314312315315- make flexdll
316313 make
317317- make flexlink.opt
318314 make install
319315320320- * You should ignore the error messages that say ocamlopt was not found.
321316 * `make install` will install FlexDLL by placing `flexlink.exe`
322317 (and the default manifest file for the Microsoft port) in `bin/` and the
323318 FlexDLL object files in `lib/`.
324324- * If you don't include `make flexlink.opt`, `flexlink.exe` will be a
325325- bytecode program. `make install` always installs the "best"
326326- `flexlink.exe` (i.e. there is never a `flexlink.opt.exe` installed).
327327- * If you have populated `flexdll/`, you *must* run
328328- `make flexdll`. If you wish to revert to using an externally
329329- installed FlexDLL, you must erase the contents of `flexdll/` before
330330- compiling.
319319+ * If you have populated `flexdll/`, the build will always use it, ignoring
320320+ any externally installed FlexDLL. You can override this behaviour by either
321321+ erasing the contents of `flexdll/` or passing the `--without-flexdll` option
322322+ to `configure`.
331323332324== Unicode support
333325
+66
aclocal.m4
···130130 saved_CC="$CC"
131131 saved_CFLAGS="$CFLAGS"
132132 saved_CPPFLAGS="$CPPFLAGS"
133133+ saved_LIBS="$LIBS"
133134 saved_ac_ext="$ac_ext"
134135 saved_ac_compile="$ac_compile"
135136 # Move the content of confdefs.h to another file so it does not
···147148 CPPFLAGS="$saved_CPPFLAGS"
148149 CFLAGS="$saved_CFLAGS"
149150 CC="$saved_CC"
151151+ LIBS="$saved_LIBS"
150152])
151153152154AC_DEFUN([OCAML_AS_HAS_DEBUG_PREFIX_MAP], [
···290292 LDFLAGS="$SAVED_LDFLAGS"
291293 CFLAGS="$SAVED_CFLAGS"
292294])
295295+296296+AC_DEFUN([OCAML_TEST_FLEXLINK], [
297297+ OCAML_CC_SAVE_VARIABLES
298298+299299+ AC_MSG_CHECKING([whether $1 works])
300300+301301+ AC_COMPILE_IFELSE(
302302+ [AC_LANG_SOURCE([int answer = 42;])],
303303+ [# Create conftest1.$ac_objext as a symlink on Cygwin to ensure that native
304304+ # flexlink can cope. The reverse test is unnecessary (a Cygwin-compiled
305305+ # flexlink can read anything).
306306+ mv conftest.$ac_objext conftest1.$ac_objext
307307+ AS_CASE([$4],[*-pc-cygwin],
308308+ [ln -s conftest1.$ac_objext conftest2.$ac_objext],
309309+ [cp conftest1.$ac_objext conftest2.$ac_objext])
310310+311311+ CC="$1 -chain $2 -exe"
312312+ LIBS="conftest2.$ac_objext"
313313+ CPPFLAGS="$3 $CPPFLAGS"
314314+ AC_LINK_IFELSE(
315315+ [AC_LANG_SOURCE([int main() { return 0; }])],
316316+ [AC_MSG_RESULT([yes])],
317317+ [AC_MSG_RESULT([no])
318318+ AC_MSG_ERROR([$1 does not work])])],
319319+ [AC_MSG_RESULT([unexpected compile error])
320320+ AC_MSG_ERROR([error calling the C compiler])])
321321+322322+ OCAML_CC_RESTORE_VARIABLES
323323+])
324324+325325+AC_DEFUN([OCAML_TEST_FLEXDLL_H], [
326326+ OCAML_CC_SAVE_VARIABLES
327327+328328+ AS_IF([test -n "$1"],[CPPFLAGS="-I $1 $CPPFLAGS"])
329329+ have_flexdll_h=no
330330+ AC_CHECK_HEADER([flexdll.h],[have_flexdll_h=yes],[have_flexdll_h=no])
331331+ AS_IF([test x"$have_flexdll_h" = 'xno'],
332332+ [AS_IF([test -n "$1"],
333333+ [AC_MSG_ERROR([$1/flexdll.h appears unusable])])])
334334+335335+ OCAML_CC_RESTORE_VARIABLES
336336+])
337337+338338+AC_DEFUN([OCAML_TEST_FLEXLINK_WHERE], [
339339+ OCAML_CC_SAVE_VARIABLES
340340+341341+ AC_MSG_CHECKING([if "$1 -where" includes flexdll.h])
342342+ flexlink_where="$($1 -where | tr -d '\r')"
343343+ CPPFLAGS="$CPPFLAGS -I \"$flexlink_where\""
344344+ cat > conftest.c <<"EOF"
345345+#include <flexdll.h>
346346+int main (void) {return 0;}
347347+EOF
348348+ cat > conftest.Makefile <<EOF
349349+all:
350350+ $CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS
351351+EOF
352352+ AS_IF([make -f conftest.Makefile >/dev/null 2>/dev/null],
353353+ [have_flexdll_h=yes
354354+ AC_MSG_RESULT([yes])],
355355+ [AC_MSG_RESULT([no])])
356356+357357+ OCAML_CC_RESTORE_VARIABLES
358358+])
+377-76
configure
···699699INSTALL_DATA
700700INSTALL_SCRIPT
701701INSTALL_PROGRAM
702702+flexlink
702703ac_ct_DEP_CC
703704DEP_CC
704705CPP
···799800AR
800801shebangscripts
801802long_shebang
802802-iflexdir
803803+bootstrapping_flexdll
804804+flexdir
803805ocamlc_cppflags
804806ocamlc_cflags
805807nativecclibs
···910912enable_flat_float_array
911913enable_function_sections
912914with_afl
915915+with_flexdll
913916enable_shared
914917enable_static
915918with_pic
···16021605 --with-odoc build documentation with odoc
16031606 --with-target-bindir location of binary programs on target system
16041607 --with-afl use the AFL fuzzer
16081608+ --with-flexdll bootstrap FlexDLL from the given sources
16051609 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
16061610 both]
16071611 --with-aix-soname=aix|svr4|both
···27932797oc_dll_ldflags=""
27942798with_sharedlibs=true
27952799ostype="Unix"
27962796-iflexdir=""
27972800SO="so"
27982801toolchain="cc"
27992802profinfo=false
···28012804extralibs=
28022805instrumented_runtime=false
28032806instrumented_runtime_libs=""
28072807+bootstrapping_flexdll=false
2804280828052809# Information about the package
28062810···28482852# Note: This is present for the flexdll bootstrap where it exposed as the old
28492853# TOOLPREF variable. It would be better if flexdll where updated to require
28502854# WINDRES instead.
28552855+285128562852285728532858···33353340# Check whether --with-afl was given.
33363341if test "${with_afl+set}" = set; then :
33373342 withval=$with_afl;
33433343+fi
33443344+33453345+33463346+33473347+# Check whether --with-flexdll was given.
33483348+if test "${with_flexdll+set}" = set; then :
33493349+ withval=$with_flexdll; if test x"$withval" = 'xyes'; then :
33503350+ with_flexdll=flexdll
33513351+fi
33383352fi
3339335333403354···12787128011278812802if test x"$enable_shared" = "xno"; then :
1278912803 with_sharedlibs=false
1280412804+ case $host in #(
1280512805+ *-pc-windows|*-w64-mingw32) :
1280612806+ as_fn_error $? "Cannot build native Win32 with --disable-shared" "$LINENO" 5 ;; #(
1280712807+ *) :
1280812808+ ;;
1280912809+esac
1281012810+fi
1281112811+1281212812+# Define flexlink chain and flags correctly for the different Windows ports
1281312813+case $host in #(
1281412814+ i686-*-cygwin) :
1281512815+ flexdll_chain='cygwin'
1281612816+ flexlink_flags="-chain $flexdll_chain -merge-manifest -stack 16777216" ;; #(
1281712817+ x86_64-*-cygwin) :
1281812818+ flexdll_chain='cygwin64'
1281912819+ flexlink_flags="-chain $flexdll_chain -merge-manifest -stack 16777216" ;; #(
1282012820+ *-*-cygwin*) :
1282112821+ as_fn_error $? "unknown cygwin variant" "$LINENO" 5 ;; #(
1282212822+ i686-w64-mingw32) :
1282312823+ flexdll_chain='mingw'
1282412824+ flexlink_flags="-chain $flexdll_chain -stack 16777216" ;; #(
1282512825+ x86_64-w64-mingw32) :
1282612826+ flexdll_chain='mingw64'
1282712827+ flexlink_flags="-chain $flexdll_chain -stack 33554432" ;; #(
1282812828+ i686-pc-windows) :
1282912829+ flexdll_chain='msvc'
1283012830+ flexlink_flags="-merge-manifest -stack 16777216" ;; #(
1283112831+ x86_64-pc-windows) :
1283212832+ flexdll_chain='msvc64'
1283312833+ flexlink_flags="-x64 -merge-manifest -stack 33554432" ;; #(
1283412834+ *) :
1283512835+ ;;
1283612836+esac
1283712837+1283812838+if test x"$enable_shared" != 'xno'; then :
1283912839+1284012840+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexdll sources" >&5
1284112841+$as_echo_n "checking for flexdll sources... " >&6; }
1284212842+ if test x"$with_flexdll" = "xno"; then :
1284312843+ flexdir=''
1284412844+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
1284512845+$as_echo "disabled" >&6; }
1284612846+else
1284712847+ flexmsg=''
1284812848+ case $target in #(
1284912849+ *-*-cygwin*|*-w64-mingw32|*-pc-windows) :
1285012850+ if test x"$with_flexdll" = 'x' -o x"$with_flexdll" = 'xflexdll'; then :
1285112851+ if test -f 'flexdll/flexdll.h'; then :
1285212852+ flexdir=flexdll
1285312853+ iflexdir='$(ROOTDIR)/flexdll'
1285412854+ with_flexdll="$iflexdir"
1285512855+else
1285612856+ if test x"$with_flexdll" != 'x'; then :
1285712857+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: requested but not available" >&5
1285812858+$as_echo "requested but not available" >&6; }
1285912859+ as_fn_error $? "exiting" "$LINENO" 5
1286012860+fi
1286112861+fi
1286212862+else
1286312863+ rm -rf flexdll-sources
1286412864+ if test -f "$with_flexdll/flexdll.h"; then :
1286512865+ mkdir -p flexdll-sources
1286612866+ cp -r "$with_flexdll"/* flexdll-sources/
1286712867+ flexdir='flexdll-sources'
1286812868+ iflexdir='$(ROOTDIR)/flexdll-sources'
1286912869+ flexmsg=" (from $with_flexdll)"
1287012870+else
1287112871+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: requested but not available" >&5
1287212872+$as_echo "requested but not available" >&6; }
1287312873+ as_fn_error $? "exiting" "$LINENO" 5
1287412874+fi
1287512875+fi
1287612876+ if test x"$flexdir" = 'x'; then :
1287712877+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1287812878+$as_echo "no" >&6; }
1287912879+else
1288012880+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $iflexdir$flexmsg" >&5
1288112881+$as_echo "$iflexdir$flexmsg" >&6; }
1288212882+ bootstrapping_flexdll=true
1288312883+ # The submodule should be searched *before* any other -I paths
1288412884+ internal_cppflags="-I $iflexdir $internal_cppflags"
1288512885+fi ;; #(
1288612886+ *) :
1288712887+ if test x"$with_flexdll" != 'x'; then :
1288812888+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: requested but not supported" >&5
1288912889+$as_echo "requested but not supported" >&6; }
1289012890+ as_fn_error $? "exiting" "$LINENO" 5
1289112891+fi ;;
1289212892+esac
1289312893+fi
1289412894+1289512895+ # Extract the first word of "flexlink", so it can be a program name with args.
1289612896+set dummy flexlink; ac_word=$2
1289712897+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1289812898+$as_echo_n "checking for $ac_word... " >&6; }
1289912899+if ${ac_cv_prog_flexlink+:} false; then :
1290012900+ $as_echo_n "(cached) " >&6
1290112901+else
1290212902+ if test -n "$flexlink"; then
1290312903+ ac_cv_prog_flexlink="$flexlink" # Let the user override the test.
1290412904+else
1290512905+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1290612906+for as_dir in $PATH
1290712907+do
1290812908+ IFS=$as_save_IFS
1290912909+ test -z "$as_dir" && as_dir=.
1291012910+ for ac_exec_ext in '' $ac_executable_extensions; do
1291112911+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1291212912+ ac_cv_prog_flexlink="flexlink"
1291312913+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1291412914+ break 2
1291512915+ fi
1291612916+done
1291712917+ done
1291812918+IFS=$as_save_IFS
1291912919+1292012920+fi
1292112921+fi
1292212922+flexlink=$ac_cv_prog_flexlink
1292312923+if test -n "$flexlink"; then
1292412924+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flexlink" >&5
1292512925+$as_echo "$flexlink" >&6; }
1292612926+else
1292712927+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1292812928+$as_echo "no" >&6; }
1292912929+fi
1293012930+1293112931+1293212932+1293312933+ if test -n "$flexlink" -a -z "$flexdir"; then :
1293412934+1293512935+1293612936+1293712937+ saved_CC="$CC"
1293812938+ saved_CFLAGS="$CFLAGS"
1293912939+ saved_CPPFLAGS="$CPPFLAGS"
1294012940+ saved_LIBS="$LIBS"
1294112941+ saved_ac_ext="$ac_ext"
1294212942+ saved_ac_compile="$ac_compile"
1294312943+ # Move the content of confdefs.h to another file so it does not
1294412944+ # get included
1294512945+ mv confdefs.h confdefs.h.bak
1294612946+ touch confdefs.h
1294712947+1294812948+1294912949+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $flexlink works" >&5
1295012950+$as_echo_n "checking whether $flexlink works... " >&6; }
1295112951+1295212952+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1295312953+/* end confdefs.h. */
1295412954+int answer = 42;
1295512955+_ACEOF
1295612956+if ac_fn_c_try_compile "$LINENO"; then :
1295712957+ # Create conftest1.$ac_objext as a symlink on Cygwin to ensure that native
1295812958+ # flexlink can cope. The reverse test is unnecessary (a Cygwin-compiled
1295912959+ # flexlink can read anything).
1296012960+ mv conftest.$ac_objext conftest1.$ac_objext
1296112961+ case $host in #(
1296212962+ *-pc-cygwin) :
1296312963+ ln -s conftest1.$ac_objext conftest2.$ac_objext ;; #(
1296412964+ *) :
1296512965+ cp conftest1.$ac_objext conftest2.$ac_objext ;;
1296612966+esac
1296712967+1296812968+ CC="$flexlink -chain $flexdll_chain -exe"
1296912969+ LIBS="conftest2.$ac_objext"
1297012970+ CPPFLAGS="$internal_cppflags $CPPFLAGS"
1297112971+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1297212972+/* end confdefs.h. */
1297312973+int main() { return 0; }
1297412974+_ACEOF
1297512975+if ac_fn_c_try_link "$LINENO"; then :
1297612976+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1297712977+$as_echo "yes" >&6; }
1297812978+else
1297912979+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1298012980+$as_echo "no" >&6; }
1298112981+ as_fn_error $? "$flexlink does not work" "$LINENO" 5
1298212982+fi
1298312983+rm -f core conftest.err conftest.$ac_objext \
1298412984+ conftest$ac_exeext conftest.$ac_ext
1298512985+else
1298612986+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unexpected compile error" >&5
1298712987+$as_echo "unexpected compile error" >&6; }
1298812988+ as_fn_error $? "error calling the C compiler" "$LINENO" 5
1298912989+fi
1299012990+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1299112991+1299212992+1299312993+ # Restore the content of confdefs.h
1299412994+ mv confdefs.h.bak confdefs.h
1299512995+ ac_compile="$saved_ac_compile"
1299612996+ ac_ext="$saved_ac_ext"
1299712997+ CPPFLAGS="$saved_CPPFLAGS"
1299812998+ CFLAGS="$saved_CFLAGS"
1299912999+ CC="$saved_CC"
1300013000+ LIBS="$saved_LIBS"
1300113001+1300213002+1300313003+1300413004+ case $host in #(
1300513005+ *-w64-mingw32|*-pc-windows) :
1300613006+ flexlink_where="$(cmd /c "$flexlink" -where 2>/dev/null)"
1300713007+ if test -z "$flexlink_where"; then :
1300813008+ as_fn_error $? "$flexlink is not executable from a native Win32 process" "$LINENO" 5
1300913009+1301013010+fi ;; #(
1301113011+ *) :
1301213012+ ;;
1301313013+esac
1301413014+1301513015+fi
1301613016+1301713017+1301813018+1301913019+ saved_CC="$CC"
1302013020+ saved_CFLAGS="$CFLAGS"
1302113021+ saved_CPPFLAGS="$CPPFLAGS"
1302213022+ saved_LIBS="$LIBS"
1302313023+ saved_ac_ext="$ac_ext"
1302413024+ saved_ac_compile="$ac_compile"
1302513025+ # Move the content of confdefs.h to another file so it does not
1302613026+ # get included
1302713027+ mv confdefs.h confdefs.h.bak
1302813028+ touch confdefs.h
1302913029+1303013030+1303113031+ if test -n "$flexdir"; then :
1303213032+ CPPFLAGS="-I $flexdir $CPPFLAGS"
1303313033+fi
1303413034+ have_flexdll_h=no
1303513035+ ac_fn_c_check_header_mongrel "$LINENO" "flexdll.h" "ac_cv_header_flexdll_h" "$ac_includes_default"
1303613036+if test "x$ac_cv_header_flexdll_h" = xyes; then :
1303713037+ have_flexdll_h=yes
1303813038+else
1303913039+ have_flexdll_h=no
1304013040+fi
1304113041+1304213042+1304313043+ if test x"$have_flexdll_h" = 'xno'; then :
1304413044+ if test -n "$flexdir"; then :
1304513045+ as_fn_error $? "$flexdir/flexdll.h appears unusable" "$LINENO" 5
1304613046+fi
1304713047+fi
1304813048+1304913049+1305013050+ # Restore the content of confdefs.h
1305113051+ mv confdefs.h.bak confdefs.h
1305213052+ ac_compile="$saved_ac_compile"
1305313053+ ac_ext="$saved_ac_ext"
1305413054+ CPPFLAGS="$saved_CPPFLAGS"
1305513055+ CFLAGS="$saved_CFLAGS"
1305613056+ CC="$saved_CC"
1305713057+ LIBS="$saved_LIBS"
1305813058+1305913059+1306013060+1306113061+ if test -n "$flexlink" -a x"$have_flexdll_h" = 'xno'; then :
1306213062+1306313063+1306413064+ saved_CC="$CC"
1306513065+ saved_CFLAGS="$CFLAGS"
1306613066+ saved_CPPFLAGS="$CPPFLAGS"
1306713067+ saved_LIBS="$LIBS"
1306813068+ saved_ac_ext="$ac_ext"
1306913069+ saved_ac_compile="$ac_compile"
1307013070+ # Move the content of confdefs.h to another file so it does not
1307113071+ # get included
1307213072+ mv confdefs.h confdefs.h.bak
1307313073+ touch confdefs.h
1307413074+1307513075+1307613076+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"$flexlink -where\" includes flexdll.h" >&5
1307713077+$as_echo_n "checking if \"$flexlink -where\" includes flexdll.h... " >&6; }
1307813078+ flexlink_where="$($flexlink -where | tr -d '\r')"
1307913079+ CPPFLAGS="$CPPFLAGS -I \"$flexlink_where\""
1308013080+ cat > conftest.c <<"EOF"
1308113081+#include <flexdll.h>
1308213082+int main (void) {return 0;}
1308313083+EOF
1308413084+ cat > conftest.Makefile <<EOF
1308513085+all:
1308613086+ $CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS
1308713087+EOF
1308813088+ if make -f conftest.Makefile >/dev/null 2>/dev/null; then :
1308913089+ have_flexdll_h=yes
1309013090+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1309113091+$as_echo "yes" >&6; }
1309213092+else
1309313093+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1309413094+$as_echo "no" >&6; }
1309513095+fi
1309613096+1309713097+1309813098+ # Restore the content of confdefs.h
1309913099+ mv confdefs.h.bak confdefs.h
1310013100+ ac_compile="$saved_ac_compile"
1310113101+ ac_ext="$saved_ac_ext"
1310213102+ CPPFLAGS="$saved_CPPFLAGS"
1310313103+ CFLAGS="$saved_CFLAGS"
1310413104+ CC="$saved_CC"
1310513105+ LIBS="$saved_LIBS"
1310613106+1310713107+1310813108+ if test "x$have_flexdll_h" = 'xyes'; then :
1310913109+ internal_cppflags="$internal_cppflags -I \"$flexlink_where\""
1311013110+fi
1311113111+1311213112+fi
1311313113+1311413114+fi
1311513115+1311613116+if test x"$have_flexdll_h" = 'xno'; then :
1311713117+ case $host in #(
1311813118+ *-*-cygwin*) :
1311913119+ if $with_sharedlibs; then :
1312013120+ with_sharedlibs=false
1312113121+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: flexdll.h not found: shared library support disabled." >&5
1312213122+$as_echo "$as_me: WARNING: flexdll.h not found: shared library support disabled." >&2;}
1312313123+1312413124+fi ;; #(
1312513125+ *-w64-mingw32|*-pc-windows) :
1312613126+ as_fn_error $? "flexdll.h is required for native Win32" "$LINENO" 5 ;; #(
1312713127+ *) :
1312813128+ ;;
1312913129+esac
1313013130+fi
1313113131+1313213132+if test -z "$flexdir" -o x"$have_flexdll_h" = 'xno'; then :
1313313133+ case $host in #(
1313413134+ *-*-cygwin*) :
1313513135+ if $with_sharedlibs; then :
1313613136+ if test -z "$flexlink"; then :
1313713137+ with_sharedlibs=false
1313813138+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: flexlink/flexdll.h not found: shared library support disabled." >&5
1313913139+$as_echo "$as_me: WARNING: flexlink/flexdll.h not found: shared library support disabled." >&2;}
1314013140+1314113141+fi
1314213142+fi ;; #(
1314313143+ *-w64-mingw32|*-pc-windows) :
1314413144+ if test -z "$flexlink"; then :
1314513145+ as_fn_error $? "flexlink is required for native Win32" "$LINENO" 5
1314613146+fi ;; #(
1314713147+ *) :
1314813148+ ;;
1314913149+esac
1279013150fi
12791131511279213152case $CC,$host in #(
···1279713157 *,*-*-haiku*) :
1279813158 mathlib="" ;; #(
1279913159 *,*-*-cygwin*) :
1280012800- case $target in #(
1280112801- i686-*) :
1280212802- flavor=cygwin ;; #(
1280312803- x86_64-*) :
1280412804- flavor=cygwin64 ;; #(
1280512805- *) :
1280612806- as_fn_error $? "unknown cygwin variant" "$LINENO" 5 ;;
1280712807-esac
1280813160 common_cppflags="$common_cppflags -U_WIN32"
1280913161 if $with_sharedlibs; then :
1281012810- flexlink="flexlink -chain $flavor -merge-manifest -stack 16777216"
1281112811- flexdir=`$flexlink -where | tr -d '\015'`
1281212812- if test -z "$flexdir"; then :
1281312813- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: flexlink not found: native shared libraries won't be available.
1281412814- " >&5
1281512815-$as_echo "$as_me: WARNING: flexlink not found: native shared libraries won't be available.
1281612816- " >&2;}
1281712817- with_sharedlibs=false
1316213162+ mkexe='$(FLEXLINK) -exe $(if $(OC_LDFLAGS),-link "$(OC_LDFLAGS)")'
1316313163+ mkexedebugflag="-link -g"
1281813164else
1281912819- iflexdir="-I\"$flexdir\""
1282012820- mkexe="$flexlink -exe"
1282112821- mkexedebugflag="-link -g"
1282212822-1282312823-fi
1282412824-1282512825-fi
1282612826- if ! $with_sharedlibs; then :
1282713165 mkexe="$mkexe -Wl,--stack,16777216"
1282813166 oc_ldflags="-Wl,--stack,16777216"
12829131671283013168fi
1283113169 ostype="Cygwin" ;; #(
1283213170 *,*-*-mingw32) :
1283312833- if $with_sharedlibs; then :
1283412834- case $host in #(
1317113171+ case $host in #(
1283513172 i686-*-*) :
1283612836- flexdll_chain="mingw"; oc_dll_ldflags="-static-libgcc" ;; #(
1283712837- x86_64-*-*) :
1283812838- flexdll_chain="mingw64" ;; #(
1317313173+ oc_dll_ldflags="-static-libgcc" ;; #(
1283913174 *) :
1284013175 ;;
1284113176esac
1284212842- flexlink="flexlink -chain $flexdll_chain -merge-manifest -stack 16777216"
1284312843- flexdir=`$flexlink -where | tr -d '\015'`
1284412844- if test -z "$flexdir"; then :
1284512845- flexdir='$(ROOTDIR)/flexdll'
1284612846-fi
1284712847- iflexdir="-I\"$flexdir\""
1284812848- mkexedebugflag="-link -g"
1284912849-fi
1317713177+ mkexedebugflag="-link -g"
1285013178 ostype="Win32"
1285113179 toolchain="mingw"
1285213180 mkexe='$(FLEXLINK) -exe $(if $(OC_LDFLAGS),-link "$(OC_LDFLAGS)")'
···1285713185 ostype="Win32"
1285813186 mkexe='$(FLEXLINK) -exe $(if $(OC_LDFLAGS),-link "$(OC_LDFLAGS)")'
1285913187 oc_ldflags='/ENTRY:wmainCRTStartup'
1286012860- case $host in #(
1286112861- i686-pc-windows) :
1286212862- flexdll_chain=msvc ;; #(
1286312863- x86_64-pc-windows) :
1286412864- flexdll_chain=msvc64 ;; #(
1286512865- *) :
1286612866- ;;
1286712867-esac
1286812868- if $with_sharedlibs; then :
1286912869- flexlink="flexlink -chain $flexdll_chain -merge-manifest -stack 16777216"
1287012870- flexdir=`$flexlink -where | tr -d '\015'`
1287112871- if test -z "$flexdir"; then :
1287212872- flexdir='$(ROOTDIR)/flexdll'
1287312873-fi
1287412874- iflexdir="-I\"$flexdir\""
1287512875- mkexedebugflag=''
1287612876-fi ;; #(
1318813188+ mkexedebugflag='' ;; #(
1287713189 *,x86_64-*-linux*) :
1287813190 $as_echo "#define HAS_ARCH_CODE32 1" >>confdefs.h
1287913191 ;; #(
···1369114003 mkmaindll='$(FLEXLINK) -maindll'
1369214004 shared_libraries_supported=$with_sharedlibs ;; #(
1369314005 *-*-cygwin*) :
1369413694- mksharedlib="$flexlink"
1369513695- mkmaindll="$flexlink -maindll"
1400614006+ mksharedlib='$(FLEXLINK)'
1400714007+ mkmaindll='$(FLEXLINK) -maindll'
1369614008 shared_libraries_supported=true ;; #(
1369714009 powerpc-ibm-aix*) :
1369814010 case $ocaml_cv_cc_vendor in #(
···1678417096 saved_CC="$CC"
1678517097 saved_CFLAGS="$CFLAGS"
1678617098 saved_CPPFLAGS="$CPPFLAGS"
1709917099+ saved_LIBS="$LIBS"
1678717100 saved_ac_ext="$ac_ext"
1678817101 saved_ac_compile="$ac_compile"
1678917102 # Move the content of confdefs.h to another file so it does not
···1682617139 CPPFLAGS="$saved_CPPFLAGS"
1682717140 CFLAGS="$saved_CFLAGS"
1682817141 CC="$saved_CC"
1714217142+ LIBS="$saved_LIBS"
168291714316830171441683117145···1684017154 saved_CC="$CC"
1684117155 saved_CFLAGS="$CFLAGS"
1684217156 saved_CPPFLAGS="$CPPFLAGS"
1715717157+ saved_LIBS="$LIBS"
1684317158 saved_ac_ext="$ac_ext"
1684417159 saved_ac_compile="$ac_compile"
1684517160 # Move the content of confdefs.h to another file so it does not
···1690517220 CPPFLAGS="$saved_CPPFLAGS"
1690617221 CFLAGS="$saved_CFLAGS"
1690717222 CC="$saved_CC"
1722317223+ LIBS="$saved_LIBS"
169081722416909172251691017226 if $aspp_ok && $as_ok; then :
···1724917565 windows_unicode=0 ;;
1725017566esac
17251175671725217252-# Define flexlink chain and flags correctly for the different Windows ports
1725317253-case $host in #(
1725417254- i686-w64-mingw32) :
1725517255- flexdll_chain='mingw'
1725617256- flexlink_flags="-chain $flexdll_chain -stack 16777216" ;; #(
1725717257- x86_64-w64-mingw32) :
1725817258- flexdll_chain='mingw64'
1725917259- flexlink_flags="-chain $flexdll_chain -stack 33554432" ;; #(
1726017260- i686-pc-windows) :
1726117261- flexdll_chain='msvc'
1726217262- flexlink_flags="-merge-manifest -stack 16777216" ;; #(
1726317263- x86_64-pc-windows) :
1726417264- flexdll_chain='msvc64'
1726517265- flexlink_flags="-x64 -merge-manifest -stack 33554432" ;; #(
1726617266- *) :
1726717267- ;;
1726817268-esac
1726917269-1727017568# Define default prefix correctly for the different Windows ports
1727117569if test x"$prefix" = "xNONE"; then :
1727217570 case $host in #(
···1732717625else
1732817626 stdlib_manpages=false
1732917627fi
1762817628+1762917629+# Do not permanently cache the result of flexdll.h
1763017630+unset ac_cv_header_flexdll_h
17330176311733117632cat >confcache <<\_ACEOF
1733217633# This file is a shell script that caches the results of configure
···5858let default_rpath = "%%RPATH%%"
5959let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%"
6060let ar = "%%ARCMD%%"
6161+let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%%
6162let mkdll, mkexe, mkmaindll =
6263 (* @@DRA Cygwin - but only if shared libraries are enabled, which we
6364 should be able to detect? *)
6464- if Sys.os_type = "Win32" then
6565+ if Sys.win32 || Sys.cygwin && supports_shared_libraries then
6566 try
6667 let flexlink =
6768 let flexlink = Sys.getenv "OCAML_FLEXLINK" in
6869 let f i =
6970 let c = flexlink.[i] in
7070- if c = '/' then '\\' else c in
7171+ if c = '/' && Sys.win32 then '\\' else c in
7172 (String.init (String.length flexlink) f) ^ " %%FLEXLINK_FLAGS%%" in
7273 flexlink ^ "%%FLEXLINK_DLL_LDFLAGS%%",
7374 flexlink ^ " -exe%%FLEXLINK_LDFLAGS%%",
···8384let safe_string = %%FORCE_SAFE_STRING%%
8485let default_safe_string = %%DEFAULT_SAFE_STRING%%
8586let windows_unicode = %%WINDOWS_UNICODE%% != 0
8686-let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%%
87878888let flat_float_array = %%FLAT_FLOAT_ARRAY%%
8989