[go: up one dir, main page]

File: fullpath.m4

package info (click to toggle)
a2ps 1%3A4.14-1.3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 13,324 kB
  • sloc: ansic: 26,966; sh: 11,844; lex: 2,286; perl: 1,156; yacc: 757; makefile: 609; lisp: 398; ada: 263; objc: 189; f90: 109; ml: 85; sql: 74; pascal: 57; modula3: 33; haskell: 32; sed: 30; java: 29; python: 24
file content (56 lines) | stat: -rw-r--r-- 1,665 bytes parent folder | download | duplicates (10)
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
52
53
54
55
56
# -*- Autoconf -*-

# Check for the existence of a program, resolving it either to the
# full name or short name.

# This is ugly work, don't use it.

# serial 2


AC_DEFUN([ad_ENABLE_PATHS],
[AC_MSG_CHECKING(whether paths should be hardcoded)
AC_ARG_ENABLE(paths,
              [  --enable-paths          hard code the path of the tools])
test "$enable_paths" = "yes" || enable_paths=no
AC_MSG_RESULT($enable_paths)])

# ad_CHECK_PROG(PROGRAM[, COMMENT ON FAILURE])
# --------------------------------------------
# defines $COM_PROGRAM to `#' if PROGRAM is not available, to `' otherwise
# and defines $PROGRAM to PROGRAM if paths should not be hardcoded,
# and to the path to PROGRAM otherwise.
AC_DEFUN([ad_CHECK_PROG],
[if test "$enable_paths" = "no"; then
  AC_CHECK_PROG(COM_$1, $1, yes, no)
  $1="$1";
  if test "[$]COM_$1" = "yes"; then
    COM_$1="";
  else
    COM_$1="#";
  fi
else
  AC_PATH_PROG($1, $1, [#])
  if test "$1" = "#"; then #  not found
    $1="$1" # let the name of the program as path
    COM_$1="#"
  else
    COM_$1=""
  fi
fi
m4_ifval([$2],
[if test "[$]COM_$1" = "#"; then
  AC_MSG_WARN([============================================================
$2])
  AC_MSG_WARN([============================================================])
fi])
AC_SUBST($1)
AC_SUBST(COM_$1)])

# ad_CHECK_PROG(PROGRAM[, COMMENT ON FAILURE])
# --------------------------------------------
# defines $COM_PROGRAM to `#' if PROGRAM is not available, to `' otherwise
# and defines $PROGRAM to PROGRAM if paths should not be hardcoded,
# and to the path to PROGRAM otherwise.
AC_DEFUN([ad_CHECK_PROGS],
[m4_foreach([AC_PROG], [$1], [ad_CHECK_PROG(AC_PROG, $2)])])