]>
Commit | Line | Data |
---|---|---|
2a6d6db8 | 1 | # generated automatically by aclocal 1.11.6 -*- Autoconf -*- |
99fc5e10 | 2 | |
d4f4d1d0 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
2a6d6db8 CF |
4 | # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, |
5 | # Inc. | |
4c36016b CF |
6 | # This file is free software; the Free Software Foundation |
7 | # gives unlimited permission to copy and/or distribute it, | |
8 | # with or without modifications, as long as this notice is preserved. | |
99fc5e10 | 9 | |
4c36016b CF |
10 | # This program is distributed in the hope that it will be useful, |
11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
13 | # PARTICULAR PURPOSE. | |
99fc5e10 | 14 | |
4c36016b CF |
15 | dnl This provides configure definitions used by all the cygwin |
16 | dnl configure.in files. | |
99fc5e10 | 17 | |
4c36016b CF |
18 | AC_DEFUN([AC_WINDOWS_HEADERS],[ |
19 | AC_ARG_WITH( | |
20 | [windows-headers], | |
21 | [AS_HELP_STRING([--with-windows-headers=DIR], | |
22 | [specify where the windows includes are located])], | |
23 | [test -z "$withval" && AC_MSG_ERROR([must specify value for --with-windows-headers])] | |
24 | ) | |
99fc5e10 CF |
25 | ]) |
26 | ||
4c36016b CF |
27 | AC_DEFUN([AC_WINDOWS_LIBS],[ |
28 | AC_ARG_WITH( | |
29 | [windows-libs], | |
30 | [AS_HELP_STRING([--with-windows-libs=DIR], | |
31 | [specify where the windows libraries are located])], | |
32 | [test -z "$withval" && AC_MSG_ERROR([must specify value for --with-windows-libs])] | |
33 | ) | |
34 | windows_libdir=$(realdirpath "$with_windows_libs") | |
35 | if test -z "$windows_libdir"; then | |
36 | windows_libdir=$(realdirpath $(${ac_cv_prog_CC:-$CC} -xc /dev/null -Wl,--verbose=1 -lntdll 2>&1 | sed -rn 's%^.*\s(\S+)/libntdll\..*succeeded%\1%p')) | |
37 | if test -z "$windows_libdir"; then | |
38 | AC_MSG_ERROR([cannot find windows library files]) | |
39 | fi | |
40 | fi | |
41 | AC_SUBST(windows_libdir) | |
42 | ] | |
43 | ) | |
44 | ||
45 | AC_DEFUN([AC_CYGWIN_INCLUDES], [ | |
46 | addto_CPPFLAGS -nostdinc | |
47 | : ${ac_cv_prog_CXX:=$CXX} | |
48 | : ${ac_cv_prog_CC:=$CC} | |
49 | ||
50 | cygwin_headers=$(realdirpath "$winsup_srcdir/cygwin/include") | |
51 | if test -z "$cygwin_headers"; then | |
52 | AC_MSG_ERROR([cannot find $winsup_srcdir/cygwin/include directory]) | |
53 | fi | |
99fc5e10 | 54 | |
4c36016b CF |
55 | newlib_headers=$(realdirpath $winsup_srcdir/../newlib/libc/include) |
56 | if test -z "$newlib_headers"; then | |
57 | AC_MSG_ERROR([cannot find newlib source directory: $winsup_srcdir/../newlib/libc/include]) | |
58 | fi | |
59 | newlib_headers="$target_builddir/newlib/targ-include $newlib_headers" | |
99fc5e10 | 60 | |
4c36016b CF |
61 | if test -n "$with_windows_headers"; then |
62 | if test -e "$with_windows_headers/windef.h"; then | |
63 | windows_headers="$with_windows_headers" | |
99fc5e10 | 64 | else |
4c36016b | 65 | AC_MSG_ERROR([cannot find windef.h in specified --with-windows-headers path: $saw_windows_headers]); |
99fc5e10 | 66 | fi |
4c36016b CF |
67 | elif test -d "$winsup_srcdir/w32api/include/windef.h"; then |
68 | windows_headers="$winsup_srcdir/w32api/include" | |
99fc5e10 | 69 | else |
4c36016b CF |
70 | windows_headers=$(cd $($ac_cv_prog_CC -xc /dev/null -E -include windef.h 2>/dev/null | sed -n 's%^# 1 "\([^"]*\)/windef\.h".*$%\1%p' | head -n1) 2>/dev/null && pwd) |
71 | if test -z "$windows_headers" -o ! -d "$windows_headers"; then | |
72 | AC_MSG_ERROR([cannot find windows header files]) | |
99fc5e10 | 73 | fi |
99fc5e10 | 74 | fi |
4c36016b CF |
75 | CC=$ac_cv_prog_CC |
76 | CXX=$ac_cv_prog_CXX | |
77 | export CC | |
78 | export CXX | |
79 | AC_SUBST(windows_headers) | |
80 | AC_SUBST(newlib_headers) | |
81 | AC_SUBST(cygwin_headers) | |
99fc5e10 CF |
82 | ]) |
83 | ||
4c36016b CF |
84 | AC_DEFUN([AC_CONFIGURE_ARGS], [ |
85 | configure_args=X | |
86 | for f in $ac_configure_args; do | |
87 | case "$f" in | |
88 | *--srcdir*) ;; | |
89 | *) configure_args="$configure_args $f" ;; | |
90 | esac | |
91 | done | |
92 | configure_args=$(/usr/bin/expr "$configure_args" : 'X \(.*\)') | |
93 | AC_SUBST(configure_args) | |
99fc5e10 CF |
94 | ]) |
95 | ||
4c36016b CF |
96 | AC_SUBST(target_builddir) |
97 | AC_SUBST(winsup_srcdir) | |
99fc5e10 | 98 |