Skip to contentSkip to conversation

Update attributes.m4 to avoid warnings with autoconf-2.68

PATCH In review Diego Elio Pettenò 1 participant 5 messages Jan 20, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 Update attributes.m4 to avoid warnings with autoconf-2.68

---
 m4/attributes.m4 |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)
m4/attributes.m4 +15 -6
index e86456a..82b4a3c 100644
@@ -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])
Signature · 1 line
1.7.4.rc2
#1 lore raw

PATCH 2/4 Add missing no-undefined parameter.

---
 arcam-av/Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arcam-av/Makefile.am +1 -1
index 5c7855f..a5da61b 100644
@@ -3,7 +3,7 @@ asound_module_ctl_arcam_av_LTLIBRARIES = libasound_module_ctl_arcam_av.la
 asound_module_ctl_arcam_avdir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined
+AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_ctl_arcam_av_la_SOURCES = ctl_arcam_av.c arcam_av.c arcam_av.h
 libasound_module_ctl_arcam_av_la_LIBADD = @ALSA_LIBS@
Signature · 1 line
1.7.4.rc2
#2 lore raw

PATCH 3/4 List libavutil as a dependency together with libavcodec.

In reply to Diego Elio Pettenò

Without this it is possible that the a52 plugin ends up with an undefined reference to av_free().

---
 configure.in |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
