OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [binutils-2.20.1/] [config/] [lib-prefix.m4] - Diff between revs 816 and 818

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 816 Rev 818
# lib-prefix.m4 serial 2 (gettext-0.12)
# lib-prefix.m4 serial 2 (gettext-0.12)
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License.  As a special exception to the GNU General
dnl General Public License.  As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl the same distribution terms as the rest of that program.
 
 
dnl From Bruno Haible.
dnl From Bruno Haible.
 
 
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
dnl require excessive bracketing.
dnl require excessive bracketing.
ifdef([AC_HELP_STRING],
ifdef([AC_HELP_STRING],
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
 
 
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
dnl a user will want packages to use other packages he previously installed
dnl with the same --prefix option.
dnl with the same --prefix option.
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
dnl libraries, but is otherwise very convenient.
dnl libraries, but is otherwise very convenient.
AC_DEFUN([AC_LIB_PREFIX],
AC_DEFUN([AC_LIB_PREFIX],
[
[
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
  AC_REQUIRE([AC_PROG_CC])
  AC_REQUIRE([AC_PROG_CC])
  AC_REQUIRE([AC_CANONICAL_HOST])
  AC_REQUIRE([AC_CANONICAL_HOST])
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  dnl By default, look in $includedir and $libdir.
  dnl By default, look in $includedir and $libdir.
  use_additional=yes
  use_additional=yes
  AC_LIB_WITH_FINAL_PREFIX([
  AC_LIB_WITH_FINAL_PREFIX([
    eval additional_includedir=\"$includedir\"
    eval additional_includedir=\"$includedir\"
    eval additional_libdir=\"$libdir\"
    eval additional_libdir=\"$libdir\"
  ])
  ])
  AC_LIB_ARG_WITH([lib-prefix],
  AC_LIB_ARG_WITH([lib-prefix],
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
  --without-lib-prefix    don't search for libraries in includedir and libdir],
  --without-lib-prefix    don't search for libraries in includedir and libdir],
[
[
    if test "X$withval" = "Xno"; then
    if test "X$withval" = "Xno"; then
      use_additional=no
      use_additional=no
    else
    else
      if test "X$withval" = "X"; then
      if test "X$withval" = "X"; then
        AC_LIB_WITH_FINAL_PREFIX([
        AC_LIB_WITH_FINAL_PREFIX([
          eval additional_includedir=\"$includedir\"
          eval additional_includedir=\"$includedir\"
          eval additional_libdir=\"$libdir\"
          eval additional_libdir=\"$libdir\"
        ])
        ])
      else
      else
        additional_includedir="$withval/include"
        additional_includedir="$withval/include"
        additional_libdir="$withval/lib"
        additional_libdir="$withval/lib"
      fi
      fi
    fi
    fi
])
])
  if test $use_additional = yes; then
  if test $use_additional = yes; then
    dnl Potentially add $additional_includedir to $CPPFLAGS.
    dnl Potentially add $additional_includedir to $CPPFLAGS.
    dnl But don't add it
    dnl But don't add it
    dnl   1. if it's the standard /usr/include,
    dnl   1. if it's the standard /usr/include,
    dnl   2. if it's already present in $CPPFLAGS,
    dnl   2. if it's already present in $CPPFLAGS,
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
    dnl   4. if it doesn't exist as a directory.
    dnl   4. if it doesn't exist as a directory.
    if test "X$additional_includedir" != "X/usr/include"; then
    if test "X$additional_includedir" != "X/usr/include"; then
      haveit=
      haveit=
      for x in $CPPFLAGS; do
      for x in $CPPFLAGS; do
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
        if test "X$x" = "X-I$additional_includedir"; then
        if test "X$x" = "X-I$additional_includedir"; then
          haveit=yes
          haveit=yes
          break
          break
        fi
        fi
      done
      done
      if test -z "$haveit"; then
      if test -z "$haveit"; then
        if test "X$additional_includedir" = "X/usr/local/include"; then
        if test "X$additional_includedir" = "X/usr/local/include"; then
          if test -n "$GCC"; then
          if test -n "$GCC"; then
            case $host_os in
            case $host_os in
              linux*) haveit=yes;;
              linux*) haveit=yes;;
            esac
            esac
          fi
          fi
        fi
        fi
        if test -z "$haveit"; then
        if test -z "$haveit"; then
          if test -d "$additional_includedir"; then
          if test -d "$additional_includedir"; then
            dnl Really add $additional_includedir to $CPPFLAGS.
            dnl Really add $additional_includedir to $CPPFLAGS.
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
          fi
          fi
        fi
        fi
      fi
      fi
    fi
    fi
    dnl Potentially add $additional_libdir to $LDFLAGS.
    dnl Potentially add $additional_libdir to $LDFLAGS.
    dnl But don't add it
    dnl But don't add it
    dnl   1. if it's the standard /usr/lib,
    dnl   1. if it's the standard /usr/lib,
    dnl   2. if it's already present in $LDFLAGS,
    dnl   2. if it's already present in $LDFLAGS,
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
    dnl   4. if it doesn't exist as a directory.
    dnl   4. if it doesn't exist as a directory.
    if test "X$additional_libdir" != "X/usr/lib"; then
    if test "X$additional_libdir" != "X/usr/lib"; then
      haveit=
      haveit=
      for x in $LDFLAGS; do
      for x in $LDFLAGS; do
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
        if test "X$x" = "X-L$additional_libdir"; then
        if test "X$x" = "X-L$additional_libdir"; then
          haveit=yes
          haveit=yes
          break
          break
        fi
        fi
      done
      done
      if test -z "$haveit"; then
      if test -z "$haveit"; then
        if test "X$additional_libdir" = "X/usr/local/lib"; then
        if test "X$additional_libdir" = "X/usr/local/lib"; then
          if test -n "$GCC"; then
          if test -n "$GCC"; then
            case $host_os in
            case $host_os in
              linux*) haveit=yes;;
              linux*) haveit=yes;;
            esac
            esac
          fi
          fi
        fi
        fi
        if test -z "$haveit"; then
        if test -z "$haveit"; then
          if test -d "$additional_libdir"; then
          if test -d "$additional_libdir"; then
            dnl Really add $additional_libdir to $LDFLAGS.
            dnl Really add $additional_libdir to $LDFLAGS.
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
          fi
          fi
        fi
        fi
      fi
      fi
    fi
    fi
  fi
  fi
])
])
 
 
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
dnl acl_final_exec_prefix, containing the values to which $prefix and
dnl acl_final_exec_prefix, containing the values to which $prefix and
dnl $exec_prefix will expand at the end of the configure script.
dnl $exec_prefix will expand at the end of the configure script.
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
[
[
  dnl Unfortunately, prefix and exec_prefix get only finally determined
  dnl Unfortunately, prefix and exec_prefix get only finally determined
  dnl at the end of configure.
  dnl at the end of configure.
  if test "X$prefix" = "XNONE"; then
  if test "X$prefix" = "XNONE"; then
    acl_final_prefix="$ac_default_prefix"
    acl_final_prefix="$ac_default_prefix"
  else
  else
    acl_final_prefix="$prefix"
    acl_final_prefix="$prefix"
  fi
  fi
  if test "X$exec_prefix" = "XNONE"; then
  if test "X$exec_prefix" = "XNONE"; then
    acl_final_exec_prefix='${prefix}'
    acl_final_exec_prefix='${prefix}'
  else
  else
    acl_final_exec_prefix="$exec_prefix"
    acl_final_exec_prefix="$exec_prefix"
  fi
  fi
  acl_save_prefix="$prefix"
  acl_save_prefix="$prefix"
  prefix="$acl_final_prefix"
  prefix="$acl_final_prefix"
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
  prefix="$acl_save_prefix"
  prefix="$acl_save_prefix"
])
])
 
 
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
dnl variables prefix and exec_prefix bound to the values they will have
dnl variables prefix and exec_prefix bound to the values they will have
dnl at the end of the configure script.
dnl at the end of the configure script.
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
[
[
  acl_save_prefix="$prefix"
  acl_save_prefix="$prefix"
  prefix="$acl_final_prefix"
  prefix="$acl_final_prefix"
  acl_save_exec_prefix="$exec_prefix"
  acl_save_exec_prefix="$exec_prefix"
  exec_prefix="$acl_final_exec_prefix"
  exec_prefix="$acl_final_exec_prefix"
  $1
  $1
  exec_prefix="$acl_save_exec_prefix"
  exec_prefix="$acl_save_exec_prefix"
  prefix="$acl_save_prefix"
  prefix="$acl_save_prefix"
])
])
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.