Skip to content

Commit

Permalink
Control C stubs compilation using enabled_if
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Feb 6, 2023
1 parent 82772fa commit 70c1893
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 36 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ src/manifest/install.inc
src/stubs/libacl/dune
src/stubs/libacl/c-libraries.sexp
src/stubs/win32/cc64
src/stubs/win32/dune
src/stubs/c-flags.sexp
# doc
doc/dev-manual/*aux
Expand Down
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ DUNE_ARGS ?= $(JBUILDER_ARGS)
DUNE_PROFILE ?= release

ifeq ($(DUNE_PROFILE_ARG),release)
# TODO Replace with --release when we require dune >= 2.5
DUNE_PROFILE_ARG = --profile=release
else
DUNE_PROFILE_ARG = --profile=$(DUNE_PROFILE)
DUNE_PROFILE_ARG = --release
endif

src_ext/dune-local/dune.exe: src_ext/dune-local.stamp $(DUNE_SECONDARY)
Expand Down Expand Up @@ -102,7 +99,7 @@ clean:
distclean: clean clean-ext
rm -rf autom4te.cache bootstrap
rm -f Makefile.config config.log config.status aclocal.m4
rm -f src/*.META src/*/.merlin src/manifest/dune src/manifest/install.inc src/stubs/libacl/dune src/stubs/win32/dune src/stubs/win32/cc64 src/ocaml-flags-configure.sexp src/stubs/libacl/c-libraries.sexp
rm -f src/*.META src/*/.merlin src/manifest/dune src/manifest/install.inc src/stubs/libacl/dune src/stubs/win32/cc64 src/ocaml-flags-configure.sexp src/stubs/libacl/c-libraries.sexp
rm -f src/client/linking.sexp src/stubs/c-flags.sexp src/core/developer src/core/version

OPAMINSTALLER_FLAGS = --prefix "$(call CYGPATH,$(DESTDIR)$(prefix))"
Expand Down
9 changes: 0 additions & 9 deletions configure

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

6 changes: 0 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,6 @@ AS_IF([test "x${with_private_runtime}" != "xno"],[
])
])

