Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect use of AC_ARG_ENABLE #2419

Merged
merged 2 commits into from
Apr 10, 2024
Merged
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
25 changes: 16 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -48,45 +48,52 @@ AC_ARG_ENABLE([middle-end],
AC_ARG_ENABLE([runtime5],
[AS_HELP_STRING([--enable-runtime5],
[Use the OCaml 5 runtime])],
[runtime5_arg=--enable-runtime5],
[runtime5_arg=])
[],
[enable_runtime5=no])

AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage],
[Run compiler tests instrumented to output coverage data using bisect_ppx
(WARNING: Cannot build an installable compiler with this flag enabled.
Mainly intended for use in CI.)])],
[coverage=yes],
[coverage=no])
[],
[enable_coverage=no])

AC_ARG_ENABLE([legacy-library-layout],
[AS_HELP_STRING([--enable-legacy-library-layout],
[Install libraries unix, str, dynlink and bigarray in the toplevel
ocaml library directory (Same as upstream OCaml < 5.0)])],
[legacy_layout=yes],
[legacy_layout=no])
[],
[enable_legacy_layout=no])

AC_ARG_ENABLE([dev],
[AS_HELP_STRING([--enable-dev],
[Use the dev build profile for dune when building the 2nd stage.
Can speed up the compile time by a lot. (WARNING: do not use for
production compiler deployments)])],
[main_build_profile=dev],
[main_build_profile=main])
[],
[enable_dev=no])

AC_SUBST([prefix])
AC_SUBST([middle_end])
AC_SUBST([dune])

coverage="$enable_coverage"
AC_SUBST([coverage])

legacy_layout="$enable_legacy_layout"
AC_SUBST([legacy_layout])

main_build_profile=main
AS_IF([test x"$enable_dev" = xyes], [main_build_profile=dev])
AC_SUBST([main_build_profile])

# Don't error on options that this configure script doesn't understand but
# the ocaml/ one does.
AC_DISABLE_OPTION_CHECKING

AX_SUBDIRS_CONFIGURE([ocaml],
[$middle_end_arg,$runtime5_arg,-C,--disable-ocamldoc,--disable-stdlib-manpages,--enable-ocamltest,--without-zstd],
[$middle_end_arg,--enable-runtime5=$enable_runtime5,-C,--disable-ocamldoc,--disable-stdlib-manpages,--enable-ocamltest,--without-zstd],
[],
[],
[])
Expand Down
6 changes: 1 addition & 5 deletions ocaml/Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,7 @@ POLL_INSERTION=@poll_insertion@
DUNE=@dune@

# Selection of OCaml 4.x or 5.x runtime
ifeq "@enable_runtime5@" "yes"
RUNTIME_SUFFIX=
else
RUNTIME_SUFFIX=4
endif
RUNTIME_SUFFIX=@runtime_suffix@
RUNTIME_DIR=runtime$(RUNTIME_SUFFIX)

# Deprecated variables
Expand Down
8 changes: 8 additions & 0 deletions ocaml/configure

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

4 changes: 4 additions & 0 deletions ocaml/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ AC_CONFIG_AUX_DIR([build-aux])
AC_ARG_ENABLE([runtime5],
[AS_HELP_STRING([--enable-runtime5],
[Use the OCaml 5 runtime])])
AS_IF([test x"$enable_runtime5" = xyes],
[runtime_suffix=],
[runtime_suffix=4])

## Output variables

AC_SUBST([enable_runtime5])
AC_SUBST([runtime_suffix])
AC_SUBST([CONFIGURE_ARGS])
AC_SUBST([native_compiler])
AC_SUBST([default_build_target])
Expand Down
Loading