Skip to content

Commit

Permalink
Use autoheader to generate the configuration header
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterDA committed Jan 4, 2025
1 parent 957da52 commit ffa9fe8
Show file tree
Hide file tree
Showing 16 changed files with 712 additions and 126 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ META
/config.log
/config.status
/configure~
/runtime/caml/config.h.in~
/flexlink.opt
/libtool
/ocamlc.opt
Expand Down Expand Up @@ -235,8 +236,7 @@ META

/runtime/domain_state.inc
/runtime/caml/jumptbl.h
/runtime/caml/m.h
/runtime/caml/s.h
/runtime/caml/config.h
/runtime/primitives
/runtime/primitives*.new
/runtime/prims.c
Expand Down
7 changes: 3 additions & 4 deletions INSTALL.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ From the top directory, do:

./configure

This generates the three configuration files `Makefile.config`,
`runtime/caml/m.h` and `runtime/caml/s.h`.
This generates the two configuration files `Makefile.config`,
`runtime/caml/config.h`.

The `configure` script accepts options that can be discovered by running:

Expand Down Expand Up @@ -95,8 +95,7 @@ files cause errors later on, then look at the template files:

Makefile.config.in
Makefile.build_config.in
runtime/caml/m.h.in
runtime/caml/s.h.in
runtime/caml/config.h.in
+
for guidance on how to edit the generated files by hand.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ runtime_NATIVE_C_SOURCES = \

## Header files generated by configure
runtime_CONFIGURED_HEADERS = \
$(addprefix runtime/caml/, exec.h m.h s.h version.h)
$(addprefix runtime/caml/, exec.h config.h version.h)

## Header files generated by make
runtime_BUILT_HEADERS = $(addprefix runtime/, \
Expand Down
12 changes: 6 additions & 6 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ AC_DEFUN([OCAML_SIGNAL_HANDLERS_SEMANTICS], [
AC_CHECK_FUNC([sigaction], [has_sigaction=true], [has_sigaction=false])
AC_CHECK_FUNC([sigprocmask], [has_sigprocmask=true], [has_sigprocmask=false])
AS_IF([$has_sigaction && $has_sigprocmask],
[AC_DEFINE([POSIX_SIGNALS], [1])
[AC_DEFINE([POSIX_SIGNALS], [1], [TODO])
AC_MSG_NOTICE([POSIX signal handling found.])],
[AC_MSG_NOTICE([assuming signals have the System V semantics.])
]
Expand All @@ -112,7 +112,7 @@ AC_DEFUN([OCAML_CC_SUPPORTS_TREE_VECTORIZE], [
])
])
AS_IF([test "x$ocaml_cv_prog_cc_tree_vectorize" = xyes],
[AC_DEFINE([SUPPORTS_TREE_VECTORIZE], [1])])
[AC_DEFINE([SUPPORTS_TREE_VECTORIZE], [1], [TODO])])
])

# Save C compiler related variables
Expand Down Expand Up @@ -217,7 +217,7 @@ camlPervasives__loop_1128:
AS_CASE([$ocaml_cv_prog_as_cfi_directives],
[yes],
[asm_cfi_supported=true
AC_DEFINE([ASM_CFI_SUPPORTED], [1])],
AC_DEFINE([ASM_CFI_SUPPORTED], [1], [TODO])],
[no|disabled], [asm_cfi_supported=false],
[AC_MSG_ERROR([exiting])])
])
Expand Down Expand Up @@ -284,8 +284,8 @@ AC_DEFUN([OCAML_MMAP_SUPPORTS_HUGE_PAGES], [
[ocaml_cv_func_mmap_huge_pages=no],
[ocaml_cv_func_mmap_huge_pages='no assumed'])])
AS_IF([test "x$ocaml_cv_prog_cc_func_mmap_huge_pages" = xyes],
[AC_DEFINE([HAS_HUGE_PAGES], [1])
AC_DEFINE_UNQUOTED([HUGE_PAGE_SIZE], [(4 * 1024 * 1024)])])
[AC_DEFINE([HAS_HUGE_PAGES], [1], [TODO])
AC_DEFINE_UNQUOTED([HUGE_PAGE_SIZE], [(4 * 1024 * 1024)], [TODO])])
])

AC_DEFUN([OCAML_CHECK_LIBUNWIND], [
Expand All @@ -294,7 +294,7 @@ AC_DEFUN([OCAML_CHECK_LIBUNWIND], [
CPPFLAGS="$CPPFLAGS $libunwind_cppflags"
LDFLAGS="$LDFLAGS $libunwind_ldflags"
AC_CHECK_HEADER([libunwind.h],
[AC_DEFINE([HAS_LIBUNWIND], [1])
[AC_DEFINE([HAS_LIBUNWIND], [1], [TODO])
libunwind_available=true],
[libunwind_available=false])
LDFLAGS="$SAVED_LDFLAGS"
Expand Down
Loading

0 comments on commit ffa9fe8

Please sign in to comment.