efl: Add build system support for ecore_audio
authorDaniel Willmann <d.willmann@samsung.com>
Fri, 14 Dec 2012 23:38:25 +0000 (23:38 +0000)
committerDaniel Willmann <daniel@totalueberwachung.de>
Fri, 14 Dec 2012 23:38:25 +0000 (23:38 +0000)
Disabled by default, enable with --enable-audio
ALSA support is disabled as it is not there yet. Pulseaudio should work
though.

Support for .ogg and .wav is there as well (.mp3 is not)

Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
SVN revision: 81000

configure.ac
pc/ecore-audio.pc.in [new file with mode: 0644]
src/Makefile.am
src/Makefile_Ecore_Audio.am [new file with mode: 0644]
src/lib/ecore/Ecore.h

index 92df65c5e5fe4b97d7dea1177af9c128dd5c30ba..ae4570a4caf4fb07ece7126817a8a0d1f5661a3d 100644 (file)
@@ -139,6 +139,7 @@ requirements_libs_ecore_win32=""
 requirements_libs_ecore_wince=""
 requirements_libs_ecore_x=""
 requirements_libs_ecore_evas=""
+requirements_libs_ecore_audio=""
 requirements_libs_embryo=""
 requirements_libs_eio=""
 #requirements_libs_edje=""
@@ -168,6 +169,7 @@ requirements_pc_ecore_win32=""
 requirements_pc_ecore_wince=""
 requirements_pc_ecore_x=""
 requirements_pc_ecore_evas=""
+requirements_pc_ecore_audio=""
 requirements_pc_embryo=""
 requirements_pc_eio=""
 #requirements_pc_edje=""
@@ -216,6 +218,7 @@ AC_SUBST([requirements_libs_ecore_win32])
 AC_SUBST([requirements_libs_ecore_wince])
 AC_SUBST([requirements_libs_ecore_x])
 AC_SUBST([requirements_libs_ecore_evas])
+AC_SUBST([requirements_libs_ecore_audio])
 AC_SUBST([requirements_libs_embryo])
 AC_SUBST([requirements_libs_eio])
 #AC_SUBST([requirements_libs_edje])
@@ -245,6 +248,7 @@ AC_SUBST([requirements_pc_ecore_win32])
 AC_SUBST([requirements_pc_ecore_wince])
 AC_SUBST([requirements_pc_ecore_x])
 AC_SUBST([requirements_pc_ecore_evas])
+AC_SUBST([requirements_pc_ecore_audio])
 AC_SUBST([requirements_pc_embryo])
 AC_SUBST([requirements_pc_eio])
 #AC_SUBST([requirements_pc_edje])
@@ -3120,6 +3124,82 @@ fi
 
 #### End of Ecore_Evas
 
+#### Ecore_Audio
+AC_ARG_ENABLE([audio],
+   [AC_HELP_STRING([--enable-audio], [enable Ecore_Audio])],
+   [
+    if test "x${enableval}" = "xyes" ; then
+       want_ecore_audio="yes"
+    else
+       want_ecore_audio="no"
+    fi
+   ],
+   [want_ecore_audio="no"])
+
+if test "x${want_ecore_audio}" = "xyes" ; then
+
+AC_MSG_NOTICE([Ecore_Audio checks])
+
+### Additional options to configure
+
+### Default values
+
+### Checks for programs
+
+### Checks for libraries
+
+# Eina, Eo, Eet, Ecore
+
+requirements_pc_ecore_audio="ecore >= ${PACKAGE_VERSION} eet >= ${PACKAGE_VERSION} eina >= ${PACKAGE_VERSION} ${requirements_pc_ecore_audio}"
+
+use_alsa="no"
+# ALSA support is not really there yet...uncomment if you want to play around with it
+#PKG_CHECK_EXISTS([ALSA], [alsa], [
+#                    use_alsa="yes"
+#                    AC_DEFINE([HAVE_ALSA], [1], [Alsa library])
+#       requirements_pc_ecore_audio="alsa ${requirements_pc_ecore_audio}"
+#       requirements_pc_deps_ecore_audio="alsa ${requirements_pc_deps_ecore_audio}"
+#                    ], [use_alsa="no"])
+
+have_pulse="no"
+PKG_CHECK_EXISTS([libpulse],
+      [
+       use_pulse="yes"
+       AC_DEFINE([HAVE_PULSE], [1], [Pulseaudio library])
+       requirements_pc_ecore_audio="libpulse ${requirements_pc_ecore_audio}"
+       requirements_pc_deps_ecore_audio="libpulse ${requirements_pc_deps_ecore_audio}"
+                   ], [use_pulse="no"])
+
+use_sndfile="no"
+PKG_CHECK_EXISTS([sndfile], [
+                   use_sndfile="yes"
+                   AC_DEFINE([HAVE_SNDFILE], [1], [libsndfile library])
+       requirements_pc_ecore_audio="sndfile ${requirements_pc_ecore_audio}"
+       requirements_pc_deps_ecore_audio="sndfile ${requirements_pc_deps_ecore_audio}"
+                   ], [use_sndfile="no"])
+
+PKG_CHECK_MODULES([ECORE_AUDIO], [${requirements_pc_deps_ecore_audio}])
+
+ECORE_AUDIO_CFLAGS="${ECORE_AUDIO_CFLAGS}"
+ECORE_AUDIO_LIBS="${ECORE_AUDIO_LIBS}"
+requirements_libs_ecore_audio="${requirements_libs_ecore_audio}"
+
+### Checks for header files
+
+### Checks for types
+
+### Checks for structures
+
+### Checks for compiler characteristics
+
+### Checks for linker characteristics
+
+### Checks for library functions
+
+fi
+
+AM_CONDITIONAL([HAVE_ECORE_AUDIO], [test "x${want_ecore_audio}" = "xyes"])
+
 
 #### Eio
 
