aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/lame.m4111
-rw-r--r--m4/libOggFLAC.m4116
-rw-r--r--m4/libwrap.m414
-rw-r--r--m4/pretty_print.m419
4 files changed, 33 insertions, 227 deletions
diff --git a/m4/lame.m4 b/m4/lame.m4
deleted file mode 100644
index 0723f7dba..000000000
--- a/m4/lame.m4
+++ /dev/null
@@ -1,111 +0,0 @@
-dnl borrowed from oddsock.org
-dnl AM_PATH_LAME([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Test for liblame, and define LAME_CFLAGS and LAME_LIBS
-dnl
-AC_DEFUN([AM_PATH_LAME],
-[dnl
-dnl Get the cflags and libraries
-dnl
-AC_ARG_WITH(lame,
- AS_HELP_STRING([--with-lame=PFX],
- [prefix where liblame is installed (optional)]),,
- lame_prefix="")
-AC_ARG_WITH(lame-libraries,
- AS_HELP_STRING([--with-lame-libraries=DIR],
- [directory where liblame library is installed (optional)]),,
- lame_libraries="")
-AC_ARG_WITH(lame-includes,
- AS_HELP_STRING([--with-lame-includes=DIR],
- [directory where liblame header files are installed (optional)]),,
- lame_includes="")
-
-if test "x$lame_prefix" != "xno" ; then
-
- if test "x$lame_libraries" != "x" ; then
- LAME_LIBS="-L$lame_libraries"
- elif test "x$lame_prefix" != "x" ; then
- LAME_LIBS="-L$lame_prefix/lib"
- elif test "x$prefix" != "xNONE" ; then
- LAME_LIBS="-L$prefix/lib"
- fi
-
- LAME_LIBS="$LAME_LIBS -lmp3lame -lm"
-
- if test "x$lame_includes" != "x" ; then
- LAME_CFLAGS="-I$lame_includes"
- elif test "x$lame_prefix" != "x" ; then
- LAME_CFLAGS="-I$lame_prefix/include"
- elif test "x$prefix" != "xNONE"; then
- LAME_CFLAGS="-I$prefix/include"
- fi
-
- AC_MSG_CHECKING(for liblame)
- no_lame=""
-
-
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $LAME_CFLAGS"
- LIBS="$LIBS $LAME_LIBS"
-dnl
-dnl Now check if the installed liblame is sufficiently new.
-dnl
- rm -f conf.lametest
- AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <lame/lame.h>
-
-int main ()
-{
- system("touch conf.lametest");
- return 0;
-}
-
-],, no_lame=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
-
- if test "x$no_lame" = "x" ; then
- AC_MSG_RESULT(yes)
- ifelse([$1], , :, [$1])
- else
- AC_MSG_RESULT(no)
- if test -f conf.lametest ; then
- :
- else
- echo "*** Could not run liblame test program, checking why..."
- CFLAGS="$CFLAGS $LAME_CFLAGS"
- LIBS="$LIBS $LAME_LIBS"
- AC_TRY_LINK([
-#include <stdio.h>
-#include <lame/lame.h>
-], [ return 0; ],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding liblame or finding the wrong"
- echo "*** version of liblame. If it is not finding liblame, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means liblame was incorrectly installed"
- echo "*** or that you have moved liblame since it was installed." ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- LAME_CFLAGS=""
- LAME_LIBS=""
- ifelse([$2], , :, [$2])
- fi
- AC_DEFINE(HAVE_LAME, 1, [Define if you have liblame.])
- use_lame="1"
- AC_SUBST(LAME_CFLAGS)
- AC_SUBST(LAME_LIBS)
- rm -f conf.lametest
-])
-
diff --git a/m4/libOggFLAC.m4 b/m4/libOggFLAC.m4
deleted file mode 100644
index 8167c4d68..000000000
--- a/m4/libOggFLAC.m4
+++ /dev/null
@@ -1,116 +0,0 @@
-# Configure paths for libOggFLAC
-# "Inspired" by ogg.m4
-
-dnl AM_PATH_LIBOGGFLAC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Test for libOggFLAC, and define LIBOGGFLAC_CFLAGS and LIBOGGFLAC_LIBS
-dnl
-AC_DEFUN([AM_PATH_LIBOGGFLAC],
-[dnl
-dnl Get the cflags and libraries
-dnl
-AC_ARG_WITH(libOggFLAC,
- AS_HELP_STRING([--with-libOggFLAC=PFX],
- [prefix where libOggFLAC is installed (optional)]),,
- libOggFLAC_prefix="")
-AC_ARG_WITH(libOggFLAC-libraries,
- AS_HELP_STRING([--with-libOggFLAC-libraries=DIR],
- [directory where libOggFLAC library is installed (optional)]),,
- libOggFLAC_libraries="")
-AC_ARG_WITH(libOggFLAC-includes,
- AS_HELP_STRING([--with-libOggFLAC-includes=DIR],
- [directory where libOggFLAC header files are installed (optional)]),,
- libOggFLAC_includes="")
-AC_ARG_ENABLE(libOggFLACtest,
- AS_HELP_STRING([--disable-libOggFLACtest],
- [do not try to compile and run a test libOggFLAC program]),,
- enable_libOggFLACtest=yes)
-
- if test "x$libOggFLAC_libraries" != "x" ; then
- LIBOGGFLAC_LIBS="-L$libOggFLAC_libraries"
- elif test "x$libOggFLAC_prefix" != "x" ; then
- LIBOGGFLAC_LIBS="-L$libOggFLAC_prefix/lib"
- elif test "x$prefix" != "xNONE" ; then
- LIBOGGFLAC_LIBS="-L$libdir"
- fi
-
- LIBOGGFLAC_LIBS="$LIBOGGFLAC_LIBS -lOggFLAC -lFLAC -lm"
-
- if test "x$libOggFLAC_includes" != "x" ; then
- LIBOGGFLAC_CFLAGS="-I$libOggFLAC_includes"
- elif test "x$libOggFLAC_prefix" != "x" ; then
- LIBOGGFLAC_CFLAGS="-I$libOggFLAC_prefix/include"
- elif test "x$prefix" != "xNONE"; then
- LIBOGGFLAC_CFLAGS="-I$prefix/include"
- fi
-
- AC_MSG_CHECKING(for libOggFLAC)
- no_libOggFLAC=""
-
-
- if test "x$enable_libOggFLACtest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_CXXFLAGS="$CXXFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $LIBOGGFLAC_CFLAGS"
- CXXFLAGS="$CXXFLAGS $LIBOGGFLAC_CFLAGS"
- LIBS="$LIBS $LIBOGGFLAC_LIBS"
-dnl
-dnl Now check if the installed libOggFLAC is sufficiently new.
-dnl
- rm -f conf.libOggFLACtest
- AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <OggFLAC/stream_decoder.h>
-
-int main ()
-{
- system("touch conf.libOggFLACtest");
- return 0;
-}
-
-],, no_libOggFLAC=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
-
- if test "x$no_libOggFLAC" = "x" ; then
- AC_MSG_RESULT(yes)
- ifelse([$1], , :, [$1])
- else
- AC_MSG_RESULT(no)
- if test -f conf.libOggFLACtest ; then
- :
- else
- echo "*** Could not run libOggFLAC test program, checking why..."
- CFLAGS="$CFLAGS $LIBOGGFLAC_CFLAGS"
- LIBS="$LIBS $LIBOGGFLAC_LIBS"
- AC_TRY_LINK([
-#include <stdio.h>
-#include <OggFLAC/stream_decoder.h>
-], [ return 0; ],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding libOggFLAC or finding the wrong"
- echo "*** version of libOggFLAC. If it is not finding libOggFLAC, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means libOggFLAC was incorrectly installed"
- echo "*** or that you have moved libOggFLAC since it was installed. In the latter case, you"
- echo "*** may want to edit the libOggFLAC-config script: $LIBOGGFLAC_CONFIG" ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- LIBOGGFLAC_CFLAGS=""
- LIBOGGFLAC_LIBS=""
- ifelse([$2], , :, [$2])
- fi
- AC_SUBST(LIBOGGFLAC_CFLAGS)
- AC_SUBST(LIBOGGFLAC_LIBS)
- rm -f conf.libOggFLACtest
-])
diff --git a/m4/libwrap.m4 b/m4/libwrap.m4
new file mode 100644
index 000000000..5ad3df19b
--- /dev/null
+++ b/m4/libwrap.m4
@@ -0,0 +1,14 @@
+dnl
+dnl Usage:
+dnl AC_CHECK_LIBWRAP([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl
+
+AC_DEFUN([AC_CHECK_LIBWRAP],[
+ AC_CHECK_HEADERS([tcpd.h],
+ AC_CHECK_LIB([wrap], [request_init],
+ [LIBWRAP_CFLAGS=""
+ LIBWRAP_LDFLAGS="-lwrap"
+ $1],
+ $2),
+ $2)
+])
diff --git a/m4/pretty_print.m4 b/m4/pretty_print.m4
new file mode 100644
index 000000000..a22357a8d
--- /dev/null
+++ b/m4/pretty_print.m4
@@ -0,0 +1,19 @@
+AC_DEFUN([results], [
+ dnl This is a hack to allow "with" names, otherwise "enable".
+ num=`expr match $1 'with'`
+ if test "$num" != "0"; then
+ var="`echo '$'$1`"
+ else
+ var="`echo '$'enable_$1`"
+ fi
+
+ echo -n '('
+ if eval "test x$var = xyes"; then
+ echo -n '+'
+ elif test -n "$3" && eval "test x$var = x$3"; then
+ echo -n '+'
+ else
+ echo -n '-'
+ fi
+ echo -n "$2) "
+])