📄 acinclude.m4
字号:
sidplay_libdirs="$ac_sidplay_library /usr/lib /usr/local/lib /usr/lib/sidplay /usr/local/lib/sidplay"AC_FIND_FILE(libsidplay.so libsidplay.so.1 libsidplay.so.1.36 libsidplay.so.1.37,$sidplay_libdirs,sidplay_foundlibdir)ac_sidplay_library=$sidplay_foundlibdirif test "$ac_sidplay_cflags" = NO || test "$ac_sidplay_library" = NO; then ac_cv_have_sidplay="have_sidplay=no" ac_sidplay_notfound="" if test "$ac_sidplay_cflags" = NO; then if test "$ac_sidplay_library" = NO; then ac_sidplay_notfound="(headers and library)"; else ac_sidplay_notfound="(headers)"; fi else ac_sidplay_notfound="(library)"; fi eval "$ac_cv_have_sidplay" AC_MSG_RESULT([$have_sidplay])else have_sidplay=yesfi]) dnl AC_CACHE_VAL(ac_cv_have_sidplay,else have_sidplay=yesfi dnl if (have_to_search)eval "$ac_cv_have_sidplay"if test "$have_sidplay" != yes; then AC_MSG_RESULT([$have_sidplay]);else ac_cv_have_sidplay="have_sidplay=yes \ ac_sidplay_cflags=$ac_sidplay_cflags ac_sidplay_library=$ac_sidplay_library" AC_MSG_RESULT([library $ac_sidplay_library, headers $ac_sidplay_cflags]) sidplay_library=$ac_sidplay_library sidplay_cflags=$ac_sidplay_cflags SIDPLAY_LIBS="-L$sidplay_library -lsidplay" all_libraries="$SIDPLAY_LIBS $all_libraries" SIDPLAY_CFLAGS="-I$sidplay_cflags" all_includes="$SIDPLAY_CFLAGS $all_includes"fidnl Test compilation.AC_MSG_CHECKING([whether -lsidplay works])ac_cxxflags_safe=$CXXFLAGSac_ldflags_safe=$LDFLAGSac_libs_safe=$LIBSCXXFLAGS="$CXXFLAGS -I$sidplay_cflags"LDFLAGS="$LDFLAGS -L$sidplay_library"LIBS="-lsidplay"AC_CACHE_VAL(ac_cv_sidplay_works,[ AC_TRY_LINK( [#include <sidplay/sidtune.h>], [sidTune* myTest;], [ac_cv_sidplay_works=yes], [ac_cv_sidplay_works=no] )])CXXFLAGS="$ac_cxxflags_safe"LDFLAGS="$ac_ldflags_safe"LIBS="$ac_libs_safe"AC_MSG_RESULT([$ac_cv_sidplay_works])if test "$ac_cv_sidplay_works" != yes; then have_sidplay=nofidnlAC_SUBST(SIDPLAY_CFLAGS)AC_SUBST(SIDPLAY_LIBS)AC_SUBST(sidplay_library)AC_SUBST(sidplay_cflags)])##--## ogg.m4# Configure paths for libogg# Jack Moffitt <jack@icecast.org> 10-21-2000# Shamelessly stolen from Owen Taylor and Manish Singhdnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBSdnlAC_DEFUN(XIPH_PATH_OGG,[dnl dnl Get the cflags and librariesdnlAC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg header files are installed (optional)], ogg_includes="$withval", ogg_includes="")AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes) if test "x$ogg_libraries" != "x" ; then OGG_LIBS="-L$ogg_libraries" elif test "x$ogg_prefix" != "x" ; then OGG_LIBS="-L$ogg_prefix/lib" elif test "x$prefix" != "xNONE" ; then OGG_LIBS="-L$prefix/lib" fi OGG_LIBS="$OGG_LIBS -logg" if test "x$ogg_includes" != "x" ; then OGG_CFLAGS="-I$ogg_includes" elif test "x$ogg_prefix" != "x" ; then OGG_CFLAGS="-I$ogg_prefix/include" elif test "x$prefix" != "xNONE"; then OGG_CFLAGS="-I$prefix/include" fi AC_MSG_CHECKING(for Ogg) no_ogg="" if test "x$enable_oggtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $OGG_CFLAGS" LIBS="$LIBS $OGG_LIBS"dnldnl Now check if the installed Ogg is sufficiently new.dnl rm -f conf.oggtest AC_TRY_RUN([#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ogg/ogg.h>int main (){ system("touch conf.oggtest"); return 0;}],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi if test "x$no_ogg" = "x" ; then AC_MSG_RESULT(yes) ifelse([$1], , :, [$1]) else AC_MSG_RESULT(no) if test -f conf.oggtest ; then : else echo "*** Could not run Ogg test program, checking why..." CFLAGS="$CFLAGS $OGG_CFLAGS" LIBS="$LIBS $OGG_LIBS" AC_TRY_LINK([#include <stdio.h>#include <ogg/ogg.h>], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding Ogg or finding the wrong" echo "*** version of Ogg. If it is not finding Ogg, 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 Ogg was incorrectly installed" echo "*** or that you have moved Ogg since it was installed." ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi OGG_CFLAGS="" OGG_LIBS="" ifelse([$2], , :, [$2]) fi AC_SUBST(OGG_CFLAGS) AC_SUBST(OGG_LIBS) rm -f conf.oggtest])##--## vorbis.m4# Configure paths for libvorbis# Jack Moffitt <jack@icecast.org> 10-21-2000# Shamelessly stolen from Owen Taylor and Manish Singh# thomasvs added check for vorbis_bitrate_addblock which is new in rc3dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBSdnlAC_DEFUN(XIPH_PATH_VORBIS,[dnl dnl Get the cflags and librariesdnlAC_ARG_WITH(vorbis,[ --with-vorbis=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")AC_ARG_WITH(vorbis-libraries,[ --with-vorbis-libraries=DIR Directory where libvorbis library is installed (optional)], vorbis_libraries="$withval", vorbis_libraries="")AC_ARG_WITH(vorbis-includes,[ --with-vorbis-includes=DIR Directory where libvorbis header files are installed (optional)], vorbis_includes="$withval", vorbis_includes="")AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes) if test "x$vorbis_libraries" != "x" ; then VORBIS_LIBS="-L$vorbis_libraries" elif test "x$vorbis_prefix" != "x" ; then VORBIS_LIBS="-L$vorbis_prefix/lib" elif test "x$prefix" != "xNONE"; then VORBIS_LIBS="-L$prefix/lib" fi VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm" VORBISFILE_LIBS="-lvorbisfile" VORBISENC_LIBS="-lvorbisenc" if test "x$vorbis_includes" != "x" ; then VORBIS_CFLAGS="-I$vorbis_includes" elif test "x$vorbis_prefix" != "x" ; then VORBIS_CFLAGS="-I$vorbis_prefix/include" elif test "x$prefix" != "xNONE"; then VORBIS_CFLAGS="-I$prefix/include" fi AC_MSG_CHECKING(for Vorbis) no_vorbis="" if test "x$enable_vorbistest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS" LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"dnldnl Now check if the installed Vorbis is sufficiently new.dnl rm -f conf.vorbistest AC_TRY_RUN([#include <stdio.h>#include <stdlib.h>#include <string.h>#include <vorbis/codec.h>#include <vorbis/vorbisenc.h>int main (){ vorbis_block vb; vorbis_dsp_state vd; vorbis_info vi; vorbis_info_init (&vi); vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1); vorbis_analysis_init (&vd, &vi); vorbis_block_init (&vd, &vb); /* this function was added in 1.0rc3, so this is what we're testing for */ vorbis_bitrate_addblock (&vb); system("touch conf.vorbistest"); return 0;}],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi if test "x$no_vorbis" = "x" ; then AC_MSG_RESULT(yes) ifelse([$1], , :, [$1]) else AC_MSG_RESULT(no) if test -f conf.vorbistest ; then : else echo "*** Could not run Vorbis test program, checking why..." CFLAGS="$CFLAGS $VORBIS_CFLAGS" LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS" AC_TRY_LINK([#include <stdio.h>#include <vorbis/codec.h>], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding Vorbis or finding the wrong" echo "*** version of Vorbis. If it is not finding Vorbis, 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 Vorbis was incorrectly installed" echo "*** or that you have moved Vorbis since it was installed." ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi VORBIS_CFLAGS="" VORBIS_LIBS="" VORBISFILE_LIBS="" VORBISENC_LIBS="" ifelse([$2], , :, [$2]) fi AC_SUBST(VORBIS_CFLAGS) AC_SUBST(VORBIS_LIBS) AC_SUBST(VORBISFILE_LIBS) AC_SUBST(VORBISENC_LIBS) rm -f conf.vorbistest])# Test for libxml by Haavard Kvaalen <havardk@xmms.org># Based on GLIB test by Owen Taylordnl AM_PATH_LIBXML([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])dnl Test for libxml, and define XML_CFLAGS and XML_LIBSdnlAC_DEFUN(AM_PATH_LIBXML,[dnl dnl Get the cflags and libraries from the xml-config scriptdnlAC_ARG_WITH(libxml-prefix, [ --with-libxml-prefix=PFX Prefix where libxml is installed (optional)], libxml_prefix="$withval", libxml_prefix="")AC_ARG_ENABLE(libxmltest, [ --disable-libxmltest Do not try to compile and run a test libxml program], , enable_libxmltest=yes) if test x$libxml_config_prefix != x ; then libxml_config_args="$libxml_config_args --prefix=$libxml_config_prefix" if test x${XML_CONFIG+set} != xset ; then XML_CONFIG=$libxml_config_prefix/bin/xml-config fi fi AC_PATH_PROG(XML_CONFIG, xml-config, no) min_libxml_version=ifelse([$1], ,1.0.0, $1) AC_MSG_CHECKING(for libxml - version >= $min_libxml_version) no_libxml="" if test "$XML_CONFIG" = "no" ; then no_libxml=yes else XML_CFLAGS=`$XML_CONFIG $libxml_config_args --cflags` XML_LIBS=`$XML_CONFIG $libxml_config_args --libs` libxml_major_version=`$XML_CONFIG $libxml_config_args --version | \ sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)[[^0-9]]*/\1/'` libxml_minor_version=`$XML_CONFIG $libxml_config_args --version | \ sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)[[^0-9]]*/\2/'` libxml_micro_version=`$XML_CONFIG $libxml_config_args --version | \ sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)[[^0-9]]*/\3/'` if test "x$enable_libxmltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $XML_CFLAGS" LIBS="$XML_LIBS $LIBS"dnldnl Now check if the installed libxml is sufficiently new. (Also sanitydnl checks the results of xml-config to some extentdnl rm -f conf.libxmltest AC_TRY_RUN([#include <stdio.h>#include <stdlib.h>#include <parser.h>char*my_strdup (char *str){ char *new_str; if (str) { new_str = malloc((strlen (str) + 1) * sizeof(char)); strcpy(new_str, str); } else new_str = NULL; return new_str;}int main (){ int major, minor, micro; char *tmp_version; system ("touch conf.libxmltest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_libxml_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_libxml_version"); exit(1); } if (($libxml_major_version > major) || (($libxml_major_version == major) && ($libxml_minor_version > minor)) || (($libxml_major_version == major) && ($libxml_minor_version == minor) && ($libxml_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libxml (%d.%d.%d) was found.\n", $libxml_major_version, $libxml_minor_version, $libxml_micro_version); printf("*** You need a version of libxml newer than %d.%d.%d.\n", major, minor, micro); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the xml-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of libxml, but you can also set the XML_CONFIG environment to point to the\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -