summaryrefslogtreecommitdiff
path: root/Build/source/utils/biber/configure.ac
blob: ff83a231db3a9ae23af8a973e0b8249ccfa91930 (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
dnl See ./README for our basic strategy here.
dnl
dnl   Copyright (C) 2011, 2012 Karl Berry <tex-live@tug.org>
dnl
dnl   This file is free software; the copyright holder
dnl   gives unlimited permission to copy and/or distribute it,
dnl   with or without modifications, as long as this notice is preserved.
dnl
AC_INIT([Biber], [TeX Live], [tex-k@tug.org])
AC_PREREQ([2.65])
AC_CONFIG_SRCDIR([TeXLive/TLConfig.pm])
AC_CONFIG_AUX_DIR([../../build-aux])
AC_CONFIG_MACRO_DIR([../../m4])

AM_INIT_AUTOMAKE([foreign])
AM_MAINTAINER_MODE

dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_MAKE_SET

BIBER_BINARY=

dnl Determine the TeX Live platform name.
KPSE_TL_PLATFORM

if test "x$enable_build" != xno || test -f config.force; then

if test -z "$TL_PLATFORM"; then
  AC_MSG_ERROR([****** cannot determine TeX Live platform name for host "$ac_cv_host"
****** configure with either '--disable-biber' or 'TL_PLATFORM=platform_name'])
fi

dnl Check if we have an executable for this platform.
AC_MSG_CHECKING([for a biber binary])
biber_bin="bin/$TL_PLATFORM/biber"
if test -n "$ac_exeext" && test -r "$srcdir/$biber_bin$ac_exeext"; then
  BIBER_BINARY="$biber_bin$ac_exeext"
elif test -r "$srcdir/$biber_bin"; then
  if echo "$TL_PLATFORM" | grep freebsd >/dev/null 2>&1; then

    # on freebsd, we don't want to install the binary if the current
    # version is too old.  The standard way to do this is to look in
    # sys/param.h.  Use standard FreeBSD program locations since that's
    # what they do.
    : ${AWK=/usr/bin/awk}
    : ${SYSCTL=/sbin/sysctl}
    if test -n "$OSVERSION"; then
      if test -r /usr/include/sys/param.h; then
        OSVERSION=`$AWK '/^\#define[[:blank:]]__FreeBSD_version/ {print $3}'\
                   </usr/include/sys/param.h`
      elif test -r /usr/src/sys/sys/param.h; then
        OSVERSION=`$AWK '/^\#define[[:blank:]]__FreeBSD_version/ {print $3}'\
                   </usr/src/sys/sys/param.h`      
      else
        OSVERSION=`${SYSCTL} -n kern.osreldate`
      fi
    fi
    # check if freebsd os version is new enough.
    if test "$OSVERSION" -ge 701000; then
      BIBER_BINARY="$biber_bin"
    fi
  else
    # not freebsd, just take it.
    BIBER_BINARY="$biber_bin"
  fi
fi
AC_MSG_RESULT([$BIBER_BINARY])

echo timestamp >config.force
fi

AC_SUBST([BIBER_BINARY])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT