Debian Codegraph @

texk/kpathsea/configure.ac

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 dnl $Id: configure.ac 64941 2022-11-05 15:43:53Z karl $
2 dnl Process this file with autoconf to produce a configure script.
3 dnl
4 dnl Copyright 2015-2021 Karl Berry <[email protected]>
5 dnl Copyright 2009-2015 Peter Breitenlohner <[email protected]>
6 dnl
7 dnl This file is free software; the copyright holder
8 dnl gives unlimited permission to copy and/or distribute it,
9 dnl with or without modifications, as long as this notice is preserved.
10 dnl
11 m4_include([version.ac])[] dnl define kpse_version
12 AC_INIT([Kpathsea], kpse_version, [[email protected]])
13 AC_PREREQ([2.65])
14 AC_CONFIG_SRCDIR([pathsearch.c])
15 AC_CONFIG_AUX_DIR([../../build-aux])
16 AC_CONFIG_MACRO_DIR([../../m4])
17
18 AC_SUBST([KPSEVERSION], [kpse_version])
19 KPSE_LT_VERSION([kpse])
20
21 m4_include([../../version.ac])[] dnl define tex_live_version
22 AC_SUBST([WEB2CVERSION], [" (TeX Live tex_live_version)"])
23
24 dnl Common code for all programs using libkpathsea.
25 KPSE_COMMON([kpathsea])
26 dnl Include additional code for kpathsea.
27 KPSE_MKTEX_PREPARE
28 m4_sinclude([ac/mktex.ac])
29
30 dnl Generate MAKE_TEX_*_BY_DEFAULT and MAKE_OMEGA_*_BY_DEFAULT defines.
31 m4_foreach([Kpse_Mktex], [kpse_mktex_opts],
32 [m4_ifset([Kpse_Mktex],
33 [KPSE_MKTEX_DEFINE(Kpse_Mktex)])])[]dnl
34
35 # So we can use reasonable awk in the Makefile.
36 AC_PROG_AWK
37
38 AC_CHECK_SIZEOF([long])
39
40 dnl Replacement functions that may be required on ancient broken system.
41 AC_CHECK_DECLS([putenv])
42 AC_REPLACE_FUNCS([putenv])
43
44 if test "x$ac_cv_func_getcwd" = xyes; then
45 # We only need to run this if we have getcwd.
46 AC_CACHE_CHECK([whether getcwd uses fork or vfork],
47 [kb_cv_func_getcwd_forks],
48 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
49 int fork() { exit(1); }
50 int vfork() { exit(1); }
51 extern char *getcwd();
52 char path[100];]],
53 [[getcwd(path,100);]])],
54 [kb_cv_func_getcwd_forks=no],
55 [kb_cv_func_getcwd_forks=yes],
56 [kb_cv_func_getcwd_forks=no])])
57 if test "x$kb_cv_func_getcwd_forks" = xyes; then
58 AC_DEFINE([GETCWD_FORKS], 1,
59 [Define to 1 if getcwd is implemented using fork or vfork.
60 Let me know if you have to add this by hand because configure
61 failed to detect it.])
62 fi
63 fi
64
65 KPSE_COND_MINGW32
66
67 AC_SUBST([LT_OBJDIR], ["$lt_cv_objdir"])
68
69 # Checking snprintf and vsnprintf
70 AC_ARG_WITH([snprintf-wrapper],
71 AS_HELP_STRING([--with-snprintf-wrapper],
72 [use (v)snprintf wrapper functions @<:@automatic
73 for native compilation or Windows@:>@]),
74 [kpse_cv_wrap_snprintf=$withval],
75 [test "x$kpse_cv_have_win32" != xno && kpse_cv_wrap_snprintf=yes])[]dnl
76 if test "x$kpse_cv_have_win32" = xno; then
77 snfunc=snprintf vsnfunc=vsnprintf
78 else
79 snfunc=_snprintf vsnfunc=_vsnprintf
80 fi
81 AC_CACHE_CHECK([for $snfunc and $vsnfunc],
82 [kpse_cv_have_snfuncs],
83 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
84 #include <stdio.h>
85 char buf[16];
86 va_list ap;]],
87 [[$snfunc (buf, 16, "%s", "abc");
88 $vsnfunc (buf, 16, "%s", ap);]])],
89 [kpse_cv_have_snfuncs=yes],
90 [kpse_cv_have_snfuncs=no])])
91 if test "x$kpse_cv_have_snfuncs" != xyes; then
92 AC_MSG_ERROR([Sorry, you need $snfunc and $vsnfunc.])
93 fi
94 AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
95 #include <stdio.h>
96 char buf[4] = "abc";]],
97 [[if ($snfunc (buf, 1, "%s", "x") == 0 || buf[1] != 'b')
98 return 1;]])],
99 [],
100 [AC_MSG_ERROR([Sorry, your $snfunc is badly broken.])],
101 [:])
102 AC_CACHE_CHECK([if we need (v)snprintf wrapper functions],
103 [kpse_cv_wrap_snprintf],
104 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
105 #include <stdio.h>
106 char buf[4] = "abc";]],
107 [[$snfunc (buf, 3, "xyz");
108 if (buf[2] != 0) return 1;
109 $snfunc (buf, 2, "xyz");
110 if (buf[1] != 0) return 1;]])],
111 [kpse_cv_wrap_snprintf=no],
112 [kpse_cv_wrap_snprintf=yes],
113 [kpse_cv_wrap_snprintf=no])])
114 if test "x$kpse_cv_wrap_snprintf" = xyes; then
115 AC_DEFINE([WRAP_SNPRINTF], 1,
116 [Define to 1 if we need (v)snprintf wrapper functions.])
117 fi
118
119 AM_CONDITIONAL([have_EXEEXT], [test -n "$EXEEXT"])
120
121 dnl Write output here, instead of putting a zillion -D's on the command line.
122 AC_CONFIG_HEADERS([c-auto.h:c-auto.in],
123 [sed -e 's/^#define PACKAGE/#define KPSE_PACKAGE/' \
124 -e 's/^#define VERSION/#define KPSE_VERSION/' c-auto.h >c-auto.tmp && mv -f c-auto.tmp c-auto.h])
125
126 AH_TOP([/* c-auto.h: defines for kpathsea, as determined by configure.
127
128 Copyright 1994-97, 2008-2015 Karl Berry.
129 Copyright 1997-99, 2002, 2005 Olaf Weber.
130
131 This library is free software; you can redistribute it and/or
132 modify it under the terms of the GNU Lesser General Public
133 License as published by the Free Software Foundation; either
134 version 2.1 of the License, or (at your option) any later version.
135
136 This library is distributed in the hope that it will be useful,
137 but WITHOUT ANY WARRANTY; without even the implied warranty of
138 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
139 Lesser General Public License for more details.
140
141 You should have received a copy of the GNU Lesser General Public License
142 along with this library; if not, see <http://www.gnu.org/licenses/>. */
143
144 /* Guard against double inclusion. */
145 #ifndef KPATHSEA_C_AUTO_H
146 #define KPATHSEA_C_AUTO_H
147
148 /* kpathsea: the version string. */
149 #define KPSEVERSION "kpathsea version] kpse_version["])
150 AH_BOTTOM([#endif /* !KPATHSEA_C_AUTO_H */])
151
152 AC_CONFIG_FILES([Makefile doc/Makefile man/Makefile win32/Makefile kpathsea.pc])
153
154 AC_OUTPUT