[alsa-devel] [PATCH 1/4] Update attributes.m4 to avoid warnings with autoconf-2.68
--- 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])
--- arcam-av/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arcam-av/Makefile.am b/arcam-av/Makefile.am index 5c7855f..a5da61b 100644 --- a/arcam-av/Makefile.am +++ b/arcam-av/Makefile.am @@ -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@
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(-)
diff --git a/configure.in b/configure.in index 5d71cae..973900b 100644 --- a/configure.in +++ b/configure.in @@ -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
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(-)
diff --git a/a52/Makefile.am b/a52/Makefile.am index 48567b4..d8f9dc8 100644 --- a/a52/Makefile.am +++ b/a52/Makefile.am @@ -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@ diff --git a/arcam-av/Makefile.am b/arcam-av/Makefile.am index a5da61b..dce49a7 100644 --- a/arcam-av/Makefile.am +++ b/arcam-av/Makefile.am @@ -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@ diff --git a/jack/Makefile.am b/jack/Makefile.am index f913cb6..fb54c4d 100644 --- a/jack/Makefile.am +++ b/jack/Makefile.am @@ -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@ diff --git a/maemo/Makefile.am b/maemo/Makefile.am index 2684781..b1c5650 100644 --- a/maemo/Makefile.am +++ b/maemo/Makefile.am @@ -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 diff --git a/mix/Makefile.am b/mix/Makefile.am index e31839a..fc67643 100644 --- a/mix/Makefile.am +++ b/mix/Makefile.am @@ -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@ diff --git a/oss/Makefile.am b/oss/Makefile.am index 302538b..9ba33c5 100644 --- a/oss/Makefile.am +++ b/oss/Makefile.am @@ -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@ diff --git a/pph/Makefile.am b/pph/Makefile.am index 551e5bd..5a14f59 100644 --- a/pph/Makefile.am +++ b/pph/Makefile.am @@ -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@ diff --git a/pulse/Makefile.am b/pulse/Makefile.am index e89e8ee..dc41daf 100644 --- a/pulse/Makefile.am +++ b/pulse/Makefile.am @@ -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' diff --git a/rate-lavc/Makefile.am b/rate-lavc/Makefile.am index 5cffd44..a7b6d3a 100644 --- a/rate-lavc/Makefile.am +++ b/rate-lavc/Makefile.am @@ -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@ diff --git a/rate/Makefile.am b/rate/Makefile.am index 0605bfd..0c4b6fb 100644 --- a/rate/Makefile.am +++ b/rate/Makefile.am @@ -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@ diff --git a/speex/Makefile.am b/speex/Makefile.am index 7d84190..ae14189 100644 --- a/speex/Makefile.am +++ b/speex/Makefile.am @@ -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@ diff --git a/usb_stream/Makefile.am b/usb_stream/Makefile.am index 50a98a0..6304bc7 100644 --- a/usb_stream/Makefile.am +++ b/usb_stream/Makefile.am @@ -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@
Sorry this and the other three are alsa-plugins patches, I forgot to set the prefix value in the gitconfig.
participants (1)
-
Diego Elio Pettenò