1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# Private macros for the kpathsea library.
# by Karl Berry <karl@freefriends.org>
# Copyright (C) 199? - 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 1
# KPSE_CROSS_PATH_PROG(RESULT, CROSS_PROG, NORMAL_PROG)
# -----------------------------------------------------
# Find a program when cross-compiling, or use a default when not.
# RESULT = variable which records the outcome
# CROSS_PROG = program to look for when cross-compiling
# NORMAL_PROG = program to use when not cross-compiling
# Example: KPSE_CROSS_PATH_PROG([TANGLE], [tangle], [./tangle]) sets
# 'TANGLE' to the program 'tangle' found in PATH when cross-compiling,
# and to './tangle' if not.
AC_DEFUN([KPSE_CROSS_PATH_PROG],
[if test "$cross_compiling" = yes; then
AC_PATH_PROG([$1], [$2])
if test -z "${$1}"; then
AC_MSG_ERROR([$2 was not found but is required when cross-compiling.
Install $2 or set \$$1 to the full pathname.])
fi
else
$1=$3
fi])
# KPSE_CROSS_BUILD_VAR(STEM, PROG)
# --------------------------------
# Set BUILD$1 to $2 when cross-compiling, to $($1) if not.
# Example: KPSE_CROSS_BUILD_VAR([CC], [cc]) sets 'BUILDCC' to 'cc'
# if cross-compiling, and to '$(CC)' if not.
AC_DEFUN([KPSE_CROSS_BUILD_VAR],
[if test "$cross_compiling" = yes; then
if test -z "${BUILD$1}"; then
BUILD$1='$2'
fi
AC_MSG_RESULT([setting \$BUILD$1 to ${BUILD$1}])
else
if test -n "${BUILD$1}"; then
AC_MSG_WARN([\$BUILD$1 set but not cross-compiling.])
fi
BUILD$1='$($1)'
fi
AC_SUBST(BUILD$1)
])
|