📄 lqt_opt_cflags.m4
字号:
## Automatic OPT_CFLAGS generation by Burkhard Plaum (2005-05-24)#dnl LQT_TRY_CFLAGS (CFLAGS, [ACTION-IF-WORKS], [ACTION-IF-FAILS])dnl check if $CC supports a given set of cflagsAC_DEFUN([LQT_TRY_CFLAGS], [AC_MSG_CHECKING([if $CC supports $1 flags]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$1" AC_TRY_COMPILE([],[],[lqt_try_cflags_ok=yes],[lqt_try_cflags_ok=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_RESULT([$lqt_try_cflags_ok]) if test x"$lqt_try_cflags_ok" = x"yes"; then ifelse([$2],[],[:],[$2]) else ifelse([$3],[],[:],[$3]) fi])dnl LQT_OPT_CFLAGS(CPU_TYPE [, ADDITIONAL_OPT_FLAGS])dnl Get proper optimization flags. dnldnl CPU_TYPE: host_cpu variable as obtained from AC_CANONICAL_HOSTdnl ADDITIONAL_OPT_FLAGS: Additional optimization flags (e.g. -O3 --fast-math)dnl On output, the Variable LQT_OPT_CFLAGS will be set to the compiler flagsdnl Furthermore, is debuggind was requested, the variable LQT_DEBUG will bednl set to "true"AC_DEFUN([LQT_OPT_CFLAGS],[dnldnl Debugging SupportdnlLQT_DEBUG=falseAC_ARG_ENABLE(debug,[AC_HELP_STRING([--enable-debug],[Enable debugging, disable optimization])],[case "${enableval}" in yes) LQT_DEBUG=true ;; no) LQT_DEBUG=false ;;esac],[LQT_DEBUG=false])dnldnl Extra cflags from the commandline. Can have the special values "none" or "auto"dnlAC_ARG_WITH(cpuflags, AC_HELP_STRING([--with-cpuflags],[Set CPU specific compiler flags. Default is auto, which does autodetection. Specify none for compiling the most portable binaries]), lqt_cpuflags="$withval", lqt_cpuflags="auto")if test "x$lqt_cpuflags" = "xnone"; thenlqt_cpuflags=""fidnldnl Autodetect CPU specific flagsdnlif test "x$lqt_cpuflags" = "xauto"; thenlqt_cpu_family=""case [$1] in i[[3-7]]86) lqt_cpu_family=x86;; x86_64*) lqt_cpu_family=x86;; powerpc | powerpc64) lqt_cpu_family=ppc;; *) lqt_cpu_family="";;esacif test x$lqt_cpu_family = x; then lqt_cpuflags=""else lqt_cpuflags=`$srcdir/cpuinfo.sh $lqt_cpu_family`fifidnldnl Build the final flagsdnllqt_additional_opt_flags=ifelse([$2],[],[],[$2])lqt_test_flags=$lqt_cpuflagsif test x$LQT_DEBUG = xtrue; then lqt_test_cflags="$lqt_test_flags -g"else lqt_test_cflags="$lqt_test_flags $lqt_additional_opt_flags"fiOPT_CFLAGS=""for i in $lqt_test_cflags; do LQT_TRY_CFLAGS($i, OPT_CFLAGS="$OPT_CFLAGS $i") ;done])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -