annotate src/libogg-1.3.0/ogg.m4 @ 83:ae30d91d2ffe

Replace these with versions built using an older toolset (so as to avoid ABI compatibilities when linking on Ubuntu 14.04 for packaging purposes)
author Chris Cannam
date Fri, 07 Feb 2020 11:51:13 +0000
parents 05aa0afa9217
children
rev   line source
Chris@1 1 # Configure paths for libogg
Chris@1 2 # Jack Moffitt <jack@icecast.org> 10-21-2000
Chris@1 3 # Shamelessly stolen from Owen Taylor and Manish Singh
Chris@1 4
Chris@1 5 dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
Chris@1 6 dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
Chris@1 7 dnl
Chris@1 8 AC_DEFUN([XIPH_PATH_OGG],
Chris@1 9 [dnl
Chris@1 10 dnl Get the cflags and libraries
Chris@1 11 dnl
Chris@1 12 AC_ARG_WITH(ogg,AC_HELP_STRING([--with-ogg=PFX],[Prefix where libogg is installed (optional)]), ogg_prefix="$withval", ogg_prefix="")
Chris@1 13 AC_ARG_WITH(ogg-libraries,AC_HELP_STRING([--with-ogg-libraries=DIR],[Directory where libogg library is installed (optional)]), ogg_libraries="$withval", ogg_libraries="")
Chris@1 14 AC_ARG_WITH(ogg-includes,AC_HELP_STRING([--with-ogg-includes=DIR],[Directory where libogg header files are installed (optional)]), ogg_includes="$withval", ogg_includes="")
Chris@1 15 AC_ARG_ENABLE(oggtest,AC_HELP_STRING([--disable-oggtest],[Do not try to compile and run a test Ogg program]),, enable_oggtest=yes)
Chris@1 16
Chris@1 17 if test "x$ogg_libraries" != "x" ; then
Chris@1 18 OGG_LIBS="-L$ogg_libraries"
Chris@1 19 elif test "x$ogg_prefix" = "xno" || test "x$ogg_prefix" = "xyes" ; then
Chris@1 20 OGG_LIBS=""
Chris@1 21 elif test "x$ogg_prefix" != "x" ; then
Chris@1 22 OGG_LIBS="-L$ogg_prefix/lib"
Chris@1 23 elif test "x$prefix" != "xNONE" ; then
Chris@1 24 OGG_LIBS="-L$prefix/lib"
Chris@1 25 fi
Chris@1 26
Chris@1 27 if test "x$ogg_prefix" != "xno" ; then
Chris@1 28 OGG_LIBS="$OGG_LIBS -logg"
Chris@1 29 fi
Chris@1 30
Chris@1 31 if test "x$ogg_includes" != "x" ; then
Chris@1 32 OGG_CFLAGS="-I$ogg_includes"
Chris@1 33 elif test "x$ogg_prefix" = "xno" || test "x$ogg_prefix" = "xyes" ; then
Chris@1 34 OGG_CFLAGS=""
Chris@1 35 elif test "x$ogg_prefix" != "x" ; then
Chris@1 36 OGG_CFLAGS="-I$ogg_prefix/include"
Chris@1 37 elif test "x$prefix" != "xNONE"; then
Chris@1 38 OGG_CFLAGS="-I$prefix/include"
Chris@1 39 fi
Chris@1 40
Chris@1 41 AC_MSG_CHECKING(for Ogg)
Chris@1 42 if test "x$ogg_prefix" = "xno" ; then
Chris@1 43 no_ogg="disabled"
Chris@1 44 enable_oggtest="no"
Chris@1 45 else
Chris@1 46 no_ogg=""
Chris@1 47 fi
Chris@1 48
Chris@1 49
Chris@1 50 if test "x$enable_oggtest" = "xyes" ; then
Chris@1 51 ac_save_CFLAGS="$CFLAGS"
Chris@1 52 ac_save_LIBS="$LIBS"
Chris@1 53 CFLAGS="$CFLAGS $OGG_CFLAGS"
Chris@1 54 LIBS="$LIBS $OGG_LIBS"
Chris@1 55 dnl
Chris@1 56 dnl Now check if the installed Ogg is sufficiently new.
Chris@1 57 dnl
Chris@1 58 rm -f conf.oggtest
Chris@1 59 AC_TRY_RUN([
Chris@1 60 #include <stdio.h>
Chris@1 61 #include <stdlib.h>
Chris@1 62 #include <string.h>
Chris@1 63 #include <ogg/ogg.h>
Chris@1 64
Chris@1 65 int main ()
Chris@1 66 {
Chris@1 67 system("touch conf.oggtest");
Chris@1 68 return 0;
Chris@1 69 }
Chris@1 70
Chris@1 71 ],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
Chris@1 72 CFLAGS="$ac_save_CFLAGS"
Chris@1 73 LIBS="$ac_save_LIBS"
Chris@1 74 fi
Chris@1 75
Chris@1 76 if test "x$no_ogg" = "xdisabled" ; then
Chris@1 77 AC_MSG_RESULT(no)
Chris@1 78 ifelse([$2], , :, [$2])
Chris@1 79 elif test "x$no_ogg" = "x" ; then
Chris@1 80 AC_MSG_RESULT(yes)
Chris@1 81 ifelse([$1], , :, [$1])
Chris@1 82 else
Chris@1 83 AC_MSG_RESULT(no)
Chris@1 84 if test -f conf.oggtest ; then
Chris@1 85 :
Chris@1 86 else
Chris@1 87 echo "*** Could not run Ogg test program, checking why..."
Chris@1 88 CFLAGS="$CFLAGS $OGG_CFLAGS"
Chris@1 89 LIBS="$LIBS $OGG_LIBS"
Chris@1 90 AC_TRY_LINK([
Chris@1 91 #include <stdio.h>
Chris@1 92 #include <ogg/ogg.h>
Chris@1 93 ], [ return 0; ],
Chris@1 94 [ echo "*** The test program compiled, but did not run. This usually means"
Chris@1 95 echo "*** that the run-time linker is not finding Ogg or finding the wrong"
Chris@1 96 echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
Chris@1 97 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
Chris@1 98 echo "*** to the installed location Also, make sure you have run ldconfig if that"
Chris@1 99 echo "*** is required on your system"
Chris@1 100 echo "***"
Chris@1 101 echo "*** If you have an old version installed, it is best to remove it, although"
Chris@1 102 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
Chris@1 103 [ echo "*** The test program failed to compile or link. See the file config.log for the"
Chris@1 104 echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
Chris@1 105 echo "*** or that you have moved Ogg since it was installed." ])
Chris@1 106 CFLAGS="$ac_save_CFLAGS"
Chris@1 107 LIBS="$ac_save_LIBS"
Chris@1 108 fi
Chris@1 109 OGG_CFLAGS=""
Chris@1 110 OGG_LIBS=""
Chris@1 111 ifelse([$2], , :, [$2])
Chris@1 112 fi
Chris@1 113 AC_SUBST(OGG_CFLAGS)
Chris@1 114 AC_SUBST(OGG_LIBS)
Chris@1 115 rm -f conf.oggtest
Chris@1 116 ])