OSDN Git Service

* fr.po: Update.
[pf3gnuchains/gcc-fork.git] / zlib / configure.in
index dc4d5c8..a0bb1e6 100644 (file)
@@ -1,33 +1,19 @@
 dnl Process this with autoconf to create configure
 
+AC_PREREQ(2.13)
 AC_INIT(zlib.h)
-AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE(zlib, 1.1.3)
-
-AM_MAINTAINER_MODE
-AC_EXEEXT
 
-AC_CONFIG_AUX_DIR(..)
-
-dnl We use these options to decide which functions to include.
-AC_ARG_WITH(target-subdir,
-[  --with-target-subdir=SUBDIR      Configuring in a subdirectory])
-AC_ARG_WITH(cross-host,
-[  --with-cross-host=HOST           Configuring with a cross compiler])
-
-dnl Default to --enable-multilib
-AC_ARG_ENABLE(multilib,
-[  --enable-multilib         build many library versions (default)],
-[case "${enableval}" in
-  yes) multilib=yes ;;
-  no)  multilib=no ;;
-  *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
- esac], [multilib=yes])dnl
+# This works around the fact that libtool configuration may change LD
+# for this particular configuration, but some shells, instead of
+# keeping the changes in LD private, export them just because LD is
+# exported.
+ORIGINAL_LD_FOR_MULTILIBS=$LD
 
 dnl We may get other options which we dont document:
 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
 
-if test "[$]{srcdir}" = "."; then
+if test "x[$]{with_target_subdir}" != x && \
+   test "[$]{srcdir}" = "."; then
   if test "[$]{with_target_subdir}" != "."; then
     zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../"
   else
@@ -37,11 +23,57 @@ else
   zlib_basedir="[$]{srcdir}/"
 fi
 AC_SUBST(zlib_basedir)
+AC_CONFIG_AUX_DIR($zlib_basedir..)
+if :; then :; else
+  # This overrides the previous occurrence for automake, but not for
+  # autoconf, which is exactly what we want.
+  AC_CONFIG_AUX_DIR(..)
+fi
+
+AC_CANONICAL_SYSTEM
+
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
+AC_SUBST(mkinstalldirs)
+
+AM_INIT_AUTOMAKE(zlib, 1.1.4)
+
+AM_MAINTAINER_MODE
+
+dnl We use these options to decide which functions to include.
+AC_ARG_WITH(target-subdir,
+[  --with-target-subdir=SUBDIR
+                          configuring in a subdirectory])
+AC_ARG_WITH(cross-host,
+[  --with-cross-host=HOST  configuring with a cross compiler])
+
+dnl Default to --enable-multilib
+AC_ARG_ENABLE(multilib,
+[  --enable-multilib       build many library versions (default)],
+[case "${enableval}" in
+  yes) multilib=yes ;;
+  no)  multilib=no ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
+ esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
 
 AC_ARG_WITH(system-zlib,
-[  --with-system-zlib               Use installed libz])
+[  --with-system-zlib      use installed libz])
 
 LIB_AC_PROG_CC
+# We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
+# at least currently, we never actually build a program, so we never
+# need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
+# fails, because we are probably configuring with a cross compiler
+# which cant create executables.  So we include AC_EXEEXT to keep
+# automake happy, but we dont execute it, since we dont care about
+# the result.
+if false; then
+  # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
+  # to nothing, so nothing would remain between `then' and `fi' if it
+  # were not for the `:' below.
+  :
+  AC_EXEEXT
+fi
 AM_PROG_LIBTOOL
 
 if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
@@ -51,6 +83,9 @@ else
 fi
 AC_SUBST(COMPPATH)
 
+# Find CPP now so that any conditional tests below won't do it and
+# thereby make the resulting definitions conditional.
+AC_PROG_CPP
 
 if test -n "$with_cross_host"; then
    # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
@@ -79,7 +114,27 @@ AC_SUBST(target_all)
 
 AC_CHECK_HEADERS(unistd.h)
 
-AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
+if test -n "$with_cross_host" &&
+   test x"$with_cross_host" != x"no"; then
+  toolexecdir='$(exec_prefix)/$(target_alias)'
+  toolexeclibdir='$(toolexecdir)/lib'
+else
+  toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+  toolexeclibdir='$(libdir)'
+fi
+if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then
+  multiosdir=/`$CC -print-multi-os-directory`
+  case $multiosdir in
+    /.) multiosdir= ;; # Avoid trailing /.
+  esac
+else
+  multiosdir=
+fi
+toolexeclibdir=${toolexeclibdir}${multiosdir}
+AC_SUBST(toolexecdir)
+AC_SUBST(toolexeclibdir)
+
+AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
 
 if test "${multilib}" = "yes"; then
   multilib_arg="--enable-multilib"
@@ -89,6 +144,7 @@ fi
 
 AC_OUTPUT(Makefile,
 [if test -n "$CONFIG_FILES"; then
+  LD="${ORIGINAL_LD_FOR_MULTILIBS}"
   ac_file=Makefile . ${zlib_basedir}/../config-ml.in
 fi],
 srcdir=${srcdir}
@@ -100,4 +156,5 @@ CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
 zlib_basedir=${zlib_basedir}
 CC="${CC}"
 CXX="${CXX}"
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
 )