1
1
# Public macros for the TeX Live (TL) tree.
2
2
# Copyright (C) 1995 - 2009 Karl Berry <tex-live@tug.org>
3
# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
3
# Copyright (C) 2009, 2010 Peter Breitenlohner <tex-live@tug.org>
5
5
# This file is free software; the copyright holders
6
6
# give unlimited permission to copy and/or distribute it,
55
55
# [REBUILD-SRC-DEPENDENCIES],
56
56
# [REBUILD-BLD-DEPENDENCIES])
57
57
# -----------------------------------------------
58
# For generic libraries in libs/LIBDIR.
58
59
# Provide the configure options '--with-system-LIBDIR' (if in the TL tree),
59
60
# '--with-LIBDIR-includes', and '--with-LIBDIR-libdir'.
89
90
m4_provide_if([AM_INIT_AUTOMAKE], [_AM_SUBST_NOTMAKE(AS_TR_CPP($1)[_RULE])])[]dnl
90
91
]) # _KPSE_LIB_FLAGS
93
# _KPSE_TEXLIB_FLAGS(LIBDIR, LIBNAME, OPTIONS,
94
# TL-INCLUDES, TL-LIBS, TL-EXTRA,
95
# [REBUILD-SRC-DEPENDENCIES],
96
# [REBUILD-BLD-DEPENDENCIES])
97
# -----------------------------------------------
98
# As above, but for TeX specific libraries in texk/LIBDIR.
99
AC_DEFUN([_KPSE_TEXLIB_FLAGS],
100
[m4_pushdef([Kpse_TeX_Lib], [])_KPSE_LIB_FLAGS($@)m4_popdef([Kpse_TeX_Lib])])
92
102
# _KPSE_LIB_FLAGS_TL(LIBDIR, LIBNAME, OPTIONS,
93
103
# TL-INCLUDES, TL-LIBS, TL-EXTRA,
94
104
# [REBUILD-SRC-DEPENDENCIES],
110
120
AS_TR_CPP($1)[_LIBS=`echo '$5' | sed \
111
121
-e "s,BLD/,$kpse_BLD/,g"`
113
m4_if([$1], [kpathsea],
123
m4_ifdef([Kpse_TeX_Lib],
114
124
[AS_TR_CPP($1)[_DEPEND=`echo '$5' | sed \
115
125
-e 's,BLD/texk/,${top_builddir}/../,g'`]
116
126
AS_TR_CPP($1)[_RULE='# Rebuild lib$2
117
127
$(]AS_TR_CPP($1)[_DEPEND):]m4_ifval([$7],
118
128
[[ $7]])m4_ifval([$8], [[ $8
119
cd ${top_builddir}/../$1 && $(MAKE) $(AM_MAKEFLAGS)
129
cd ${top_builddir}/../$1 && $(MAKE) $(AM_MAKEFLAGS) rebuild
121
cd ${top_builddir}/../$1 && $(MAKE) $(AM_MAKEFLAGS)']],
131
cd ${top_builddir}/../$1 && $(MAKE) $(AM_MAKEFLAGS) rebuild']],
122
132
[AS_TR_CPP($1)[_DEPEND=`echo '$5' | sed \
123
133
-e 's,BLD/,${top_builddir}/../../,g'`]
124
134
AS_TR_CPP($1)[_RULE='# Rebuild lib$2
125
135
$(]AS_TR_CPP($1)[_DEPEND):]m4_ifval([$7],
126
136
[[ $7]])m4_ifval([$8], [[ $8
127
cd ${top_builddir}/../../libs/$1 && $(MAKE) $(AM_MAKEFLAGS)
137
cd ${top_builddir}/../../libs/$1 && $(MAKE) $(AM_MAKEFLAGS) rebuild
129
cd ${top_builddir}/../../libs/$1 && $(MAKE) $(AM_MAKEFLAGS)']])
139
cd ${top_builddir}/../../libs/$1 && $(MAKE) $(AM_MAKEFLAGS) rebuild']])
130
140
m4_if(m4_index([ $3 ], [ tree ]), [-1],
194
204
# Add flags for LIBDIR to values of CPPFLAGS and LIBS.
195
205
AC_DEFUN([KPSE_ADD_FLAGS],
196
206
[AC_REQUIRE([KPSE_SAVE_FLAGS])[]dnl
197
CPPFLAGS="$CPPFLAGS $[]AS_TR_CPP($1)_INCLUDES"
198
LIBS="$[]AS_TR_CPP($1)_LIBS $LIBS"
207
eval CPPFLAGS=\"$[]AS_TR_CPP($1)_INCLUDES \$CPPFLAGS\"
208
eval LIBS=\"$[]AS_TR_CPP($1)_LIBS \$LIBS\"
199
209
]) # KPSE_ADD_FLAGS
201
211
# KPSE_COMMON(PACKAGE-NAME, [MORE-AUTOMAKE-OPTIONS])
203
213
# Common Autoconf code for all programs using libkpathsea.
204
214
# Originally written by Karl Berry as texk/kpathsea/common.ac.
206
# Initializtion of Automake and Libtool, some common tests.
216
# Initialization of Automake and Libtool, some common tests.
207
217
AC_DEFUN([KPSE_COMMON],
208
218
[dnl Remember PACKAGE-NAME as Kpse_Package (for future messages)
209
219
m4_define([Kpse_Package], [$1])
211
AM_INIT_AUTOMAKE([foreign dist-bzip2]m4_ifval([$2], [ $2]))
221
AM_INIT_AUTOMAKE([foreign]m4_ifval([$2], [ $2]))
212
222
AM_MAINTAINER_MODE
214
224
LT_PREREQ([2.2.6])
227
237
AC_CHECK_FUNCS([putenv strcasecmp strtol strstr])
229
239
dnl More common functions
230
AC_CHECK_FUNCS([bcmp bcopy bzero getcwd getwd index memcmp memcpy mktemp mkstemp rindex strchr strrchr])
240
AC_CHECK_FUNCS([bcmp bcopy bzero getcwd getwd index memcmp memcpy mkstemp mktemp rindex strchr strrchr])
235
246
dnl Check whether struct stat provides high-res time.
236
247
AC_CHECK_MEMBERS([struct stat.st_mtim])
254
265
program_invocation_name = "love";]])],
255
266
[kb_cv_var_program_inv_name=yes],
256
267
[kb_cv_var_program_inv_name=no])])
257
if test "$kb_cv_var_program_inv_name" = yes; then
268
if test "x$kb_cv_var_program_inv_name" = xyes; then
258
269
AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], 1,
259
270
[Define to 1 if you are using GNU libc or otherwise have global variables
260
271
`program_invocation_name' and `program_invocation_short_name'.])
264
275
KPSE_COMPILER_WARNINGS
267
# KPSE_MSG_ERROR(PACKAGE, ERROR, [EXIT-STATUS = 1])
268
# -------------------------------------------------
269
# Same as AC_MSG_ERROR(ERROR, EXIT-STATUS), except when building this
270
# package PACKAGE has been disabled.
272
# The new (2009) TL build system requires all directories to be configured
273
# for the benefit of 'dist*' Make targets. When building PACKAGE has been
274
# disabled, configuring that package must not fail because building required
275
# libraries from the TL tree has been disabled as a consequence.
276
AC_DEFUN([KPSE_MSG_ERROR],
277
[AS_IF([test "x$enable_build" = xno],
278
[AC_MSG_WARN([building $1 has been disabled and would fail because
280
[AC_MSG_ERROR([$2], m4_default([$3], 1))])
283
278
# KPSE_MSG_WARN(PROBLEM)
284
279
# ----------------------
285
280
# Same as AC_MSG_WARN, but terminate if `--disable-missing' was given.
308
303
AC_CHECK_TOOL([PKG_CONFIG], [pkg-config], [false])[]dnl
309
304
]) # _KPSE_CHECK_PKG_CONFIG
306
# KPSE_CANONICAL_HOST
307
# -------------------
308
# Require both --host and --build for cross compilations; set kpse_build_alias.
309
AC_DEFUN([KPSE_CANONICAL_HOST],
310
[AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
311
AS_IF([test "x$host_alias" != x && test "x$build_alias" = x],
312
[AC_MSG_ERROR([when cross-compiling you must specify both --host and --build.])])
313
eval kpse_build_alias=\${build_alias-$build}
314
]) # KPSE_CANONICAL_HOST