gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 165/335: configure: detect more function attributes


From: gnunet
Subject: [libmicrohttpd] 165/335: configure: detect more function attributes
Date: Sat, 27 Jul 2024 22:01:01 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to tag stf-m2
in repository libmicrohttpd.

commit 647502b6e73e6fde5e9052a156476a6de49d4c8e
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu May 16 10:18:21 2024 +0200

    configure: detect more function attributes
---
 configure.ac | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/configure.ac b/configure.ac
index 31a8b954..e63251c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3267,6 +3267,69 @@ MHD_CHECK_FUNC([[nanosleep]], [[#include <time.h>]], 
[[struct timespec ts2, ts1
 
 # NOTE: require setting of errattr_CFLAGS above
 CFLAGS="${CFLAGS_ac} ${user_CFLAGS} ${errattr_CFLAGS}"
+AC_CACHE_CHECK([whether $CC supports 
__attribute__((used))],[mhd_cv_cc_attr_used],
+  [
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+extern __attribute__((used)) int
+test_func(void);
+
+extern __attribute__((used)) int
+test_func(void) {return 0;}
+          ]])
+      ],
+      [mhd_cv_cc_attr_used="yes"],[mhd_cv_cc_attr_used="no"]
+    )
+  ]
+)
+AS_VAR_IF([mhd_cv_cc_attr_used],["yes"],
+  [
+    AC_DEFINE([HAVE_ATTR_USED],[1],
+      [Define to '1' if your compiler supports __attribute__((used))]
+    )
+  ]
+)
+AC_CACHE_CHECK([whether $CC supports 
__attribute__((pure))],[mhd_cv_cc_attr_pure],
+  [
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+extern __attribute__((pure)) int
+test_func(const char *ptr);
+
+extern __attribute__((pure)) int
+test_func(const char *ptr) {return (0 == (*ptr));}
+          ]])
+      ],
+      [mhd_cv_cc_attr_pure="yes"],[mhd_cv_cc_attr_pure="no"]
+    )
+  ]
+)
+AS_VAR_IF([mhd_cv_cc_attr_pure],["yes"],
+  [
+    AC_DEFINE([HAVE_ATTR_PURE],[1],
+      [Define to '1' if your compiler supports __attribute__((pure))]
+    )
+  ]
+)
+AC_CACHE_CHECK([whether $CC supports 
__attribute__((const))],[mhd_cv_cc_attr_const],
+  [
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+extern __attribute__((const)) int
+test_func(int a);
+
+extern __attribute__((const)) int
+test_func(int a) {return a + 1;}
+          ]])
+      ],
+      [mhd_cv_cc_attr_const="yes"],[mhd_cv_cc_attr_const="no"]
+    )
+  ]
+)
+AS_VAR_IF([mhd_cv_cc_attr_const],["yes"],
+  [
+    AC_DEFINE([HAVE_ATTR_CONST],[1],
+      [Define to '1' if your compiler supports __attribute__((const))]
+    )
+  ]
+)
 AC_CACHE_CHECK([whether $CC supports 
__attribute__((visibility("default")))],[mhd_cv_cc_attr_visibility_default],
   [
     AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
@@ -3287,6 +3350,28 @@ AS_VAR_IF([mhd_cv_cc_attr_visibility_default],["yes"],
       [Define to '1' if your compiler supports 
__attribute__((visibility("default")))]
     )
 
+    AC_CACHE_CHECK([whether $CC supports 
__attribute__((visibility("internal")))],[mhd_cv_cc_attr_visibility_internal],
+      [
+        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+__attribute__((visibility("internal"))) int
+test_extrn_func(void);
+
+__attribute__((visibility("internal"))) int
+test_extrn_func(void) {return 0;}
+              ]])
+          ],
+          
[mhd_cv_cc_attr_visibility_internal="yes"],[mhd_cv_cc_attr_visibility_internal="no"]
+        )
+      ]
+    )
+    AS_VAR_IF([mhd_cv_cc_attr_visibility_internal],["yes"],
+      [
+        AC_DEFINE([HAVE_ATTR_VISIBILITY_INTERNAL],[1],
+          [Define to '1' if your compiler supports 
__attribute__((visibility("internal")))]
+        )
+      ]
+    )
+
     CFLAGS="${user_CFLAGS}"
     MHD_CHECK_CC_CFLAG([-fvisibility=hidden],[CFLAGS_ac],
       [

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]