1 dnl Process this file with autoconf to produce a configure script.
3 dnl Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org>
5 dnl This file is free software; the copyright holder
6 dnl gives unlimited permission to copy and/or distribute it,
7 dnl with or without modifications, as long as this notice is preserved.
9 m4_include([tardate.ac])[] dnl define tex_live_tardate
10 m4_include([version.ac])[] dnl define tex_live_version
11 AC_INIT([TeX Live], tex_live_tardate, [tex-k@tug.org])
13 AC_CONFIG_SRCDIR([m4/kpse-pkgs.m4])
14 AC_CONFIG_AUX_DIR([build-aux])
15 AC_CONFIG_MACRO_DIRS([m4])
17 dnl Prevent to configure the source tree by mistake.
18 if test "x$srcdir" = x. && test "x$enable_build_in_source_tree" != xyes; then
20 AC_MSG_ERROR([Configuring and building TeX Live in the source tree
21 is strongly discouraged. If you really want to do that, you must
22 specify the configure option `--enable-build-in-source-tree', but
23 then do not ask for help -- you have been warned.])
26 dnl ## ------------------------------------------- ##
27 dnl ## Setup of the TeX Live (TL) infrastructure ##
28 dnl ## done in ./, libs/, utils/, and texk/ ##
29 dnl ## ------------------------------------------- ##
31 dnl 1. Define four lists of TeXk programs, utility programs,
32 dnl and (generic or TeX specific) libraries in the TL tree.
33 dnl These list are defined in m4/kpse-pkgs.m4.
35 dnl 2. For each program Prog in the list of
37 dnl sinclude utils/Prog/ac/withenable.ac
39 dnl sinclude texk/Prog/ac/withenable.ac
40 dnl These fragments usually provide the configure options
41 dnl --disable-Prog or --enable-Prog
42 dnl If Prog is to be built, then set need_SubLib=yes
43 dnl for each TL library SubLib required by Prog (if any)
45 dnl 3. For each library Lib in the list of
46 dnl generic TL libraries:
47 dnl sinclude libs/Lib/ac/withenable.ac
48 dnl TeX specific TL libraries:
49 dnl sinclude texk/Lib/ac/withenable.ac
50 dnl These fragments usually provide the configure options
51 dnl --with-system-Lib, --with-Lib-includes=DIR, and --with-Lib-libdir=DIR
52 dnl For each TL library SubLib required by Lib (if any):
53 dnl disallow with_system_Lib=yes and with_system_SubLib=no
54 dnl if $need_Lib=yes then set need_SubLib=yes
58 dnl Common code for all programs using libkpathsea.
59 KPSE_COMMON([TeX Live top-level], [tar-pax dist-xz no-dist-gzip])
70 AS_HELP_STRING([--without-ln-s],
71 [do build even if `ln -s' does not work]))[]dnl
72 if test "x$LN_S" != "xln -s" && test "x$kpse_cv_have_win32" = xno && test "x$with_ln_s" != xno; then
73 AC_MSG_ERROR([You could use `--without-ln-s' to build without working `ln -s'])
76 if test "x$enable_native_texlive_build" = xyes; then
77 if test "x$datarootdir" = 'x${prefix}/share'; then
78 datarootdir='${prefix}'
79 ac_configure_args="$ac_configure_args '--datarootdir=$datarootdir'"
81 if test "x$mandir" = 'x${datarootdir}/man'; then
82 mandir='${prefix}/texmf-dist/doc/man'
83 ac_configure_args="$ac_configure_args '--mandir=$mandir'"
85 if test "x$infodir" = 'x${datarootdir}/info'; then
86 infodir='${prefix}/texmf-dist/doc/info'
87 ac_configure_args="$ac_configure_args '--infodir=$infodir'"
91 dnl Although quite unusual, it is possible to build Web2C (TeX & Co)
92 dnl using installed (system) kpathsea headers and library.
93 dnl In that case we need the location of <kpathsea/paths.h>.
94 if test "x$enable_web2c" = xyes && test "x$with_system_kpathsea" = xyes; then
95 if test "x$with_kpathsea_includes" = x; then
96 list="/usr/include /usr/local/include"
98 list=$with_kpathsea_includes
101 for ac_dir in $list; do
102 if test -r "$ac_dir/kpathsea/paths.h"; then
107 if test "x$found" = xno; then
108 AC_MSG_NOTICE([You requested to build `web2c' using an installed `kpathsea' version,])
109 AC_MSG_NOTICE([ which requires to locate the <kpathsea/paths.h> header file.])
110 AC_MSG_ERROR([Sorry, not found under any of: $list *****])
114 KPSE_RECURSE_LIBS([texlibs], [TeX specific], [texk/])
116 dnl We check that all required system libraries are usable, and may
117 dnl reduce frustration if anything is wrong by doing this first.
118 dnl A native TeX Live build must not use any system libraries.
122 KPSE_ALL_SYSTEM_FLAGS
124 KPSE_FOR_PKGS([sys_texk], [m4_sinclude([texk/]Kpse_Pkg[/ac/]Kpse_Pkg[.ac])])[]dnl
125 KPSE_FOR_PKGS([sys_libs], [m4_sinclude([libs/]Kpse_Pkg[/ac/]Kpse_Pkg[.ac])])[]dnl
126 if test "x$syslib_status" = xno; then
127 AC_MSG_ERROR([some requested system libraries failed])
129 if test "x$syslib_used:$enable_native_texlive_build" = xyes:yes; then
130 AC_MSG_ERROR([you can not use system libraries for a native TeX Live build])
134 AM_CONDITIONAL([cross], [test "x$cross_compiling" = xyes])
136 AC_CONFIG_SUBDIRS([auxdir/auxsub libs utils texk])
138 AC_CONFIG_FILES([Makefile doc/Makefile])
140 dnl Try to detect GNU make early, '-v' is verbose for BSD make.
142 kpse_GNU_make=`${MAKE-make} -v 2>/dev/null | grep GNU`
146 dnl Most probably we need GNU make.
147 if test -z "$kpse_GNU_make"; then
148 if test "x$enable_native_texlive_build" = xno; then
149 AC_MSG_WARN([Building TeX Live may require GNU make])
151 AC_MSG_ERROR([Building TeX Live requires GNU make])
155 AS_IF([test "x$cross_compiling" = xyes],
156 [msg_compiling="cross-compiling on $build_alias for $host_alias"],
157 [msg_compiling="compiling for $kpse_build_alias"])
159 kpse_src=`cd "$srcdir" && pwd`
160 msg_compiling="$msg_compiling
162 test "x$srcdir" = x. || msg_compiling="$msg_compiling
163 from sources in $kpse_src"
165 ** Configuration summary for $PACKAGE_STRING (tex_live_version$with_banner_add):
168 case $kpse_src$kpse_bld in
169 *' '*) AC_MSG_ERROR([Absolute source and/or build path with embedded spaces]);;
172 cc_version=`$CC --version 2>/dev/null | sed 1q`
173 test -n "$cc_version" && cc_version=" ($cc_version)"
175 cxx_version=`$CXX --version 2>/dev/null | sed 1q`
176 test -n "$cxx_version" && cxx_version=" ($cxx_version)"
179 C compiler (CC): $CC$cc_version
180 C++ compiler (CXX): $CXX$cxx_version
183 enable_native_texlive_build: $enable_native_texlive_build
184 enable_largefile: $enable_largefile
185 enable_shared: $enable_shared
186 enable_multiplatform: $enable_multiplatform
187 enable_cxx_runtime_hack: $enable_cxx_runtime_hack
188 enable_libtool_hack: $enable_libtool_hack
189 enable_compiler_warnings: $enable_compiler_warnings
192 includedir: $includedir
193 datarootdir: $datarootdir
196 exec_prefix: $exec_prefix
200 ** Next run `make' to configure and build each library and program.