configure.in +2 -1
index 5d71cae..973900b 100644
@@ -67,7 +67,8 @@ AC_ARG_ENABLE([avcodec],
       AS_HELP_STRING([--disable-avcodec], [Don't build plugins depending on avcodec (a52)]))
 
 if test "x$enable_avcodec" != "xno"; then
-  PKG_CHECK_MODULES(AVCODEC, [libavcodec], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no])
+  # you need libavutil linked in for av_free
+  PKG_CHECK_MODULES(AVCODEC, [libavcodec libavutil], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no])
 fi
 
 if test "x$HAVE_AVCODEC" = "xno"; then
Signature · 1 line
1.7.4.rc2
#3 lore raw

PATCH 4/4 Only export symbols needed by the plugins' interface.

In reply to Diego Elio Pettenò

This reduces the amount of symbols the loader has to resolve, which in turn reduces the time taken by loading the plugins, and avoids possible symbol collisions between the plugins and the host software loading them.

---
 a52/Makefile.am        |    2 +-
 arcam-av/Makefile.am   |    2 +-
 jack/Makefile.am       |    2 +-
 maemo/Makefile.am      |    2 +-
 mix/Makefile.am        |    2 +-
 oss/Makefile.am        |    2 +-
 pph/Makefile.am        |    2 +-
 pulse/Makefile.am      |    3 +++
 rate-lavc/Makefile.am  |    2 +-
 rate/Makefile.am       |    2 +-
 speex/Makefile.am      |    2 +-
 usb_stream/Makefile.am |    2 +-
 12 files changed, 14 insertions(+), 11 deletions(-)
a52/Makefile.am +1 -1
index 48567b4..d8f9dc8 100644
@@ -4,7 +4,7 @@ asound_module_pcm_a52dir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @AVCODEC_CFLAGS@ \
 	-DAVCODEC_HEADER="@AVCODEC_HEADER@"
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_pcm_a52_la_SOURCES = pcm_a52.c
 libasound_module_pcm_a52_la_LIBADD = @ALSA_LIBS@ @AVCODEC_LIBS@
arcam-av/Makefile.am +1 -1
index a5da61b..dce49a7 100644
@@ -3,7 +3,7 @@ asound_module_ctl_arcam_av_LTLIBRARIES = libasound_module_ctl_arcam_av.la
 asound_module_ctl_arcam_avdir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_ctl_arcam_av_la_SOURCES = ctl_arcam_av.c arcam_av.c arcam_av.h
 libasound_module_ctl_arcam_av_la_LIBADD = @ALSA_LIBS@
jack/Makefile.am +1 -1
index f913cb6..fb54c4d 100644
@@ -3,7 +3,7 @@ asound_module_pcm_jack_LTLIBRARIES = libasound_module_pcm_jack.la
 asound_module_pcm_jackdir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @JACK_CFLAGS@
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_pcm_jack_la_SOURCES = pcm_jack.c
 libasound_module_pcm_jack_la_LIBADD = @ALSA_LIBS@ @JACK_LIBS@
maemo/Makefile.am +1 -1
index 2684781..b1c5650 100644
@@ -5,7 +5,7 @@ asound_module_pcm_alsa_dspdir = @ALSA_PLUGIN_DIR@
 asound_module_ctl_dsp_ctldir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -O2 @ALSA_CFLAGS@ $(DBUS_CFLAGS)
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_pcm_alsa_dsp_la_SOURCES = dsp-protocol.c alsa-dsp.c
 libasound_module_pcm_alsa_dsp_la_LIBADD = @ALSA_LIBS@ $(DBUS_LIBS) -lpthread 
mix/Makefile.am +1 -1
index e31839a..fc67643 100644
@@ -5,7 +5,7 @@ asound_module_pcm_upmixdir = @ALSA_PLUGIN_DIR@
 asound_module_pcm_vdownmixdir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_pcm_upmix_la_SOURCES = pcm_upmix.c
 libasound_module_pcm_upmix_la_LIBADD = @ALSA_LIBS@
oss/Makefile.am +1 -1
index 302538b..9ba33c5 100644
@@ -5,7 +5,7 @@ asound_module_pcm_ossdir = @ALSA_PLUGIN_DIR@
 asound_module_ctl_ossdir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_pcm_oss_la_SOURCES = pcm_oss.c
 libasound_module_pcm_oss_la_LIBADD = @ALSA_LIBS@
pph/Makefile.am +1 -1
index 551e5bd..5a14f59 100644
@@ -3,7 +3,7 @@ asound_module_rate_speexrate_LTLIBRARIES = libasound_module_rate_speexrate.la
 asound_module_rate_speexratedir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -DVAR_ARRAYS -Wall -g @ALSA_CFLAGS@
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_rate_speexrate_la_SOURCES = rate_speexrate.c
 libasound_module_rate_speexrate_la_LIBADD = @ALSA_LIBS@
pulse/Makefile.am +3 -0
index e89e8ee..dc41daf 100644
@@ -11,9 +11,12 @@ AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUN
 
 libasound_module_pcm_pulse_la_SOURCES = pcm_pulse.c pulse.c pulse.h
 libasound_module_pcm_pulse_la_LIBADD = @ALSA_LIBS@ $(PTHREAD_LIBS) $(pulseaudio_LIBS)
+libasound_module_pcm_pulse_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^__?snd.*open'
 
 libasound_module_ctl_pulse_la_SOURCES = ctl_pulse.c pulse.c pulse.h
 libasound_module_ctl_pulse_la_LIBADD = @ALSA_LIBS@ $(PTHREAD_LIBS) $(pulseaudio_LIBS)
+libasound_module_ctl_pulse_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^__?snd.*open'
 
 libasound_module_conf_pulse_la_SOURCES = conf_pulse.c
 libasound_module_conf_pulse_la_LIBADD = @ALSA_LIBS@ $(PTHREAD_LIBS) $(pulseaudio_LIBS)
+libasound_module_conf_pulse_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^conf'
rate-lavc/Makefile.am +1 -1
index 5cffd44..a7b6d3a 100644
@@ -4,7 +4,7 @@ asound_module_rate_lavcratedir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @AVCODEC_CFLAGS@ \
 	-DAVCODEC_HEADER="@AVCODEC_HEADER@"
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_rate_lavcrate_la_SOURCES = rate_lavcrate.c
 libasound_module_rate_lavcrate_la_LIBADD = @ALSA_LIBS@ @AVCODEC_LIBS@
rate/Makefile.am +1 -1
index 0605bfd..0c4b6fb 100644
@@ -3,7 +3,7 @@ asound_module_rate_samplerate_LTLIBRARIES = libasound_module_rate_samplerate.la
 asound_module_rate_sampleratedir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ $(samplerate_CFLAGS)
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_rate_samplerate_la_SOURCES = rate_samplerate.c
 libasound_module_rate_samplerate_la_LIBADD = @ALSA_LIBS@ @samplerate_LIBS@
speex/Makefile.am +1 -1
index 7d84190..ae14189 100644
@@ -3,7 +3,7 @@ asound_module_pcm_speex_LTLIBRARIES = libasound_module_pcm_speex.la
 asound_module_pcm_speexdir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @speexdsp_CFLAGS@
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' -no-undefined $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_pcm_speex_la_SOURCES = pcm_speex.c
 libasound_module_pcm_speex_la_LIBADD = @ALSA_LIBS@ @speexdsp_LIBS@
usb_stream/Makefile.am +1 -1
index 50a98a0..6304bc7 100644
@@ -3,7 +3,7 @@ asound_module_pcm_usb_stream_LTLIBRARIES = libasound_module_pcm_usb_stream.la
 asound_module_pcm_usb_streamdir = @ALSA_PLUGIN_DIR@
 
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
-AM_LDFLAGS = -module -avoid-version -export-dynamic $(LDFLAGS_NOUNDEFINED)
+AM_LDFLAGS = -module -avoid-version -export-dynamic -export-symbols-regex '^__?snd.*open' $(LDFLAGS_NOUNDEFINED)
 
 libasound_module_pcm_usb_stream_la_SOURCES = pcm_usb_stream.c
 libasound_module_pcm_usb_stream_la_LIBADD = @ALSA_LIBS@
Signature · 1 line
1.7.4.rc2
#4 lore raw
In reply to Diego Elio Pettenò

Sorry this and the other three are alsa-plugins patches, I forgot to set the prefix value in the gitconfig.

Signature · 7 lines
Diego Elio Pettenò — Flameeyes
http://blog.flameeyes.eu/

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel