📄 acinclude.m4
字号:
dnldnl AC_LIB_RAW1394_FLAGSdnl This just unconditionally sets the options. It should offer an option fordnl explicitly giving the path to libraw1394 on the configure command line.dnlAC_DEFUN([AC_LIB_RAW1394_FLAGS], [LIBRAW1394_CPPFLAGS=""LIBRAW1394_CFLAGS=""LIBRAW1394_LIBS="-lraw1394"AC_SUBST(LIBRAW1394_CPPFLAGS)AC_SUBST(LIBRAW1394_CFLAGS)AC_SUBST(LIBRAW1394_LIBS)])dnldnl AC_LIB_RAW1394_HEADERS([ACTION_IF_FOUND[,ACTION_IF_NOT_FOUND]])dnlAC_DEFUN([AC_LIB_RAW1394_HEADERS], [AC_REQUIRE([AC_LIB_RAW1394_FLAGS])ac_libraw1394_save_cppflags=$CPPFLAGSCPPFLAGS="$LIBRAW1394_CPPFLAGS $CPPFLAGS"ac_libraw1394_headers=noAC_CHECK_HEADER(libraw1394/raw1394.h, ac_libraw1394_headers=yes)CPPFLAGS=$ac_libraw1394_save_cppflagsif test $ac_libraw1394_headers = yes ; then ifelse([$1], , :, $1)else ifelse([$2], , :, $2)fi])dnldnl AC_LIB_RAW1394_LIBVERSION(MINIMUMVERSION[,ACTION_IF_FOUND[,ACTION_IF_NOT_FOUND]])dnlAC_DEFUN([AC_LIB_RAW1394_LIBVERSION], [AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_LIB_RAW1394_FLAGS])ac_libraw1394_save_cppflags=$CPPFLAGSac_libraw1394_save_cflags=$CFLAGSac_libraw1394_save_libs=$LIBSCPPFLAGS="$LIBRAW1394_CPPFLAGS $CPPFLAGS"CFLAGS="$LIBRAW1394_CFLAGS $CFLAGS"LIBS="$LIBRAW1394_LIBS $LIBS"ac_libraw1394_versiontest_success=noac_libraw1394_ver_symbol=`echo __libraw1394_version_$1 | sed 's/\./_/g'`AC_TRY_LINK([], [{ extern char $ac_libraw1394_ver_symbol; $ac_libraw1394_ver_symbol++;}], ac_libraw1394_versiontest_success=yes)CPPFLAGS=$ac_libraw1394_save_cppflagsCFLAGS=$ac_libraw1394_save_cflagsLIBS=$ac_libraw1394_save_libsif test $ac_libraw1394_versiontest_success = yes; then ifelse([$2], , :, $2)else ifelse([$3], , :, $3)fi])dnldnl AC_LIB_RAW1394_RUNTEST(MINIMUMVERSION[,ACTION_IF_FOUNDdnl [,ACTION_IF_NOT_FOUND[,ACTION_IF_CROSS_COMPILING]]])AC_DEFUN([AC_LIB_RAW1394_RUNTEST], [ac_libraw1394_save_cppflags=$CPPFLAGSac_libraw1394_save_cflags=$CFLAGSac_libraw1394_save_libs=$LIBSCPPFLAGS="$LIBRAW1394_CPPFLAGS $CPPFLAGS"CFLAGS="$LIBRAW1394_CFLAGS $CFLAGS"LIBS="$LIBRAW1394_LIBS $LIBS"dnl This program compares two version strings and returns with code 0 ifdnl req_ver <= lib_ver, returns 1 otherwise.dnl dnl "1.23" < "1.23.1" (missing fields assumed zero)dnl "1.23pre" <> "1.23" (undefined, do not use text as version)dnl "1.21" > "1.3" (no implicit delimiters)AC_TRY_RUN([#include <stdlib.h>#include <libraw1394/raw1394.h>int main(){ char *req_ver, *lib_ver; unsigned int req_i, lib_i; req_ver = "$1"; lib_ver = raw1394_get_libversion(); while (1) { req_i = strtoul(req_ver, &req_ver, 10); lib_i = strtoul(lib_ver, &lib_ver, 10); if (req_i > lib_i) exit(1); if (req_i < lib_i) exit(0); if (*req_ver != '.' || *lib_ver != '.') exit(0); req_ver++; lib_ver++; }}], ac_libraw1394_run=yes, ac_libraw1394_run=no, ac_libraw1394_run=cross)CPPFLAGS=$ac_libraw1394_save_cppflagsCFLAGS=$ac_libraw1394_save_cflagsLIBS=$ac_libraw1394_save_libsif test $ac_libraw1394_run = yes; then ifelse([$2], , :, $2)elif test $ac_libraw1394_run = no; then ifelse([$3], , :, $3)else ifelse([$4], , AC_MSG_ERROR([no default for cross compiling in libraw1394 runtest macro]), [$4])fi])dnldnl AC_LIB_RAW1394(MINIMUMVERSION[,ACTION_IF_FOUND[,ACTION_IF_NOT_FOUND]])dnldnl Versions before 0.9 can't be checked, so this will always fail if thednl installed libraw1394 is older than 0.9 as if the library weren't found.dnlAC_DEFUN([AC_LIB_RAW1394], [AC_LIB_RAW1394_FLAGSAC_LIB_RAW1394_HEADERS(ac_libraw1394_found=yes, ac_libraw1394_found=no)if test $ac_libraw1394_found = yes ; thenAC_MSG_CHECKING(for libraw1394 version >= [$1])AC_LIB_RAW1394_RUNTEST([$1], , ac_libraw1394_found=no, AC_LIB_RAW1394_LIBVERSION([$1], , ac_libraw1394_found=no))if test $ac_libraw1394_found = yes ; then AC_MSG_RESULT(yes) $2else AC_MSG_RESULT(no) $3fifi])dnl AC_TRY_CFLAGS (CFLAGS, [ACTION-IF-WORKS], [ACTION-IF-FAILS])dnl check if $CC supports a given set of cflagsAC_DEFUN([AC_TRY_CFLAGS], [AC_MSG_CHECKING([if $CC supports $1 flags]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$1" AC_TRY_COMPILE([],[],[ac_cv_try_cflags_ok=yes],[ac_cv_try_cflags_ok=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_RESULT([$ac_cv_try_cflags_ok]) if test x"$ac_cv_try_cflags_ok" = x"yes"; then ifelse([$2],[],[:],[$2]) else ifelse([$3],[],[:],[$3]) fi])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -