1
##*****************************************************************************
2
## $Id: x_ac_blcr.m4 0001 2009-01-10 16:06:05Z hjcao $
3
##*****************************************************************************
5
# Copied from x_ac_munge.
12
# Check the usual suspects for an BLCR installation,
13
# updating CPPFLAGS and LDFLAGS as necessary.
16
# This macro must be placed after AC_PROG_CC and before AC_PROG_LIBTOOL.
17
##*****************************************************************************
19
AC_DEFUN([X_AC_BLCR], [
21
_x_ac_blcr_dirs="/usr /usr/local /opt/freeware /opt/blcr"
22
_x_ac_blcr_libs="lib64 lib"
26
AS_HELP_STRING(--with-blcr=PATH,Specify path to BLCR installation),
27
[_x_ac_blcr_dirs="$withval $_x_ac_blcr_dirs"])
30
[for blcr installation],
33
for d in $_x_ac_blcr_dirs; do
34
test -d "$d" || continue
35
test -d "$d/include" || continue
36
test -f "$d/include/libcr.h" || continue
37
for bit in $_x_ac_blcr_libs; do
38
test -d "$d/$bit" || continue
40
_x_ac_blcr_libs_save="$LIBS"
41
LIBS="-L$d/$bit -lcr $LIBS"
43
AC_LANG_CALL([], cr_init),
44
AS_VAR_SET(x_ac_cv_blcr_dir, $d))
45
LIBS="$_x_ac_blcr_libs_save"
46
test -n "$x_ac_cv_blcr_dir" && break
48
test -n "$x_ac_cv_blcr_dir" && break
52
if test -z "$x_ac_cv_blcr_dir"; then
53
AC_MSG_WARN([unable to locate blcr installation])
55
BLCR_HOME="$x_ac_cv_blcr_dir"
57
BLCR_CPPFLAGS="-I$x_ac_cv_blcr_dir/include"
58
BLCR_LDFLAGS="-L$x_ac_cv_blcr_dir/$bit"
61
AC_DEFINE_UNQUOTED(BLCR_HOME, "$x_ac_cv_blcr_dir", [Define BLCR installation home])
65
AC_SUBST(BLCR_CPPFLAGS)
66
AC_SUBST(BLCR_LDFLAGS)
68
AM_CONDITIONAL(WITH_BLCR, test -n "$x_ac_cv_blcr_dir")