Commit 3645540ee771cc73f29854de052679b63449e2d8

Thomas de Grivel 2024-07-01T20:22:21

fix compilation of stubs

diff --git a/libc3_web/Makefile b/libc3_web/Makefile
index ea5d40c..9d39472 100644
--- a/libc3_web/Makefile
+++ b/libc3_web/Makefile
@@ -48,9 +48,6 @@ distclean:
 gcovr:
 	gcovr --gcov-executable ${GCOV} --html-details libc3_web.html
 
-include gen.mk
-CLEANFILES += ${GENERATED_FILES}
-
 install:
 	${INSTALL} -o ${OWNER} -g ${GROUP} -m 0755 -d ${prefix}/include/libc3_web
 	${LIBTOOL} --tag=CC --mode=install ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0644 ${HEADERS} ${prefix}/include/libc3/web
diff --git a/libc3_web/configure b/libc3_web/configure
index 13a34dc..a10fb41 100755
--- a/libc3_web/configure
+++ b/libc3_web/configure
@@ -37,27 +37,33 @@ OBJECTS_COV="$(c2ext .cov.lo "$SOURCES")"
 OBJECTS_DEBUG="$(c2ext .debug.lo "$SOURCES")"
 
 # Common config for all targets
+CPPFLAGS="-I.. $CPPFLAGS"
 CFLAGS="$CFLAGS -W -Wall -Werror -std=c11 -pedantic -pipe"
 CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
 LDFLAGS="-export-dynamic $LDFLAGS -rdynamic"
 config_asan
 config_gnu
+pkg_config libbsd-overlay
+pkg_config libffi
 config_define PREFIX "\"${PREFIX}\""
 update_config_h
 LIBS="$LIBS -lm -rpath ${PREFIX}/lib"
 
 # Address Sanitizer config
+CPPFLAGS_ASAN="$CPPFLAGS"
 CFLAGS_ASAN="$CFLAGS -DDEBUG -O1 -g"
 CFLAGS_ASAN="$CFLAGS_ASAN -fsanitize=address -fno-omit-frame-pointer"
 LDFLAGS_ASAN="$LDFLAGS"
 LIBS_ASAN="$LIBS"
 
 # Coverage config
+CPPFLAGS_COV="$CPPFLAGS"
 CFLAGS_COV="$CFLAGS -fprofile-arcs -ftest-coverage"
 LDFLAGS_COV="$LDFLAGS --coverage"
 LIBS_COV="$LIBS -lgcov"
 
 # Debug config
+CPPFLAGS_DEBUG="$CPPFLAGS"
 CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -g"
 LDFLAGS_DEBUG="$LDFLAGS"
 LIBS_DEBUG="$LIBS"
@@ -78,16 +84,19 @@ echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
 echo "LIBS = $LIBS" >> ${CONFIG_MK}
 echo >> ${CONFIG_MK}
 echo "LIB_ASAN = $LIB_ASAN" >> ${CONFIG_MK}
+echo "CPPFLAGS_ASAN = $CPPFLAGS_ASAN" >> ${CONFIG_MK}
 echo "CFLAGS_ASAN = $CFLAGS_ASAN" >> ${CONFIG_MK}
 echo "LDFLAGS_ASAN = $LDFLAGS_ASAN" >> ${CONFIG_MK}
 echo "LIBS_ASAN = $LIBS_ASAN" >> ${CONFIG_MK}
 echo >> ${CONFIG_MK}
 echo "LIB_COV = $LIB_COV" >> ${CONFIG_MK}
+echo "CPPFLAGS_COV = $CPPFLAGS_COV" >> ${CONFIG_MK}
 echo "CFLAGS_COV = $CFLAGS_COV" >> ${CONFIG_MK}
 echo "LDFLAGS_COV = $LDFLAGS_COV" >> ${CONFIG_MK}
 echo "LIBS_COV = $LIBS_COV" >> ${CONFIG_MK}
 echo >> ${CONFIG_MK}
 echo "LIB_DEBUG = $LIB_DEBUG" >> ${CONFIG_MK}
+echo "CPPFLAGS_DEBUG = $CPPFLAGS_DEBUG" >> ${CONFIG_MK}
 echo "CFLAGS_DEBUG = $CFLAGS_DEBUG" >> ${CONFIG_MK}
 echo "LDFLAGS_DEBUG = $LDFLAGS_DEBUG" >> ${CONFIG_MK}
 echo "LIBS_DEBUG = $LIBS_DEBUG" >> ${CONFIG_MK}
diff --git a/libc3_web/ec3.c b/libc3_web/ec3.c
index e7644ae..da03676 100644
--- a/libc3_web/ec3.c
+++ b/libc3_web/ec3.c
@@ -10,7 +10,7 @@
  * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
  * THIS SOFTWARE.
  */
-#include "libc3/c3.h"
+#include <libc3/c3.h>
 #include "ec3.h"
 
 sw ec3_buf_parse (s_ec3 *ec3, s_buf *buf)
diff --git a/libc3_web/sources.mk b/libc3_web/sources.mk
new file mode 100644
index 0000000..fd70f66
--- /dev/null
+++ b/libc3_web/sources.mk
@@ -0,0 +1,7 @@
+# sources.mk generated by update_sources
+HEADERS = \
+	"ec3.h" \
+
+SOURCES = \
+	"ec3.c" \
+
diff --git a/libc3_web/sources.sh b/libc3_web/sources.sh
new file mode 100644
index 0000000..2f408bf
--- /dev/null
+++ b/libc3_web/sources.sh
@@ -0,0 +1,3 @@
+# sources.sh generated by update_sources
+HEADERS='ec3.h '
+SOURCES='ec3.c '
diff --git a/libc3_web/types.h b/libc3_web/types.h
new file mode 100644
index 0000000..4dda64b
--- /dev/null
+++ b/libc3_web/types.h
@@ -0,0 +1,20 @@
+/* c3
+ * Copyright 2022-2024 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#ifndef LIBC3_WEB_TYPES_H
+#define LIBC3_WEB_TYPES_H
+
+#include <libc3/types.h>
+
+typedef s_list s_ec3;
+
+#endif /* LIBC3_WEB_TYPES_H */