@@ -3280,6 +3360,7 @@ pc/ecore-x.pc
 pc/ecore-evas.pc
 pc/ecore-imf.pc
 pc/ecore-imf-evas.pc
+pc/ecore-audio.pc
 pc/embryo.pc
 pc/eio.pc
 $po_makefile_in
@@ -3479,6 +3560,15 @@ echo "  Ecore_Evas...................: $have_ecore_evas"
   echo "    Extn (Plug/socket Extn)....: $have_ecore_evas_extn"
 #fi
 echo
+echo "Ecore Sound system:"
+echo
+echo "  Ecore_Audio..................: $want_ecore_audio"
+if test "x${want_ecore_audio}" = "xyes" ; then
+echo "    ALSA.......................: $use_alsa"
+echo "    PulseAudio.................: $use_pulse"
+echo "    SndFile....................: $use_sndfile"
+fi
+echo
 echo "Tests..................: ${_efl_enable_tests}"
 if test "x${_efl_enable_tests}" = "xyes"; then
 echo "    Coverage...........: ${_efl_enable_coverage}"
diff --git a/pc/ecore-audio.pc.in b/pc/ecore-audio.pc.in
new file mode 100644 (file)
index 0000000..ced2f83
--- /dev/null
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: ecore-audio
+Description: E core library, audio module
+Requires.private: @requirements_pc_ecore_audio@
+Version: @VERSION@
+Libs: -L${libdir} -lecore_audio
+Libs.private: @requirements_libs_ecore_audio@
+Cflags: -I${includedir}/ecore-@VMAJ@
index 684f54c13208d1081b1fad8683bd3e092243015e..a9c4f3d74bcaf9f5d227c0f394f9b3410cb6463c 100644 (file)
@@ -53,6 +53,9 @@ include Makefile_Ecore_X.am
 endif
 include Makefile_Ecore_Imf.am
 include Makefile_Ecore_Evas.am
+if HAVE_ECORE_AUDIO
+include Makefile_Ecore_Audio.am
+endif
 include Makefile_Embryo.am
 include Makefile_Eio.am
 
diff --git a/src/Makefile_Ecore_Audio.am b/src/Makefile_Ecore_Audio.am
new file mode 100644 (file)
index 0000000..7862ad9
--- /dev/null
@@ -0,0 +1,41 @@
+
+### Library
+
+lib_LTLIBRARIES += lib/ecore_audio/libecore_audio.la
+
+installed_ecoreaudiomainheadersdir = $(includedir)/ecore-@VMAJ@
+dist_installed_ecoreaudiomainheaders_DATA = \
+lib/ecore_audio/Ecore_Audio.h
+
+lib_ecore_audio_libecore_audio_la_SOURCES = \
+lib/ecore_audio/ecore_audio.c \
+lib/ecore_audio/ecore_audio_alsa.c \
+lib/ecore_audio/ecore_audio_pulse.c \
+lib/ecore_audio/ecore_audio_sndfile.c \
+lib/ecore_audio/ecore_audio_tone.c \
+lib/ecore_audio/ecore_audio_custom.c \
+lib/ecore_audio/ecore_audio_private.h
+
+lib_ecore_audio_libecore_audio_la_CPPFLAGS = \
+-I$(top_srcdir)/src/lib/eina \
+-I$(top_srcdir)/src/lib/eo \
+-I$(top_srcdir)/src/lib/eet \
+-I$(top_srcdir)/src/lib/ecore \
+-I$(top_builddir)/src/lib/eina \
+-I$(top_builddir)/src/lib/eo \
+-I$(top_builddir)/src/lib/eet \
+-I$(top_builddir)/src/lib/ecore \
+-DEFL_ECORE_AUDIO_BUILD \
+@EFL_CFLAGS@ \
+@EFL_COV_CFLAGS@ \
+@ECORE_AUDIO_CFLAGS@
+
+lib_ecore_audio_libecore_audio_la_LIBADD = \
+lib/ecore/libecore.la \
+lib/eet/libeet.la \
+lib/eo/libeo.la \
+lib/eina/libeina.la
+
+lib_ecore_audio_libecore_audio_la_LIBADD += @ECORE_AUDIO_LIBS@ @EFL_COV_LIBS@ -lm
+
+lib_ecore_audio_libecore_audio_la_LDFLAGS = -no-undefined -version-info @version_info@ @release_info@
index d3585fcc319eca08477a384df8d93037e6b11b82..4dacb7c0db3dcaae901b629e89e35f7e3a331251 100644 (file)
@@ -32,6 +32,7 @@
    @li @link Ecore_X.h      Ecore_X - X Windows System wrapper. @endlink
    @li @ref Ecore_Win32_Group
    @li @ref Ecore_WinCE_Group
+   @li @ref Ecore_Audio_Group
 
    For more info on Ecore usage, there are these @ref Examples.
 
@@ -123,6 +124,7 @@ sudo make install
    @author Jérémy Zurcher <jeremy@asynk.ch>
    @author Vikram Narayanan <vikram186@gmail.com>
    @author Gwanglim Lee <gl77.lee@samsung.com> <gwanglim@gmail.com>
+   @author Daniel Willmann <daniel@totalueberwachung.de>
 
    Please contact <enlightenment-devel@lists.sourceforge.net> to get in
    contact with the developers and maintainers.