| 1 |
# Autoconf macros for xdvik. |
| 2 |
# Copyright (C) 2013 Paul Vojta <[email protected]> |
| 3 |
# |
| 4 |
# This file is free software; the copyright holder |
| 5 |
# gives unlimited permission to copy and/or distribute it, |
| 6 |
# with or without modifications, as long as this notice is preserved. |
| 7 |
|
| 8 |
# XDVI_GS_LIB_PATH |
| 9 |
# ---------------- |
| 10 |
# Find the path to use for GS_LIB. |
| 11 |
|
| 12 |
dnl ### Determine the path to use for GS_LIB. |
| 13 |
|
| 14 |
AC_DEFUN([XDVI_GS_LIB_PATH], |
| 15 |
[AC_ARG_WITH(default-gs-lib-path, [ --with-default-gs-lib-path=PATH |
| 16 |
set default path for finding font aliases to PATH], |
| 17 |
[AC_DEFINE_UNQUOTED([DEFAULT_GS_LIB_PATH], "$withval", |
| 18 |
[Define to set the default path for ghostscript-style font searching.]) |
| 19 |
], |
| 20 |
[AC_CACHE_CHECK([for the path to be used for Ghostscript searches], |
| 21 |
xdvi_cv_gs_lib_path, |
| 22 |
[if gs -h >/dev/null 2>&1; then |
| 23 |
ac_tmp="`gs -h \ |
| 24 |
| sed \ |
| 25 |
-e '1,/Search path:/d' \ |
| 26 |
-e '/For more information/,$d' \ |
| 27 |
-e '/Initialization files are compiled/d' \ |
| 28 |
-e 's/$/\/\/\//' \ |
| 29 |
-e 's/^ //' \ |
| 30 |
| tr '\n' '/'`" |
| 31 |
# Solaris 9 sed doesn't handle incomplete lines at eof |
| 32 |
xdvi_cv_gs_lib_path=`echo "$ac_tmp" \ |
| 33 |
| sed -e 's/\/\/\/\// /g' -e 's/ *$//' -e 's/ : /:/g'` |
| 34 |
else |
| 35 |
xdvi_cv_gs_lib_path=/usr/local/share/ghostscript/fonts:/usr/local/lib/ghostscript/fonts:/usr/share/ghostscript/fonts:/var/lib/ghostscript/fonts:/usr/share/cups/fonts:/usr/share/fonts |
| 36 |
AC_MSG_WARN(Could not determine Ghostscript search path; using $xdvi_cv_gs_lib_path) |
| 37 |
fi]) |
| 38 |
AC_DEFINE_UNQUOTED([DEFAULT_GS_LIB_PATH], "$xdvi_cv_gs_lib_path") |
| 39 |
])]) |