[Git][ghc/ghc][wip/rts-configure] Get rid of all mention of `mk/config.h`

John Ericson (@Ericson2314) gitlab at gitlab.haskell.org
Thu Oct 12 16:40:57 UTC 2023



John Ericson pushed to branch wip/rts-configure at Glasgow Haskell Compiler / GHC


Commits:
ac288d14 by John Ericson at 2023-10-12T12:40:42-04:00
Get rid of all mention of `mk/config.h`

The RTS configure script is now solely responsible for managing its
headers; the top level configure script does not help.

- - - - -


7 changed files:

- .gitignore
- compiler/GHC/Builtin/primops.txt.pp
- configure.ac
- distrib/cross-port
- docs/coding-style.html
- hadrian/src/Rules/SourceDist.hs
- rts/configure.ac


Changes:

=====================================
.gitignore
=====================================
@@ -184,8 +184,8 @@ _darcs/
 /linter.log
 /mk/are-validating.mk
 /mk/build.mk
-/mk/config.h
-/mk/config.h.in
+/mk/unused.h
+/mk/unused.h.in
 /mk/config.mk
 /mk/config.mk.old
 /mk/system-cxx-std-lib-1.0.conf


=====================================
compiler/GHC/Builtin/primops.txt.pp
=====================================
@@ -229,7 +229,7 @@ section "The word size story."
          must contain at least 30 bits. GHC always implements
          'Int' using the primitive type 'Int#', whose size equals
          the @MachDeps.h@ constant @WORD\_SIZE\_IN\_BITS at .
-         This is normally set based on the @config.h@ parameter
+         This is normally set based on the RTS @ghcautoconf.h@ parameter
          @SIZEOF\_HSWORD@, i.e., 32 bits on 32-bit machines, 64
          bits on 64-bit machines.
 


=====================================
configure.ac
=====================================
@@ -32,8 +32,8 @@ AC_CONFIG_MACRO_DIRS([m4])
 # checkout), then we ship a file 'VERSION' containing the full version
 # when the source distribution was created.
 
-if test ! -f mk/config.h.in; then
-   echo "mk/config.h.in doesn't exist: perhaps you haven't run 'python3 boot'?"
+if test ! -f rts/ghcautoconf.h.autoconf.in; then
+   echo "rts/ghcautoconf.h.autoconf.in doesn't exist: perhaps you haven't run 'python3 boot'?"
    exit 1
 fi
 
@@ -101,8 +101,11 @@ AC_PREREQ([2.69])
 # Prepare to generate the following header files
 #
 
-# This one is autogenerated by autoheader.
-AC_CONFIG_HEADER(mk/config.h)
+dnl so the next header, which is manually maintained, doesn't get
+dnl overwritten by an autogenerated header. Once we have no more
+dnl `AC_CONFIG_HEADER` calls (issue #23966) we can delete all mention
+dnl of `mk/unused.h`.
+AC_CONFIG_HEADER(mk/unused.h)
 # This one is manually maintained.
 AC_CONFIG_HEADER(compiler/ghc-llvm-version.h)
 dnl manually outputted above, for reasons described there.


=====================================
distrib/cross-port
=====================================
@@ -28,7 +28,7 @@ if [ ! -f b1-stamp ]; then
 
    # For cross-compilation, at this stage you may want to set up a source
    # tree on the target machine, run the configure script there, and bring
-   # the resulting mk/config.h file back into this tree before building
+   # the resulting rts/ghcautoconf.h.autoconf file back into this tree before building
    # the libraries.
 
    touch mk/build.mk
@@ -38,7 +38,7 @@ if [ ! -f b1-stamp ]; then
 
    # We could optimise slightly by not building hslibs here.  Also, building
    # the RTS is not necessary (and might not be desirable if we're using
-   # a config.h from the target system).
+   # a ghcautoconf.h from the target system).
    make stage1
 
   cd ..


=====================================
docs/coding-style.html
=====================================
@@ -108,7 +108,7 @@ POSIX-compliant to explicitly say so by having <code>#include
 
 <p><li> Some architectures have memory alignment constraints.  Others
 don't have any constraints but go faster if you align things.  These
-macros (from <tt>config.h</tt>) tell you which alignment to use
+macros (from <tt>ghcautoconf.h</tt>) tell you which alignment to use
 
 <pre>
   /* minimum alignment of unsigned int */


=====================================
hadrian/src/Rules/SourceDist.hs
=====================================
@@ -156,7 +156,8 @@ prepareTree dest = do
       , pkgPath terminfo -/- "configure"
       , "configure"
       , "aclocal.m4"
-      , "mk" -/- "config.h.in" ]
+      , "mk" -/- "unused.h.in"
+      ]
 
     copyAlexHappyFiles =
       forM_ alexHappyFiles $ \(stg, pkg, inp, out) -> do


=====================================
rts/configure.ac
=====================================
@@ -390,9 +390,9 @@ touch include/ghcautoconf.h
 
 echo "#if !defined(__GHCAUTOCONF_H__)" >> include/ghcautoconf.h
 echo "#define __GHCAUTOCONF_H__" >> include/ghcautoconf.h
-# Copy the contents of $srcdir/../mk/config.h, turning '#define PACKAGE_FOO
+# Copy the contents of ghcautoconf.h.autoconf, turning '#define PACKAGE_FOO
 # "blah"' into '/* #undef PACKAGE_FOO */' to avoid clashes.
-cat $srcdir/../mk/config.h ghcautoconf.h.autoconf | sed \
+cat ghcautoconf.h.autoconf | sed \
    -e 's,^\([	 ]*\)#[	 ]*define[	 ][	 ]*\(PACKAGE_[A-Z]*\)[	 ][ 	]*".*".*$,\1/* #undef \2 */,' \
    -e '/__GLASGOW_HASKELL/d' \
    -e '/REMOVE ME/d' \



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ac288d14bb99657393ff69a607c568702d3c65c7

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ac288d14bb99657393ff69a607c568702d3c65c7
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231012/495b6e2e/attachment-0001.html>


More information about the ghc-commits mailing list