Commit f36699b98c20585e28654e9fe73665551d6711cd

Thomas de Grivel 2023-12-29T01:39:00

configure

diff --git a/config.subr b/config.subr
index f877fec..7847409 100644
--- a/config.subr
+++ b/config.subr
@@ -67,6 +67,9 @@ config_have_stat_mtim() {
     OUT_C=".config_have_stat_mtim.c"
     echo "/* generated by configure */" > "$OUT_C"
     echo "#include <sys/stat.h>" >> "$OUT_C"
+    echo "#ifdef __APPLE__" >> "$OUT_C"
+    echo "# define st_mtim st_mtimespec" >> "$OUT_C"
+    echo "#endif" >> "$OUT_C"
     echo "int main (void) {" >> "$OUT_C"
     echo "  struct stat tmp;" >> "$OUT_C"
     echo "  tmp.st_mtim.tv_sec = 0;" >> "$OUT_C"
@@ -316,7 +319,8 @@ swift2ext() {
 }
 
 update_config_h() {
-    echo "#endif" >> "${CONFIG_H}"
+    echo >> "${CONFIG_H}"
+    echo "#endif /* ${CONFIG_H_PREFIX}CONFIG_H */" >> ${CONFIG_H}
     if ! cmp "${CONFIG_H}" config.h >/dev/null 2>&1; then
         mv "${CONFIG_H}" config.h
         echo "-> ${PWD}/config.h"
@@ -357,6 +361,7 @@ CONFIG_H=".config.h.tmp"
 echo "/* config.h generated by configure */" > ${CONFIG_H}
 echo "#ifndef ${CONFIG_H_PREFIX}CONFIG_H" >> ${CONFIG_H}
 echo "#define ${CONFIG_H_PREFIX}CONFIG_H" >> ${CONFIG_H}
+echo >> "${CONFIG_H}"
 
 CONFIG_MK=config.mk
 CONFIG_MK=".config.mk.tmp"
diff --git a/libc3/configure b/libc3/configure
index f5f07d5..4d911fb 100755
--- a/libc3/configure
+++ b/libc3/configure
@@ -14,7 +14,7 @@
 set -e
 
 export SRC_TOP="$(dirname "$PWD")"
-CONFIG_H_PREFIX=C3_
+CONFIG_H_PREFIX=LIBC3_
 
 . ../config.subr