rm -f src/stubs/win32/dune
AS_IF([ test ${WIN32} -eq 1],[
cd src/stubs/win32
${LN_S} -f dune-win32 dune
cd ../../..
])
rm -f src/stubs/libacl/dune
AS_IF([ test "x${with_libacl}" = "xyes" ],[
cd src/stubs/libacl
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(lang dune 2.0)
(lang dune 2.6)
(name opam)
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ users)
* Remove unused variable in opamACL.c [#5403 @purplearmadillo77]
* Upgrade spdx_licenses to 1.2.0 [#5412 @kit-ty-kate]
* Upgrade the vendored sha to 1.15.4 [#5424 @kit-ty-kate]
* Control the Windows stubs using `(enabled_if)` [#4777 @dra27 - fix #4726]

## Infrastructure
* Fix caching of Cygwin compiler on AppVeyor [#4988 @dra27]
Expand Down
2 changes: 1 addition & 1 deletion opam-admin.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ homepage: "https://opam.ocaml.org/"
bug-reports: "https://github.com/ocaml/opam/issues"
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
depends: [
"dune" {>= "2.0.0"}
"dune" {>= "2.6.0"}
"re" {>= "1.9.0"}
"opam-file-format" {>= "2.1.4"}
]
2 changes: 1 addition & 1 deletion opam-client.opam
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ depends: [
"opam-repository" {= version}
"re" {>= "1.9.0"}
"cmdliner" {>= "1.1.0"}
"dune" {>= "2.0.0"}
"dune" {>= "2.6.0"}
]
conflicts: [
"extlib" {< "1.7.8"}
Expand Down
3 changes: 1 addition & 2 deletions opam-core.opam
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ bug-reports: "https://github.com/ocaml/opam/issues"
dev-repo: "git+https://github.com/ocaml/opam.git"
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
build: [
["./configure" "--disable-checks" "--prefix" prefix]
["dune" "build" "-p" name "-j" jobs]
]
depends: [
Expand All @@ -31,7 +30,7 @@ depends: [
"base-bigarray"
"ocamlgraph"
"re" {>= "1.9.0"}
"dune" {>= "2.0.0"}
"dune" {>= "2.6.0"}
"cppo" {build & >= "1.1.0"}
"sha" {>= "1.13"}
"jsonm"
Expand Down
2 changes: 1 addition & 1 deletion opam-devel.opam
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ depends: [
"ocaml" {>= "4.08.0"}
"opam-client" {= version}
"cmdliner" {>= "1.1.0"}
"dune" {>= "2.0.0"}
"dune" {>= "2.6.0"}
"conf-openssl" {with-test}
"conf-diffutils" {with-test}
]
Expand Down
3 changes: 1 addition & 2 deletions opam-format.opam
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ bug-reports: "https://github.com/ocaml/opam/issues"
dev-repo: "git+https://github.com/ocaml/opam.git"
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
build: [
["./configure" "--disable-checks" "--prefix" prefix]
["dune" "build" "-p" name "-j" jobs]
]
depends: [
"ocaml" {(>= "4.03.0" & os != "win32") | >= "4.06.0"}
"opam-core" {= version}
"opam-file-format" {>= "2.1.4"}
"re" {>= "1.9.0"}
"dune" {>= "2.0.0"}
"dune" {>= "2.6.0"}
]
2 changes: 1 addition & 1 deletion opam-installer.opam
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ depends: [
"ocaml" {(>= "4.03.0" & os != "win32") | >= "4.06.0"}
"opam-format" {= version}
"cmdliner" {>= "0.9.8"}
"dune" {>= "2.0.0"}
"dune" {>= "2.6.0"}
]
2 changes: 1 addition & 1 deletion opam-repository.opam
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ build: [
depends: [
"ocaml" {>= "4.08.0"}
"opam-format" {= version}
"dune" {>= "2.0.0"}
"dune" {>= "2.6.0"}
]
2 changes: 1 addition & 1 deletion opam-solver.opam
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ depends: [
"dose3" {>= "6.1"}
"cudf" {>= "0.7"}
"re" {>= "1.9.0"}
"dune" {>= "2.0.0"}
"dune" {>= "2.6.0"}
"opam-0install-cudf" {>= "0.4"}
]
depopts: [
Expand Down
2 changes: 1 addition & 1 deletion opam-state.opam
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ depends: [
"opam-repository" {= version}
"re" {>= "1.9.0"}
"spdx_licenses" {>= "1.0.0"}
"dune" {>= "2.0.0"}
"dune" {>= "2.6.0"}
]
2 changes: 1 addition & 1 deletion opam.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ homepage: "https://opam.ocaml.org/"
bug-reports: "https://github.com/ocaml/opam/issues"
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
depends: [
"dune" {>= "2.0.0"}
"dune" {>= "2.6.0"}
"opam-client" {= version}
]
6 changes: 4 additions & 2 deletions src/stubs/win32/dune-win32 → src/stubs/win32/dune
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
(:include ../c-flags.sexp)))
(c_library_flags (:standard
(:include c-libraries.sexp)))
(wrapped false))
(wrapped false)
(enabled_if (= %{os_type} "Win32")))

(rule
(copy opamWin32Stubs.ml opamWin32Stubs.mli))
Expand All @@ -34,7 +35,8 @@
(install
(section bin)
(package opam)
(files opam-putenv.exe))
(files opam-putenv.exe)
(enabled_if (= %{os_type} "Win32")))

(rule
(with-stdout-to c-libraries.sexp (run ocaml %{dep:../../../shell/context_flags.ml} clibs)))

0 comments on commit 70c1893

Please sign in to comment.