--- ocaml-5.4.0/configure	2026-03-11 20:48:20.896212520 -0500
+++ ocaml-5.4.0/configure	2026-03-11 20:49:02.433464677 -0500
@@ -6972,7 +6972,7 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-solaris*)
+solaris*|hammerhead*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -7777,7 +7777,7 @@
 osf*)
   symcode='[BCDEGQRST]'
   ;;
-solaris*)
+solaris*|hammerhead*)
   symcode='[BCDRT]'
   ;;
 sco3.2v5*)
@@ -8409,7 +8409,7 @@
     CFLAGS=$SAVE_CFLAGS
   fi
   ;;
-*-*solaris*)
+*-*solaris*|*-*hammerhead*)
   # Find out what ABI is being produced by ac_compile, and set linker
   # options accordingly.
   echo 'int i;' > conftest.$ac_ext
@@ -8423,7 +8423,7 @@
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $target in
-        i?86-*-solaris*|x86_64-*-solaris*)
+        i?86-*-solaris*|x86_64-*-solaris*|x86_64-*-hammerhead*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -10296,7 +10296,7 @@
     serenity*)
       ;;
 
-    solaris*)
+    solaris*|hammerhead*)
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
       case $cc_basename in
@@ -10948,7 +10948,7 @@
       fi
       ;;
 
-    solaris*)
+    solaris*|hammerhead*)
       if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
@@ -11744,7 +11744,7 @@
     serenity*)
       ;;
 
-    solaris*)
+    solaris*|hammerhead*)
       no_undefined_flag=' -z defs'
       if test yes = "$GCC"; then
 	wlarc='$wl'
@@ -12931,7 +12931,7 @@
   dynamic_linker='SerenityOS LibELF'
   ;;
 
-solaris*)
+solaris*|hammerhead*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -13331,7 +13331,7 @@
     serenity*)
       ;;
 
-    solaris*)
+    solaris*|hammerhead*)
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
       case $cc_basename in
@@ -18239,7 +18239,7 @@
   *) :
      ;;
 esac ;; #(
-  *-*-solaris*) :
+  *-*-solaris*|*-*-hammerhead*) :
     sharedlib_cflags="-fPIC"
       mkdll_flags='-shared'
       rpath="-Wl,-rpath,"
@@ -18334,7 +18334,7 @@
     natdynlink=true ;; #(
   powerpc*-*-linux*) :
     natdynlink=true ;; #(
-  x86_64-*-solaris*) :
+  x86_64-*-solaris*|x86_64-*-hammerhead*) :
     natdynlink=true ;; #(
   i686-*-kfreebsd*) :
     natdynlink=true ;; #(
@@ -18576,7 +18576,7 @@
     has_native_backend=yes; arch=amd64; system=linux ;; #(
   x86_64-*-dragonfly*) :
     arch=amd64; system=dragonfly ;; #(
-  x86_64-*-solaris*) :
+  x86_64-*-solaris*|x86_64-*-hammerhead*) :
     has_native_backend=yes; arch=amd64; system=solaris ;; #(
   x86_64-*-freebsd*) :
     has_native_backend=yes; arch=amd64; system=freebsd ;; #(
@@ -20022,7 +20022,7 @@
 
 fi
  ;; #(
-  *-*-solaris*) :
+  *-*-solaris*|*-*-hammerhead*) :
     cclibs="$cclibs -lsocket -lnsl"
     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
 printf %s "checking for library containing socket... " >&6; }
@@ -22132,7 +22132,7 @@
 
         ;;
 
-        solaris*)
+        solaris*|hammerhead*)
 
         # On Solaris (at least, for some versions), libc contains stubbed
         # (non-functional) versions of the pthreads routines, so link-based
@@ -22208,7 +22208,7 @@
 # correctly enabled
 
 case $host_os in
-        darwin* | hpux* | linux* | osf* | solaris*)
+        darwin* | hpux* | linux* | osf* | solaris*|hammerhead*)
         ax_pthread_check_macro="_REENTRANT"
         ;;
 
@@ -22533,7 +22533,7 @@
 else $as_nop
   ax_cv_PTHREAD_SPECIAL_FLAGS=no
              case $host_os in
-             solaris*)
+             solaris*|hammerhead*)
              ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
              ;;
              esac
@@ -23608,7 +23608,7 @@
 
     printf "%s\n" "#define HAS_NICE 1" >>confdefs.h
  ;; #(
-  *-*-solaris*) :
+  *-*-solaris*|*-*-hammerhead*) :
     # This is required as otherwise floats are printed
     # as "Infinity" and "Inf" instead of the expected "inf"
     printf "%s\n" "#define HAS_BROKEN_PRINTF 1" >>confdefs.h
