⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lib-link.m4

📁 一个扑克牌游戏集合的源码,包含了很多基本c-c++语言应用
💻 M4
📖 第 1 页 / 共 2 页
字号:
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"                    dnl Potentially add DIR to rpathdirs.                    dnl The rpathdirs will be appended to $LIBNAME at the end.                    haveit=                    for x in $rpathdirs; do                      if test "X$x" = "X$found_dir"; then                        haveit=yes                        break                      fi                    done                    if test -z "$haveit"; then                      rpathdirs="$rpathdirs $found_dir"                    fi                  else                    dnl Rely on "-L$found_dir".                    dnl But don't add it if it's already contained in the LDFLAGS                    dnl or the already constructed $LIBNAME                    haveit=                    for x in $LDFLAGS $LIB[]NAME; do                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])                      if test "X$x" = "X-L$found_dir"; then                        haveit=yes                        break                      fi                    done                    if test -z "$haveit"; then                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"                    fi                    if test "$hardcode_minus_L" != no; then                      dnl FIXME: Not sure whether we should use                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"                      dnl here.                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"                    else                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH                      dnl here, because this doesn't fit in flags passed to the                      dnl compiler. So give up. No hardcoding. This affects only                      dnl very old systems.                      dnl FIXME: Not sure whether we should use                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"                      dnl here.                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"                    fi                  fi                fi              fi            else              if test "X$found_a" != "X"; then                dnl Linking with a static library.                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"              else                dnl We shouldn't come here, but anyway it's good to have a                dnl fallback.                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"              fi            fi            dnl Assume the include files are nearby.            additional_includedir=            case "$found_dir" in              */lib | */lib/)                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`                additional_includedir="$basedir/include"                ;;            esac            if test "X$additional_includedir" != "X"; then              dnl Potentially add $additional_includedir to $INCNAME.              dnl But don't add it              dnl   1. if it's the standard /usr/include,              dnl   2. if it's /usr/local/include and we are using GCC on Linux,              dnl   3. if it's already present in $CPPFLAGS or the already              dnl      constructed $INCNAME,              dnl   4. if it doesn't exist as a directory.              if test "X$additional_includedir" != "X/usr/include"; then                haveit=                if test "X$additional_includedir" = "X/usr/local/include"; then                  if test -n "$GCC"; then                    case $host_os in                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;                    esac                  fi                fi                if test -z "$haveit"; then                  for x in $CPPFLAGS $INC[]NAME; do                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])                    if test "X$x" = "X-I$additional_includedir"; then                      haveit=yes                      break                    fi                  done                  if test -z "$haveit"; then                    if test -d "$additional_includedir"; then                      dnl Really add $additional_includedir to $INCNAME.                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"                    fi                  fi                fi              fi            fi            dnl Look for dependencies.            if test -n "$found_la"; then              dnl Read the .la file. It defines the variables              dnl dlname, library_names, old_library, dependency_libs, current,              dnl age, revision, installed, dlopen, dlpreopen, libdir.              save_libdir="$libdir"              case "$found_la" in                */* | *\\*) . "$found_la" ;;                *) . "./$found_la" ;;              esac              libdir="$save_libdir"              dnl We use only dependency_libs.              for dep in $dependency_libs; do                case "$dep" in                  -L*)                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.                    dnl But don't add it                    dnl   1. if it's the standard /usr/lib,                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,                    dnl   3. if it's already present in $LDFLAGS or the already                    dnl      constructed $LIBNAME,                    dnl   4. if it doesn't exist as a directory.                    if test "X$additional_libdir" != "X/usr/lib"; then                      haveit=                      if test "X$additional_libdir" = "X/usr/local/lib"; then                        if test -n "$GCC"; then                          case $host_os in                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;                          esac                        fi                      fi                      if test -z "$haveit"; then                        haveit=                        for x in $LDFLAGS $LIB[]NAME; do                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])                          if test "X$x" = "X-L$additional_libdir"; then                            haveit=yes                            break                          fi                        done                        if test -z "$haveit"; then                          if test -d "$additional_libdir"; then                            dnl Really add $additional_libdir to $LIBNAME.                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"                          fi                        fi                        haveit=                        for x in $LDFLAGS $LTLIB[]NAME; do                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])                          if test "X$x" = "X-L$additional_libdir"; then                            haveit=yes                            break                          fi                        done                        if test -z "$haveit"; then                          if test -d "$additional_libdir"; then                            dnl Really add $additional_libdir to $LTLIBNAME.                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"                          fi                        fi                      fi                    fi                    ;;                  -R*)                    dir=`echo "X$dep" | sed -e 's/^X-R//'`                    if test "$enable_rpath" != no; then                      dnl Potentially add DIR to rpathdirs.                      dnl The rpathdirs will be appended to $LIBNAME at the end.                      haveit=                      for x in $rpathdirs; do                        if test "X$x" = "X$dir"; then                          haveit=yes                          break                        fi                      done                      if test -z "$haveit"; then                        rpathdirs="$rpathdirs $dir"                      fi                      dnl Potentially add DIR to ltrpathdirs.                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.                      haveit=                      for x in $ltrpathdirs; do                        if test "X$x" = "X$dir"; then                          haveit=yes                          break                        fi                      done                      if test -z "$haveit"; then                        ltrpathdirs="$ltrpathdirs $dir"                      fi                    fi                    ;;                  -l*)                    dnl Handle this in the next round.                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`                    ;;                  *.la)                    dnl Handle this in the next round. Throw away the .la's                    dnl directory; it is already contained in a preceding -L                    dnl option.                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`                    ;;                  *)                    dnl Most likely an immediate library name.                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"                    ;;                esac              done            fi          else            dnl Didn't find the library; assume it is in the system directories            dnl known to the linker and runtime loader. (All the system            dnl directories known to the linker should also be known to the            dnl runtime loader, otherwise the system is severely misconfigured.)            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"          fi        fi      fi    done  done  if test "X$rpathdirs" != "X"; then    if test -n "$hardcode_libdir_separator"; then      dnl Weird platform: only the last -rpath option counts, the user must      dnl pass all path elements in one option. We can arrange that for a      dnl single library, but not when more than one $LIBNAMEs are used.      alldirs=      for found_dir in $rpathdirs; do        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"      done      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.      acl_save_libdir="$libdir"      libdir="$alldirs"      eval flag=\"$hardcode_libdir_flag_spec\"      libdir="$acl_save_libdir"      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"    else      dnl The -rpath options are cumulative.      for found_dir in $rpathdirs; do        acl_save_libdir="$libdir"        libdir="$found_dir"        eval flag=\"$hardcode_libdir_flag_spec\"        libdir="$acl_save_libdir"        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"      done    fi  fi  if test "X$ltrpathdirs" != "X"; then    dnl When using libtool, the option that works for both libraries and    dnl executables is -R. The -R options are cumulative.    for found_dir in $ltrpathdirs; do      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"    done  fi])dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,dnl unless already present in VAR.dnl Works only for CPPFLAGS, not for LIB* variables because that sometimesdnl contains two or three consecutive elements that belong together.AC_DEFUN([AC_LIB_APPENDTOVAR],[  for element in [$2]; do    haveit=    for x in $[$1]; do      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])      if test "X$x" = "X$element"; then        haveit=yes        break      fi    done    if test -z "$haveit"; then      [$1]="${[$1]}${[$1]:+ }$element"    fi  done])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -