~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to m4/non-recursive-gnulib-prefix-hack.m4

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Copyright (C) 2012 Free Software Foundation, Inc.
 
2
dnl This file is free software; the Free Software Foundation
 
3
dnl gives unlimited permission to copy and/or distribute it,
 
4
dnl with or without modifications, as long as this notice is preserved.
 
5
 
 
6
dnl gl_NON_RECURSIVE_GNULIB_PREFIX_HACK LIB_DIR
 
7
dnl Adjust configure-set $gl_LIBOBJS and each AC_SUBST'd *_H variable
 
8
dnl with a value ending in ".h" to reflect that these files are located
 
9
dnl in the directory specified by LIB_DIR.
 
10
AC_DEFUN([gl_NON_RECURSIVE_GNULIB_PREFIX_HACK],
 
11
[
 
12
  # Tell AC_LIBSOURCES where to find source files like alloca.c.
 
13
  AC_CONFIG_LIBOBJ_DIR([lib])
 
14
 
 
15
  # This hack originated in bison.  It is required when using non-recursive
 
16
  # automake rules to build from gnulib-provided lib/ sources.  Hence, LIB_DIR
 
17
  # is usually simply "lib".  Those rules use the list of names like "fchdir.o"
 
18
  # and "strstr.o" in gl_LIBOBJS.  With non-recursive make, we must prefix each
 
19
  # such file name with the "lib/" prefix.  See also build-aux/prefix-gnulib-mk.
 
20
  gl_LIBOBJS=`echo "$gl_LIBOBJS" | sed -e 's, , $1/,g'`
 
21
 
 
22
  # Listing the names of the variables to prefix is error-prone.
 
23
  # Rather, adjust each AC_SUBST'd variable whose name ends in '_H'
 
24
  # and whose value ends in '.h'.
 
25
  for ac_var in $ac_subst_vars
 
26
  do
 
27
    eval "ac_val=\$$ac_var"
 
28
    case $ac_var:$ac_val in
 
29
      (*_H:*.h) eval "$ac_var=$1/\$$ac_var";;
 
30
    esac
 
31
  done
 
32
 
 
33
  # If $ALLOCA is not empty, prefix its value with "lib/".
 
34
  test -n "$ALLOCA" && ALLOCA="lib/$ALLOCA"
 
35
])