The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

configure: cache mmap MAP_STACK detection

Co-authored-by: David Allsopp <david.allsopp@metastack.com>

+56 -42
+9 -6
aclocal.m4
··· 222 222 223 223 AC_DEFUN([OCAML_MMAP_SUPPORTS_MAP_STACK], [ 224 224 AC_MSG_CHECKING([whether mmap supports MAP_STACK]) 225 - AC_RUN_IFELSE( 226 - [AC_LANG_PROGRAM([[ 225 + AC_CACHE_VAL([ocaml_cv_func_mmap_MAP_STACK], 226 + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ 227 227 #include <sys/mman.h> 228 228 #include <stdio.h> 229 229 #include <stdlib.h> ··· 235 235 if (block == MAP_FAILED) 236 236 return 1; 237 237 ]])], 238 - [has_mmap_map_stack=true 239 - AC_MSG_RESULT([yes])], 240 - [AC_MSG_RESULT([no])], 241 - [AC_MSG_RESULT([no assumed])]) 238 + [ocaml_cv_func_mmap_MAP_STACK=yes], 239 + [ocaml_cv_func_mmap_MAP_STACK=no], 240 + [ocaml_cv_func_mmap_MAP_STACK=no])]) 241 + AS_IF([test $cross_compiling = yes && \ 242 + test "x$ocaml_cv_func_mmap_MAP_STACK" = xno], 243 + [AC_MSG_RESULT([no assumed])], 244 + [AC_MSG_RESULT([$ocaml_cv_func_mmap_MAP_STACK])]) 242 245 ]) 243 246 244 247 AC_DEFUN([OCAML_MMAP_SUPPORTS_HUGE_PAGES], [
+35 -22
configure
··· 24170 24170 24171 24171 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mmap supports MAP_STACK" >&5 24172 24172 printf %s "checking whether mmap supports MAP_STACK... " >&6; } 24173 + if test ${ocaml_cv_func_mmap_MAP_STACK+y} 24174 + then : 24175 + printf %s "(cached) " >&6 24176 + else $as_nop 24173 24177 if test "$cross_compiling" = yes 24174 24178 then : 24175 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no assumed" >&5 24176 - printf "%s\n" "no assumed" >&6; } 24179 + ocaml_cv_func_mmap_MAP_STACK=no 24177 24180 else $as_nop 24178 24181 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 24179 24182 /* end confdefs.h. */ ··· 24199 24202 _ACEOF 24200 24203 if ac_fn_c_try_run "$LINENO" 24201 24204 then : 24202 - has_mmap_map_stack=true 24203 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 24204 - printf "%s\n" "yes" >&6; } 24205 + ocaml_cv_func_mmap_MAP_STACK=yes 24205 24206 else $as_nop 24206 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 24207 - printf "%s\n" "no" >&6; } 24207 + ocaml_cv_func_mmap_MAP_STACK=no 24208 24208 fi 24209 24209 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ 24210 24210 conftest.$ac_objext conftest.beam conftest.$ac_ext 24211 24211 fi 24212 24212 24213 + fi 24213 24214 24214 - if test x"$enable_mmap_map_stack" = "xyes" 24215 + if test $cross_compiling = yes && \ 24216 + test "x$ocaml_cv_func_mmap_MAP_STACK" = xno 24215 24217 then : 24216 - if test x"$has_mmap_map_stack" = "xtrue" 24218 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no assumed" >&5 24219 + printf "%s\n" "no assumed" >&6; } 24220 + else $as_nop 24221 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_func_mmap_MAP_STACK" >&5 24222 + printf "%s\n" "$ocaml_cv_func_mmap_MAP_STACK" >&6; } 24223 + fi 24224 + 24225 + if test "x$enable_mmap_map_stack" = xyes 24226 + then : 24227 + if test "x$ocaml_cv_func_mmap_MAP_STACK" = xyes 24217 24228 then : 24218 24229 case $target in #( 24219 24230 *-freebsd*) : 24220 - as_fn_error $? "mmap MAP_STACK not supported on FreeBSD" "$LINENO" 5 ;; #( 24231 + as_fn_error $? "mmap MAP_STACK is not supported on FreeBSD" "$LINENO" 5 ;; #( 24221 24232 *) : 24222 - with_mmap_map_stack=true; 24223 - printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h 24224 - ;; 24233 + ;; 24225 24234 esac 24226 24235 else $as_nop 24227 24236 as_fn_error $? "mmap MAP_STACK requested but not found on $target" "$LINENO" 5 24228 24237 fi 24229 - 24230 24238 else $as_nop 24231 - case $target in #( 24232 - *-openbsd*) : 24233 - with_mmap_map_stack=true; 24234 - printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h 24235 - 24236 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using MAP_STACK on OpenBSD due to stack checking" >&5 24237 - printf "%s\n" "$as_me: using MAP_STACK on OpenBSD due to stack checking" >&6;} ;; #( 24239 + case $target,$ocaml_cv_func_mmap_MAP_STACK,$enable_mmap_map_stack in #( 24240 + *-openbsd*,no,*|*-openbsd-*,*,no) : 24241 + as_fn_error $? "mmap MAP_STACK is required on OpenBSD" "$LINENO" 5 ;; #( 24242 + *-openbsd*,*,*) : 24243 + enable_mmap_map_stack=yes 24244 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using MAP_STACK on OpenBSD due to stack checking" >&5 24245 + printf "%s\n" "$as_me: Using MAP_STACK on OpenBSD due to stack checking" >&6;} ;; #( 24238 24246 *) : 24239 - with_mmap_map_stack=false ;; 24247 + ;; 24240 24248 esac 24249 + fi 24250 + if test x"$ocaml_cv_func_mmap_MAP_STACK$enable_mmap_map_stack" = xyesyes 24251 + then : 24252 + 24253 + printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h 24241 24254 24242 24255 fi 24243 24256
+12 -14
configure.ac
··· 2903 2903 flat_float_array=true]) 2904 2904 2905 2905 OCAML_MMAP_SUPPORTS_MAP_STACK 2906 - AS_IF([test x"$enable_mmap_map_stack" = "xyes"], 2907 - [AS_IF([test x"$has_mmap_map_stack" = "xtrue"], 2906 + AS_IF([test "x$enable_mmap_map_stack" = xyes], 2907 + [AS_IF([test "x$ocaml_cv_func_mmap_MAP_STACK" = xyes], 2908 2908 [AS_CASE([$target], 2909 2909 [*-freebsd*], 2910 - [AC_MSG_ERROR([mmap MAP_STACK not supported on FreeBSD])], 2911 - [with_mmap_map_stack=true; 2912 - AC_DEFINE([USE_MMAP_MAP_STACK], [1])])], 2913 - [AC_MSG_ERROR([mmap MAP_STACK requested but not found on $target])]) 2914 - ], 2915 - [AS_CASE([$target], 2916 - [*-openbsd*], 2917 - [with_mmap_map_stack=true; 2918 - AC_DEFINE([USE_MMAP_MAP_STACK], [1]) 2919 - AC_MSG_NOTICE([using MAP_STACK on OpenBSD due to stack checking])], 2920 - [with_mmap_map_stack=false]) 2921 - ]) 2910 + [AC_MSG_ERROR([mmap MAP_STACK is not supported on FreeBSD])])], 2911 + [AC_MSG_ERROR([mmap MAP_STACK requested but not found on $target])])], 2912 + [AS_CASE([$target,$ocaml_cv_func_mmap_MAP_STACK,$enable_mmap_map_stack], 2913 + [*-openbsd*,no,*|*-openbsd-*,*,no], 2914 + [AC_MSG_ERROR([mmap MAP_STACK is required on OpenBSD])], 2915 + [*-openbsd*,*,*], 2916 + [enable_mmap_map_stack=yes 2917 + AC_MSG_NOTICE([Using MAP_STACK on OpenBSD due to stack checking])])]) 2918 + AS_IF([test x"$ocaml_cv_func_mmap_MAP_STACK$enable_mmap_map_stack" = xyesyes], 2919 + [AC_DEFINE([USE_MMAP_MAP_STACK], [1], [Define to use mmap MAP_STACK.])]) 2922 2920 2923 2921 oc_native_compflags='' 2924 2922