[Asterisk-code-review] BuildSystem: Check for header file of OGG. (asterisk[15])

Joshua Colp asteriskteam at digium.com
Tue Mar 20 06:29:42 CDT 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/8564 )

Change subject: BuildSystem: Check for header file of OGG.
......................................................................

BuildSystem: Check for header file of OGG.

Asterisk uses various symbols of the shared library libogg within the module
format_ogg_vorbis. However, the source code of that module did not include the
header file of libogg explicitly but implicitly. Because that header was not
included before Asterisk 14, the script ./configure was told not to check for
it.

Anyway, even Asterisk 13 LTS uses symbols of libogg. Therefore, that header
should be included explicitly. Therefore, ./configure should check for that
header.

Change-Id: I98c50d56311b68880d1084fcc62c35ab2f8692db
---
M configure
M configure.ac
M formats/format_ogg_vorbis.c
3 files changed, 24 insertions(+), 13 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/configure b/configure
index 62439c7..334e794 100755
--- a/configure
+++ b/configure
@@ -23974,9 +23974,9 @@
 
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ogg_sync_init in -logg" >&5
-$as_echo_n "checking for ogg_sync_init in -logg... " >&6; }
-if ${ac_cv_lib_ogg_ogg_sync_init+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ogg_stream_init in -logg" >&5
+$as_echo_n "checking for ogg_stream_init in -logg... " >&6; }
+if ${ac_cv_lib_ogg_ogg_stream_init+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -23990,27 +23990,27 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char ogg_sync_init ();
+char ogg_stream_init ();
 int
 main ()
 {
-return ogg_sync_init ();
+return ogg_stream_init ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ogg_ogg_sync_init=yes
+  ac_cv_lib_ogg_ogg_stream_init=yes
 else
-  ac_cv_lib_ogg_ogg_sync_init=no
+  ac_cv_lib_ogg_ogg_stream_init=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ogg_ogg_sync_init" >&5
-$as_echo "$ac_cv_lib_ogg_ogg_sync_init" >&6; }
-if test "x$ac_cv_lib_ogg_ogg_sync_init" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ogg_ogg_stream_init" >&5
+$as_echo "$ac_cv_lib_ogg_ogg_stream_init" >&6; }
+if test "x$ac_cv_lib_ogg_ogg_stream_init" = xyes; then :
   AST_OGG_FOUND=yes
 else
   AST_OGG_FOUND=no
@@ -24028,8 +24028,18 @@
       fi
       OGG_INCLUDE="${OGG_INCLUDE} "
 
-         # no header, assume found
-         OGG_HEADER_FOUND="1"
+         # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${OGG_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "ogg/ogg.h" "ac_cv_header_ogg_ogg_h" "$ac_includes_default"
+if test "x$ac_cv_header_ogg_ogg_h" = xyes; then :
+  OGG_HEADER_FOUND=1
+else
+  OGG_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
 
       if test "x${OGG_HEADER_FOUND}" = "x0" ; then
          OGG_LIB=""
diff --git a/configure.ac b/configure.ac
index 6ec90f6..86dac66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2185,7 +2185,7 @@
 
 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [])
 
-AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
+AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_stream_init], [ogg/ogg.h])
 
 # Non-glibc platforms require libexecinfo for backtrace support
 AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h])
diff --git a/formats/format_ogg_vorbis.c b/formats/format_ogg_vorbis.c
index be5bb2b..ba86842 100644
--- a/formats/format_ogg_vorbis.c
+++ b/formats/format_ogg_vorbis.c
@@ -33,6 +33,7 @@
 
 #include "asterisk.h"
 
+#include <ogg/ogg.h>
 #include <vorbis/codec.h>
 #include <vorbis/vorbisenc.h>
 #include <vorbis/vorbisfile.h>

-- 
To view, visit https://gerrit.asterisk.org/8564
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I98c50d56311b68880d1084fcc62c35ab2f8692db
Gerrit-Change-Number: 8564
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180320/1589e7d7/attachment.html>


More information about the asterisk-code-review mailing list