From: Takashi Iwai Date: Tue, 10 Jul 2007 13:58:41 +0000 (+0200) Subject: Create asoundlib.h dynamically according to configure options X-Git-Tag: v1.0.15rc1~19 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=582cc1f098e2cc9904b53543075ef93e00e23c35;p=alsa-lib.git Create asoundlib.h dynamically according to configure options Create asoundlib.h dynamically according to configure options. This avoids the inclusion of unused API headers. Also don't install unused API headers. --- diff --git a/configure.in b/configure.in index 2952fc79..db5894da 100644 --- a/configure.in +++ b/configure.in @@ -535,3 +535,21 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile include/Makefile modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \ alsalisp/Makefile aserver/Makefile test/Makefile utils/Makefile \ utils/alsa-lib.spec utils/alsa.pc) + +dnl Create asoundlib.h dynamically according to configure options +echo "Creating asoundlib.h..." +cp "$srcdir"/include/asoundlib-head.h include/asoundlib.h +test "$build_pcm" = "yes" && echo "#include " >> include/asoundlib.h +test "$build_rawmidi" = "yes" && echo "#include " >> include/asoundlib.h +test "$build_pcm" = "yes" && echo "#include " >> include/asoundlib.h +test "$build_hwdep" = "yes" && echo "#include " >> include/asoundlib.h +echo "#include " >> include/asoundlib.h +test "$build_mixer" = "yes" && echo "#include " >> include/asoundlib.h +test "$build_seq" = "yes" && echo "#include " >> include/asoundlib.h +test "$build_seq" = "yes" && echo "#include " >> include/asoundlib.h +test "$build_seq" = "yes" && echo "#include " >> include/asoundlib.h +test "$build_seq" = "yes" && echo "#include " >> include/asoundlib.h +test "$build_instr" = "yes" && echo "#include " >> include/asoundlib.h +test "$build_instr" = "yes" && echo "#include " >> include/asoundlib.h +cat "$srcdir"/include/asoundlib-tail.h >> include/asoundlib.h + diff --git a/include/Makefile.am b/include/Makefile.am index 7782f79c..79455e00 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,16 +5,59 @@ alsaincludedir = ${includedir}/alsa alsainclude_HEADERS = asoundlib.h asoundef.h \ version.h global.h input.h output.h error.h \ - conf.h pcm.h pcm_old.h pcm_plugin.h rawmidi.h timer.h \ - hwdep.h control.h mixer.h mixer_abst.h \ - seq_event.h seq.h seqmid.h seq_midi_event.h \ - conv.h instr.h iatomic.h \ - alisp.h pcm_external.h pcm_ioplug.h pcm_extplug.h \ - pcm_rate.h control_external.h + conf.h control.h iatomic.h -noinst_HEADERS = alsa sys.h search.h list.h aserver.h local.h alsa-symbols.h +if BUILD_CTL_PLUGIN_EXT +alsainclude_HEADERS += control_external.h +endif -CLEANFILES = stamp-vh version.h alsa +if BUILD_PCM +alsainclude_HEADERS += pcm.h pcm_old.h timer.h +if BUILD_PCM_PLUGIN +alsainclude_HEADERS += pcm_plugin.h +endif +if BUILD_PCM_PLUGIN_RATE +alsainclude_HEADERS += pcm_rate.h +endif +if BUILD_PCM_PLUGIN_EXTPLUG +alsainclude_HEADERS += pcm_external.h pcm_extplug.h +endif +if BUILD_PCM_PLUGIN_IOPLUG +if !BUILD_PCM_PLUGIN_EXTPLUG +alsainclude_HEADERS += pcm_external.h +endif +alsainclude_HEADERS += pcm_ioplug.h +endif +endif + +if BUILD_RAWMIDI +alsainclude_HEADERS += rawmidi.h +endif + +if BUILD_HWDEP +alsainclude_HEADERS += hwdep.h +endif + +if BUILD_MIXER +alsainclude_HEADERS += mixer.h mixer_abst.h +endif + +if BUILD_SEQ +alsainclude_HEADERS += seq_event.h seq.h seqmid.h seq_midi_event.h +endif + +if BUILD_INSTR +alsainclude_HEADERS += conv.h instr.h +endif + +if BUILD_ALISP +alsainclude_HEADERS += alisp.h +endif + +noinst_HEADERS = alsa sys.h search.h list.h aserver.h local.h alsa-symbols.h \ + asoundlib-head.h asoundlib-tail.h + +CLEANFILES = stamp-vh version.h alsa asoundlib.h alsa: ln -s $(top_srcdir)/include alsa diff --git a/include/asoundlib.h b/include/asoundlib-head.h similarity index 81% rename from include/asoundlib.h rename to include/asoundlib-head.h index 2a7de28d..b2414db3 100644 --- a/include/asoundlib.h +++ b/include/asoundlib-head.h @@ -46,17 +46,3 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif /* __ASOUNDLIB_H */ diff --git a/include/asoundlib-tail.h b/include/asoundlib-tail.h new file mode 100644 index 00000000..e20f5ad9 --- /dev/null +++ b/include/asoundlib-tail.h @@ -0,0 +1,2 @@ + +#endif /* __ASOUNDLIB_H */