| 1 |
dnl This file is part of the CJK package ver. 4.8.5 |
| 2 |
|
| 3 |
dnl Copyright (C) 1994-2021 Werner Lemberg <[email protected]> |
| 4 |
|
| 5 |
dnl This program is free software; you can redistribute it and/or modify |
| 6 |
dnl it under the terms of the GNU General Public License as published by |
| 7 |
dnl the Free Software Foundation; either version 2 of the License, or |
| 8 |
dnl (at your option) any later version. |
| 9 |
|
| 10 |
dnl This program is distributed in the hope that it will be useful, |
| 11 |
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
dnl GNU General Public License for more details. |
| 14 |
|
| 15 |
dnl You should have received a copy of the GNU General Public License |
| 16 |
dnl along with this program in doc/COPYING; if not, write to the Free |
| 17 |
dnl Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
| 18 |
dnl MA 02110-1301 USA |
| 19 |
|
| 20 |
dnl Process this file with autoconf to produce a configure script. |
| 21 |
AC_INIT |
| 22 |
AC_CONFIG_SRCDIR([hbf.h]) |
| 23 |
|
| 24 |
|
| 25 |
dnl check host |
| 26 |
AC_CANONICAL_TARGET([]) |
| 27 |
|
| 28 |
|
| 29 |
dnl Checks for programs. |
| 30 |
AC_PROG_CC |
| 31 |
|
| 32 |
|
| 33 |
AC_ARG_WITH(kpathsea-include, |
| 34 |
[ --with-kpathsea-include=DIR |
| 35 |
location of the kpathsea include dir],[ |
| 36 |
if test x$withval = xyes; then |
| 37 |
AC_MSG_WARN(Usage is: --with-kpathsea-include=includedir) |
| 38 |
else |
| 39 |
if test x$withval = xno; then |
| 40 |
AC_MSG_WARN(Usage is: --with-kpathsea-include=includedir) |
| 41 |
else |
| 42 |
kpathsea_include=$withval |
| 43 |
fi |
| 44 |
fi |
| 45 |
]) |
| 46 |
|
| 47 |
|
| 48 |
dnl Checks for libraries. |
| 49 |
AC_ARG_WITH(kpathsea-lib, |
| 50 |
[ --with-kpathsea-lib=DIR |
| 51 |
location of the kpathsea lib dir],[ |
| 52 |
if test x$withval = xyes; then |
| 53 |
AC_MSG_WARN(Usage is: --with-kpathsea-lib=libdir) |
| 54 |
else |
| 55 |
if test x$withval = xno; then |
| 56 |
AC_MSG_WARN(Usage is: --with-kpathsea-lib=libdir) |
| 57 |
else |
| 58 |
kpathsea_lib=$withval |
| 59 |
fi |
| 60 |
fi |
| 61 |
]) |
| 62 |
|
| 63 |
|
| 64 |
if test -n "$kpathsea_include" -o -n "$kpathsea_lib"; then |
| 65 |
LIBS="$LIBS -L$kpathsea_lib" |
| 66 |
CPPFLAGS="$CPPFLAGS -I$kpathsea_include -I$srcdir" |
| 67 |
|
| 68 |
dnl the function kpse_set_program_name() is available since kpathsea 3.2 |
| 69 |
AC_CHECK_LIB(kpathsea, kpse_set_program_name, , AC_DEFINE(OLD_KPATHSEA)) |
| 70 |
|
| 71 |
AC_CHECK_LIB(kpathsea, kpse_init_prog, ,[ |
| 72 |
AC_MSG_ERROR([Can't find kpathsea library! Use --with-kpathsea-lib option.])]) |
| 73 |
|
| 74 |
dnl the header file kpathsea.h doesn't exist in kpathsea 2.6 and before |
| 75 |
AC_CHECK_HEADER(kpathsea/kpathsea.h, , AC_DEFINE(VERY_OLD_KPATHSEA)) |
| 76 |
|
| 77 |
AC_CHECK_HEADER(kpathsea/c-auto.h, ,[ |
| 78 |
AC_MSG_ERROR([Can't find kpathsea include files! Use --with-kpathsea-include option.])]) |
| 79 |
else |
| 80 |
CPPFLAGS="$CPPFLAGS -I$srcdir" |
| 81 |
fi |
| 82 |
|
| 83 |
|
| 84 |
dnl Get compiler flags right. |
| 85 |
if test "x$CC" = xgcc; then |
| 86 |
XX_CFLAGS="-Wall" |
| 87 |
else |
| 88 |
case "$host" in |
| 89 |
alpha-dec-osf*) |
| 90 |
XX_CFLAGS="-std1 -O2 -g3" |
| 91 |
;; |
| 92 |
*) |
| 93 |
XX_CFLAGS= |
| 94 |
;; |
| 95 |
esac |
| 96 |
fi |
| 97 |
AC_SUBST(XX_CFLAGS) |
| 98 |
|
| 99 |
|
| 100 |
dnl Checks for typedefs, structures, and compiler characteristics. |
| 101 |
AC_C_CONST |
| 102 |
AC_STRUCT_TM |
| 103 |
|
| 104 |
|
| 105 |
dnl Checks for library functions. |
| 106 |
AC_FUNC_VPRINTF |
| 107 |
AC_CHECK_FUNCS(strdup strstr strtol strtoul) |
| 108 |
|
| 109 |
dnl we need this for hbf.c |
| 110 |
if test "x$ac_cv_func_strdup" = xno; then |
| 111 |
no_strdup=-DNO_STRDUP |
| 112 |
fi |
| 113 |
AC_SUBST(no_strdup) |
| 114 |
|
| 115 |
AC_CHECK_PROG(RM, rm, rm) |
| 116 |
AC_PROG_INSTALL |
| 117 |
|
| 118 |
if test -z "$kpathsea_include" -a -z "$kpathsea_lib"; then |
| 119 |
AC_MSG_WARN([ |
| 120 |
|
| 121 |
hbf2gf will be compiled without file search library support! |
| 122 |
For kpathsea support use the --with-kpathsea-lib and |
| 123 |
--with-kpathsea-include options. |
| 124 |
]) |
| 125 |
fi |
| 126 |
|
| 127 |
AC_CONFIG_FILES([Makefile]) |
| 128 |
AC_OUTPUT |