remove useless stuff
[speexdsp.git] / acinclude.m4
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
16 AC_DEFUN(AC_PATH_LIBOGG,
17 [
18 OGG_LIBS="-logg"
19
20 AC_MSG_CHECKING([for libogg])
21
22 ac_ogg_includes=NONE ac_ogg_libraries=NONE ac_ogg_bindir=NONE
23 ogg_libraries=""
24 ogg_includes=""
25 AC_ARG_WITH(ogg-dir,
26     [  --with-ogg-dir=DIR       where the root of OGG is installed ],
27     [  ac_ogg_includes="$withval"/include
28        ac_ogg_libraries="$withval"/lib
29     ])
30
31 AC_ARG_WITH(ogg-includes,
32     [  --with-ogg-includes=DIR  where the OGG includes are. ],
33     [  
34        ac_ogg_includes="$withval"
35     ])
36     
37 ogg_libs_given=no
38
39 AC_ARG_WITH(ogg-libraries,
40     [  --with-ogg-libraries=DIR where the OGG library is installed.],
41     [  ac_ogg_libraries="$withval"
42        ogg_libs_given=yes
43     ])
44
45 ogg_incdirs="/usr/include /usr/lib/ogg/include /opt/include /usr/local/ogg/include /usr/include/ogg /usr/include /usr/local/include"
46 if test ! "$ac_ogg_includes" = "NONE"; then
47   ogg_incdirs="$ac_ogg_includes $ac_ogg_includes/.. $ogg_incdirs"
48 fi
49 AC_FIND_FILE(ogg/ogg.h, $ogg_incdirs, ogg_incdir)
50 echo "Ogg includes in $ogg_incdir"
51
52
53 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"
54 test -n "$OGGDIR" && ogg_libdirs="$OGGDIR/lib $OGGDIR $ogg_libdirs"
55 if test ! "$ac_ogg_libraries" = "NONE"; then
56   ogg_libdirs="$ac_ogg_libraries $ogg_libdirs"
57 fi
58
59 test=NONE
60 ogg_libdir=NONE
61 for dir in $ogg_libdirs; do
62   try="ls -1 $dir/libogg*"
63   if test=`eval $try 2> /dev/null`; then ogg_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
64 done
65
66 echo "Ogg libraries in $ogg_libdir"
67
68 if test "$ogg_libdir" = "NONE" || test "$ogg_incdir" = "NONE"; then
69    have_libogg=no
70 else
71    have_libogg=yes
72    AC_DEFINE(HAVE_LIBOGG)
73 fi
74
75 OGG_INCLUDES="-I$ogg_incdir"
76 OGG_LDFLAGS="-L$ogg_libdir"
77
78
79 AC_SUBST(OGG_LIBS)
80 AC_SUBST(OGG_INCLUDES)
81 AC_SUBST(OGG_LDFLAGS)
82
83 ])
84