summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSébastien Hinderer <Sebastien.Hinderer@inria.fr>2021-08-31 18:17:03 +0200
committerSébastien Hinderer <Sebastien.Hinderer@inria.fr>2021-10-08 12:20:06 +0200
commitc71428e7a3c69f3478c92b8c92918e51aafe311d (patch)
tree8f568d965b1bcfd0f13b8c1a759023ff47c89140 /tools
parentb9ec96722d45dab17dc58f0d037a60d1b3343913 (diff)
downloadocaml-c71428e7a3c69f3478c92b8c92918e51aafe311d.tar.gz
Transform runtime/caml/version.h into a configured header
This means that, before this commit, runtime/caml/version.h was generated during the build process by a recipe found in runtime/Makefile. After this commit, runtime/caml/version.h is generated by the configure script from runtime/caml/version.h.in This commit makes an effort to guarantee that the version.h file generated by configure is as similar as possible to the one produced by the make recipe before, that's why runtime/caml/version.h.in contains no copyright notice at this stage. It will be added in the following commit. At this stage, the only difference between the two versions of version.h (the one generated by make before and the one generated by configure now) is the coment line produced by configure as the first line of version.h, namely: /* runtime/caml/version.h. Generated from version.h.in by configure. */ but this cannot be avoided and is harmless.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/make-version-header.sh55
1 files changed, 0 insertions, 55 deletions
diff --git a/tools/make-version-header.sh b/tools/make-version-header.sh
deleted file mode 100755
index b91fba6c2d..0000000000
--- a/tools/make-version-header.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-#**************************************************************************
-#* *
-#* OCaml *
-#* *
-#* Damien Doligez, projet Gallium, INRIA Rocquencourt *
-#* *
-#* Copyright 2003 Institut National de Recherche en Informatique et *
-#* en Automatique. *
-#* *
-#* All rights reserved. As an exception to the licensing rules of *
-#* OCaml, this file is freely redistributable, modified or not, *
-#* without constraints. *
-#* *
-#**************************************************************************
-
-# This script extracts the components from an OCaml version number
-# and provides them as C defines:
-# OCAML_VERSION_MAJOR: the major version number
-# OCAML_VERSION_MAJOR: the minor version number
-# OCAML_VERSION_PATCHLEVEL: the patchlevel number if present, or 0 if absent
-# OCAML_VERSION_ADDITIONAL: this is defined only if the additional-info
-# field is present, and is a string that contains that field.
-# Note that additional-info is always absent in officially-released
-# versions of OCaml.
-
-# usage:
-# make-version-header.sh [version-file]
-# The argument is the VERSION file from the OCaml sources.
-# If the argument is not given, the version number from "ocamlc -v" will
-# be used.
-
-case $# in
- 0) version="`ocamlc -v | tr -d '\r' | sed -n -e 's/.*version //p'`";;
- 1) version="`sed -e 1q "$1" | tr -d '\r'`";;
- *) echo "usage: make-version-header.sh [version-file]" >&2
- exit 2;;
-esac
-
-major="`echo "$version" | sed -n -e '1s/^\([0-9]*\)\..*/\1/p'`"
-minor="`echo "$version" | sed -n -e '1s/^[0-9]*\.0*\([0-9]*\).*/\1/p'`"
-patchlvl="`echo "$version" | sed -n -e '1s/^[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/p'`"
-suffix="`echo "$version" | sed -n -e '1s/^[^+~]*[+~]\(.*\)/\1/p'`"
-
-echo "#define OCAML_VERSION_MAJOR $major"
-printf '#define OCAML_VERSION_MINOR %d\n' "$minor"
-case $patchlvl in "") patchlvl=0;; esac
-echo "#define OCAML_VERSION_PATCHLEVEL $patchlvl"
-case "$suffix" in
- "") echo "#undef OCAML_VERSION_ADDITIONAL";;
- *) echo "#define OCAML_VERSION_ADDITIONAL \"$suffix\"";;
-esac
-printf '#define OCAML_VERSION %d%02d%02d\n' "$major" "$minor" "$patchlvl"
-echo "#define OCAML_VERSION_STRING \"$version\""