alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] Update attributes.m4 to avoid warnings with autoconf-2.68
@ 2011-01-20  3:45 Diego Elio Pettenò
  2011-01-20  3:45 ` [PATCH 2/4] Add missing no-undefined parameter Diego Elio Pettenò
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Diego Elio Pettenò @ 2011-01-20  3:45 UTC (permalink / raw)
  To: alsa-devel

---
 m4/attributes.m4 |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/m4/attributes.m4 b/m4/attributes.m4
index e86456a..82b4a3c 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -25,7 +25,7 @@ dnl License when using or distributing such scripts, even though portions
 dnl of the text of the Macro appear in them. The GNU General Public
 dnl License (GPL) does govern all other use of the material that
 dnl constitutes the Autoconf Macro.
-dnl 
+dnl
 dnl This special exception to the GPL applies to versions of the
 dnl Autoconf Macro released by this project. When you make and
 dnl distribute a modified version of the Autoconf Macro, you may extend
@@ -39,7 +39,7 @@ AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [
   AC_CACHE_VAL(AS_TR_SH([cc_cv_cflags_$1]),
     [ac_save_CFLAGS="$CFLAGS"
      CFLAGS="$CFLAGS $1"
-     AC_COMPILE_IFELSE([int a;],
+     AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])],
        [eval "AS_TR_SH([cc_cv_cflags_$1])='yes'"],
        [eval "AS_TR_SH([cc_cv_cflags_$1])='no'"])
      CFLAGS="$ac_save_CFLAGS"
@@ -89,7 +89,7 @@ AC_DEFUN([CC_CHECK_LDFLAGS], [
     AS_TR_SH([cc_cv_ldflags_$1]),
     [ac_save_LDFLAGS="$LDFLAGS"
      LDFLAGS="$LDFLAGS $1"
-     AC_LINK_IFELSE([int main() { return 1; }],
+     AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 1; }])],
        [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"],
        [eval "AS_TR_SH([cc_cv_ldflags_$1])="])
      LDFLAGS="$ac_save_LDFLAGS"
@@ -147,7 +147,7 @@ AC_DEFUN([CC_CHECK_ATTRIBUTE], [
     AS_TR_SH([cc_cv_attribute_$1]),
     [ac_save_CFLAGS="$CFLAGS"
      CFLAGS="$CFLAGS $cc_cv_werror"
-     AC_COMPILE_IFELSE([$3],
+     AC_COMPILE_IFELSE([AC_LANG_SOURCE([$3])],
        [eval "AS_TR_SH([cc_cv_attribute_$1])='yes'"],
        [eval "AS_TR_SH([cc_cv_attribute_$1])='no'"])
      CFLAGS="$ac_save_CFLAGS"
@@ -165,7 +165,16 @@ AC_DEFUN([CC_CHECK_ATTRIBUTE], [
 AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [
   CC_CHECK_ATTRIBUTE(
     [constructor],,
-    [void __attribute__((constructor)) ctor() { int a; }],
+    [extern void foo();
+     void __attribute__((constructor)) ctor() { foo(); }],
+    [$1], [$2])
+])
+
+AC_DEFUN([CC_ATTRIBUTE_DESTRUCTOR], [
+  CC_CHECK_ATTRIBUTE(
+    [destructor],,
+    [extern void foo();
+     void __attribute__((destructor)) dtor() { foo(); }],
     [$1], [$2])
 ])
 
@@ -257,7 +266,7 @@ AC_DEFUN([CC_FLAG_VISIBILITY], [
 	cc_cv_flag_visibility='yes',
 	cc_cv_flag_visibility='no')
      CFLAGS="$cc_flag_visibility_save_CFLAGS"])
-  
+
   AS_IF([test "x$cc_cv_flag_visibility" = "xyes"],
     [AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1,
        [Define this if the compiler supports the -fvisibility flag])
-- 
1.7.4.rc2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-20 13:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20  3:45 [PATCH 1/4] Update attributes.m4 to avoid warnings with autoconf-2.68 Diego Elio Pettenò
2011-01-20  3:45 ` [PATCH 2/4] Add missing no-undefined parameter Diego Elio Pettenò
2011-01-20  3:45 ` [PATCH 3/4] List libavutil as a dependency together with libavcodec Diego Elio Pettenò
2011-01-20  3:45 ` [PATCH 4/4] Only export symbols needed by the plugins' interface Diego Elio Pettenò
2011-01-20 13:57 ` [PATCH 1/4] Update attributes.m4 to avoid warnings with autoconf-2.68 Diego Elio Pettenò

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).