OSDN Git Service

Generalise 'all' rule to arbitrary prerequisite sub-directories.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / mingw / aclocal.m4
1 # aclocal.m4 for MinGW Runtime package.  -*- Autoconf -*-
2 #
3 # This provides configure definitions used by all the winsup
4 # configure.in files.
5
6 # MINGW_AC_CONFIG_SRCDIR( VERSION_TAG, UNIQUE_FILE )
7 # --------------------------------------------------
8 # Wrapper for AC_CONFIG_SRCDIR; in addition to checking for a
9 # unique file reference within the source tree, it resolves the
10 # definition for PACKAGE_VERSION, based on a tagged definition
11 # within that file.
12 #
13 AC_DEFUN([MINGW_AC_CONFIG_SRCDIR],
14 [AC_CONFIG_SRCDIR([$2])
15  AC_MSG_CHECKING([package version])
16  PACKAGE_VERSION=`awk '$[2] == "'"$1"'" { print $[3] }' ${srcdir}/$2`
17  AC_MSG_RESULT([$PACKAGE_VERSION])dnl
18 ]) #MINGW_AC_CONFIG_SRCDIR
19
20 # The following is copied from `no-executables.m4', in the top
21 # `src/config' directory.
22 #
23 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
24 # 2005  Free Software Foundation, Inc.
25 # This file is free software; the Free Software Foundation
26 # gives unlimited permission to copy and/or distribute it,
27 # with or without modifications, as long as this notice is preserved.
28
29 # This program is distributed in the hope that it will be useful,
30 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
31 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
32 # PARTICULAR PURPOSE.
33
34 # GCC_NO_EXECUTABLES
35 # ------------------
36 # FIXME: The GCC team has specific needs which the current Autoconf
37 # framework cannot solve elegantly.  This macro implements a dirty
38 # hack until Autoconf is able to provide the services its users
39 # need.
40 #
41 # Several of the support libraries that are often built with GCC can't
42 # assume the tool-chain is already capable of linking a program: the
43 # compiler often expects to be able to link with some of such
44 # libraries.
45 #
46 # In several of these libraries, workarounds have been introduced to
47 # avoid the AC_PROG_CC_WORKS test, that would just abort their
48 # configuration.  The introduction of AC_EXEEXT, enabled either by
49 # libtool or by CVS autoconf, have just made matters worse.
50 #
51 # Unlike the previous AC_NO_EXECUTABLES, this test does not
52 # disable link tests at autoconf time, but at configure time.
53 # This allows AC_NO_EXECUTABLES to be invoked conditionally.
54 AC_DEFUN_ONCE([GCC_NO_EXECUTABLES],
55 [m4_divert_push([KILL])
56
57 AC_BEFORE([$0], [_AC_COMPILER_EXEEXT])
58 AC_BEFORE([$0], [AC_LINK_IFELSE])
59
60 m4_define([_AC_COMPILER_EXEEXT],
61 AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
62 # FIXME: Cleanup?
63 AS_IF([AC_TRY_EVAL(ac_link)], [gcc_no_link=no], [gcc_no_link=yes])
64 if test x$gcc_no_link = xyes; then
65   # Setting cross_compile will disable run tests; it will
66   # also disable AC_CHECK_FILE but that's generally
67   # correct if we can't link.
68   cross_compiling=yes
69   EXEEXT=
70 else
71   m4_defn([_AC_COMPILER_EXEEXT])dnl
72 fi
73 )
74
75 m4_define([AC_LINK_IFELSE],
76 if test x$gcc_no_link = xyes; then
77   AC_MSG_ERROR([Link tests are not allowed after [[$0]].])
78 fi
79 m4_defn([AC_LINK_IFELSE]))
80
81 dnl This is a shame.  We have to provide a default for some link tests,
82 dnl similar to the default for run tests.
83 m4_define([AC_FUNC_MMAP],
84 if test x$gcc_no_link = xyes; then
85   if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
86     ac_cv_func_mmap_fixed_mapped=no
87   fi
88 fi
89 if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then
90   m4_defn([AC_FUNC_MMAP])
91 fi)
92
93 m4_divert_pop()dnl
94 ])# GCC_NO_EXECUTABLES
95
96
97 # MINGW_AC_MANPAGE_TRANSFORM
98 # --------------------------
99 # Provide support for specifying a manpage name transform.
100 # This allows e.g. Cygwin to add a `mingw-' prefix to MinGW specific
101 # manpages, when installing as a Cygwin subsystem.
102 #
103 # Activated by `--enable-mingw-manpage-transform[=SED-SCRIPT]', the
104 # default is disabled, (i.e. no transform).  If enabled, without any
105 # SED-SCRIPT specification, the default `mingw-' prefix is added.
106 #
107 AC_DEFUN([MINGW_AC_MANPAGE_TRANSFORM],
108 [AC_ARG_ENABLE([mingw-manpage-transform],
109 [AS_HELP_STRING([--enable-mingw-manpage-transform@<:@=SED-SCRIPT@:>@],
110  [apply SED-SCRIPT @<:@s/^/mingw-/@:>@ to installed manpage names])]
111 [AS_HELP_STRING([--disable-mingw-manpage-transform],
112  [@<:@DEFAULT@:>@ don't transform installed manpage names])],
113  [case ${enableval} in
114     yes) mingw_manpage_transform='s,^,mingw-,' ;;
115      no) mingw_manpage_transform='s,x,x,' ;;
116       *) mingw_manpage_transform=${enableval} ;;
117   esac])
118  AC_SUBST([mingw_manpage_transform],[${mingw_manpage_transform-'s,x,x,'}])dnl
119 ])# MINGW_AC_MANPAGE_TRANSFORM
120
121 # $RCSfile$: end of file: vim: ft=config