Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
1.9 KiB

  1. AC_DEFUN(AC_FIND_FILE,
  2. [
  3. $3=NONE
  4. for i in $2;
  5. do
  6. for j in $1;
  7. do
  8. if test -r "$i/$j"; then
  9. $3=$i
  10. break 2
  11. fi
  12. done
  13. done
  14. ])
  15. AC_DEFUN(AC_PATH_LIBOGG,
  16. [
  17. OGG_LIBS="-logg"
  18. AC_MSG_CHECKING([for libogg])
  19. ac_ogg_includes=NONE ac_ogg_libraries=NONE ac_ogg_bindir=NONE
  20. ogg_libraries=""
  21. ogg_includes=""
  22. AC_ARG_WITH(ogg-dir,
  23. [ --with-ogg-dir=DIR where the root of OGG is installed ],
  24. [ ac_ogg_includes="$withval"/include
  25. ac_ogg_libraries="$withval"/lib
  26. ])
  27. AC_ARG_WITH(ogg-includes,
  28. [ --with-ogg-includes=DIR where the OGG includes are. ],
  29. [
  30. ac_ogg_includes="$withval"
  31. ])
  32. ogg_libs_given=no
  33. AC_ARG_WITH(ogg-libraries,
  34. [ --with-ogg-libraries=DIR where the OGG library is installed.],
  35. [ ac_ogg_libraries="$withval"
  36. ogg_libs_given=yes
  37. ])
  38. ogg_incdirs="/usr/include /usr/lib/ogg/include /opt/include /usr/local/ogg/include /usr/include/ogg /usr/include /usr/local/include"
  39. if test ! "$ac_ogg_includes" = "NONE"; then
  40. ogg_incdirs="$ac_ogg_includes $ac_ogg_includes/.. $ogg_incdirs"
  41. fi
  42. AC_FIND_FILE(ogg/ogg.h, $ogg_incdirs, ogg_incdir)
  43. echo "Ogg includes in $ogg_incdir"
  44. ogg_libdirs="$ac_ogg_libraries /usr/lib/ogg/lib /usr/lib /opt/lib /usr/local/ogg/lib /usr/local/lib /usr/lib/ogg /usr/local/lib"
  45. test -n "$OGGDIR" && ogg_libdirs="$OGGDIR/lib $OGGDIR $ogg_libdirs"
  46. if test ! "$ac_ogg_libraries" = "NONE"; then
  47. ogg_libdirs="$ac_ogg_libraries $ogg_libdirs"
  48. fi
  49. test=NONE
  50. ogg_libdir=NONE
  51. for dir in $ogg_libdirs; do
  52. try="ls -1 $dir/libogg*"
  53. if test=`eval $try 2> /dev/null`; then ogg_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  54. done
  55. echo "Ogg libraries in $ogg_libdir"
  56. if test "$ogg_libdir" = "NONE" || test "$ogg_incdir" = "NONE"; then
  57. have_libogg=no
  58. else
  59. have_libogg=yes
  60. AC_DEFINE(HAVE_LIBOGG)
  61. fi
  62. OGG_INCLUDES="-I$ogg_incdir"
  63. OGG_LDFLAGS="-L$ogg_libdir"
  64. AC_SUBST(OGG_LIBS)
  65. AC_SUBST(OGG_INCLUDES)
  66. AC_SUBST(OGG_LDFLAGS)
  67. ])