2 dnl Originally written by Karl Berry
4 dnl Common Autoconf sinclude file for kpathsea-using programs. (Have to
5 dnl use the m4 `sinclude' builtin instead of `include', since Autoconf
6 dnl disables `include'.)
8 dnl These configure scripts won't work with anything else.
11 dnl Write output here, instead of putting a zillion -D's on the command line.
12 AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
19 sinclude(../libtool.m4)
26 AC_CHECK_HEADERS(assert.h float.h limits.h memory.h pwd.h stdlib.h \
27 string.h strings.h sys/param.h unistd.h)
29 dnl Libtool supporting objects that may be required on ancient broken system.
30 AC_CHECK_FUNCS(putenv,, LTLIBOBJS="$LTLIBOBJS putenv.lo")
31 AC_CHECK_FUNCS(strcasecmp,, LTLIBOBJS="$LTLIBOBJS strcasecmp.lo")
32 AC_CHECK_FUNCS(strtol,, LTLIBOBJS="$LTLIBOBJS strtol.lo")
33 AC_CHECK_FUNCS(strstr,, LTLIBOBJS="$LTLIBOBJS strstr.lo")
36 AC_CHECK_FUNCS(bcmp bcopy bzero getcwd getwd index memcmp memcpy rindex strchr strrchr)
40 # Check whether struct stat provides high-res time.
43 # Check whether prototypes work.
44 AC_MSG_CHECKING(whether the compiler accepts prototypes)
45 AC_CACHE_VAL(kb_cv_c_prototypes,
46 [AC_TRY_COMPILE([#include <stdarg.h>], [extern void foo(int i,...);],
47 kb_cv_c_prototypes=yes, kb_cv_c_prototypes=no)])dnl
48 AC_MSG_RESULT($kb_cv_c_prototypes)
49 if test "$kb_cv_c_prototypes" = yes; then
50 AC_DEFINE(HAVE_PROTOTYPES)
53 # This is a GNU libc invention.
54 AC_MSG_CHECKING(whether program_invocation_name is predefined)
55 AC_CACHE_VAL(kb_cv_var_program_inv_name,
57 [extern char *program_invocation_name; program_invocation_name = "love";],
58 kb_cv_var_program_inv_name=yes, kb_cv_var_program_inv_name=no)])dnl
59 AC_MSG_RESULT($kb_cv_var_program_inv_name)
60 if test "$kb_cv_var_program_inv_name" = yes; then
61 AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME)
64 if test $ac_cv_func_getcwd = yes; then
65 # We only need to run this if we have getcwd.
66 AC_MSG_CHECKING(whether getcwd uses fork or vfork)
67 AC_CACHE_VAL(kb_cv_func_getcwd_forks,
69 int fork() { exit(1); }
70 int vfork() { exit(1); }
71 extern char *getcwd();
76 }], kb_cv_func_getcwd_forks=no, kb_cv_func_getcwd_forks=yes,
77 kb_cv_func_getcwd_forks=no)])dnl
78 AC_MSG_RESULT($kb_cv_func_getcwd_forks)
79 if test $kb_cv_func_getcwd_forks = yes; then
80 AC_DEFINE(GETCWD_FORKS)
84 # Common --with and --enable options.
85 sinclude(../../texk/kpathsea/withenable.ac)
87 # Implementation of those options.
88 if test "x$with_mktexmf_default" = xyes; then
89 AC_DEFINE(MAKE_TEX_MF_BY_DEFAULT)
91 if test "x$with_mktexpk_default" = xyes; then
92 AC_DEFINE(MAKE_TEX_PK_BY_DEFAULT)
94 if test "x$with_mktextex_default" = xyes; then
95 AC_DEFINE(MAKE_TEX_TEX_BY_DEFAULT)
97 if test "x$with_mktexfmt_default" = xyes; then
98 AC_DEFINE(MAKE_TEX_FMT_BY_DEFAULT)
100 if test "x$with_mktextfm_default" = xyes; then
101 AC_DEFINE(MAKE_TEX_TFM_BY_DEFAULT)
103 if test "x$with_mkocp_default" = xyes; then
104 AC_DEFINE(MAKE_OMEGA_OCP_BY_DEFAULT)
106 if test "x$with_mkofm_default" = xyes; then
107 AC_DEFINE(MAKE_OMEGA_OFM_BY_DEFAULT)
110 # Is libm present. FIXME: do we need it at all?
111 AC_CHECK_LIB(m, main)
113 # If you're cross-compiling, these macros set up the variables in
114 # ../make/cross.mk: BUILDCC, BUILDCFLAGS, BUILDCCLD etc.
115 KPSE_CROSS_BUILD_VAR(CC, cc)
116 KPSE_CROSS_BUILD_VAR(CFLAGS, $(BUILDXCFLAGS))
117 KPSE_CROSS_BUILD_VAR(CPPFLAGS, $(BUILDXCPPFLAGS))
118 KPSE_CROSS_BUILD_VAR(LDFLAGS, $(BUILDXLDFLAGS))
119 KPSE_CROSS_BUILD_VAR(CCLD, $(BUILDCC))