sync with experimental
[luatex.git] / source / configure.ac
blob3144b054e3d547801db842361675d17f8a44340e
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 dnl   Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org>
4 dnl
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.
8 dnl
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])
12 AC_PREREQ([2.65])
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
19   rm -rf config.log
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 ## ------------------------------------------- ##
30 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.
34 dnl
35 dnl 2. For each program Prog in the list of
36 dnl      utility programs:
37 dnl        sinclude utils/Prog/ac/withenable.ac
38 dnl      TeXk programs:
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)
44 dnl
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 
55 dnl
56 KPSE_SETUP([])
58 dnl Common code for all programs using libkpathsea.
59 KPSE_COMMON([TeX Live top-level], [tar-pax dist-xz no-dist-gzip])
60 KPSE_CANONICAL_HOST
62 AC_PROG_MKDIR_P
64 AC_PATH_XTRA
66 AC_PROG_CXX
68 AC_PROG_LN_S
69 AC_ARG_WITH([ln-s],
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'"  
80   fi
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'"  
84   fi
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'"  
88   fi
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"
97   else
98     list=$with_kpathsea_includes
99   fi
100   found=no
101   for ac_dir in $list; do
102     if test -r "$ac_dir/kpathsea/paths.h"; then
103       found=yes
104       break
105     fi
106   done
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 *****])
111   fi
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.
119 KPSE_SAVE_FLAGS
120 syslib_status=yes
121 syslib_used=no
122 KPSE_ALL_SYSTEM_FLAGS
123 KPSE_LT_HACK
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])
132 KPSE_RESTORE_FLAGS
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.
141 rm -f Makefile
142 kpse_GNU_make=`${MAKE-make} -v 2>/dev/null | grep GNU`
144 AC_OUTPUT
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])
150   else
151     AC_MSG_ERROR([Building TeX Live requires GNU make])
152   fi
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"])
158 kpse_bld=`pwd`
159 kpse_src=`cd "$srcdir" && pwd`
160 msg_compiling="$msg_compiling
161       in $kpse_bld"
162 test "x$srcdir" = x. || msg_compiling="$msg_compiling
163       from sources in $kpse_src"
164 AC_MSG_RESULT([
165 ** Configuration summary for $PACKAGE_STRING (tex_live_version$with_banner_add):
167    $msg_compiling])
168 case $kpse_src$kpse_bld in
169   *' '*) AC_MSG_ERROR([Absolute source and/or build path with embedded spaces]);;
170 esac
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)"
178 AC_MSG_RESULT([
179    C compiler (CC):              $CC$cc_version
180    C++ compiler (CXX):           $CXX$cxx_version
181    PATH:                         $PATH
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
191    prefix:                       $prefix
192    includedir:                   $includedir
193    datarootdir:                  $datarootdir
194    mandir:                       $mandir
195    infodir:                      $infodir
196    exec_prefix:                  $exec_prefix
197    bindir:                       $bindir
198    libdir:                       $libdir
200 ** Next run `make' to configure and build each library and program.