]>
Commit | Line | Data |
---|---|---|
4c36016b | 1 | dnl This provides configure definitions used by all the cygwin |
99fc5e10 CF |
2 | dnl configure.in files. |
3 | ||
4c36016b CF |
4 | AC_DEFUN([AC_WINDOWS_HEADERS],[ |
5 | AC_ARG_WITH( | |
6 | [windows-headers], | |
7 | [AS_HELP_STRING([--with-windows-headers=DIR], | |
8 | [specify where the windows includes are located])], | |
9 | [test -z "$withval" && AC_MSG_ERROR([must specify value for --with-windows-headers])] | |
10 | ) | |
99fc5e10 CF |
11 | ]) |
12 | ||
4c36016b CF |
13 | AC_DEFUN([AC_WINDOWS_LIBS],[ |
14 | AC_ARG_WITH( | |
15 | [windows-libs], | |
16 | [AS_HELP_STRING([--with-windows-libs=DIR], | |
17 | [specify where the windows libraries are located])], | |
18 | [test -z "$withval" && AC_MSG_ERROR([must specify value for --with-windows-libs])] | |
19 | ) | |
20 | windows_libdir=$(realdirpath "$with_windows_libs") | |
21 | if test -z "$windows_libdir"; then | |
22 | 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')) | |
23 | if test -z "$windows_libdir"; then | |
24 | AC_MSG_ERROR([cannot find windows library files]) | |
25 | fi | |
26 | fi | |
27 | AC_SUBST(windows_libdir) | |
28 | ] | |
29 | ) | |
30 | ||
31 | AC_DEFUN([AC_CYGWIN_INCLUDES], [ | |
32 | addto_CPPFLAGS -nostdinc | |
33 | : ${ac_cv_prog_CXX:=$CXX} | |
34 | : ${ac_cv_prog_CC:=$CC} | |
35 | ||
36 | cygwin_headers=$(realdirpath "$winsup_srcdir/cygwin/include") | |
37 | if test -z "$cygwin_headers"; then | |
38 | AC_MSG_ERROR([cannot find $winsup_srcdir/cygwin/include directory]) | |
39 | fi | |
40 | ||
41 | newlib_headers=$(realdirpath $winsup_srcdir/../newlib/libc/include) | |
42 | if test -z "$newlib_headers"; then | |
43 | AC_MSG_ERROR([cannot find newlib source directory: $winsup_srcdir/../newlib/libc/include]) | |
99fc5e10 | 44 | fi |
4c36016b | 45 | newlib_headers="$target_builddir/newlib/targ-include $newlib_headers" |
99fc5e10 | 46 | |
4c36016b CF |
47 | if test -n "$with_windows_headers"; then |
48 | if test -e "$with_windows_headers/windef.h"; then | |
49 | windows_headers="$with_windows_headers" | |
50 | else | |
51 | AC_MSG_ERROR([cannot find windef.h in specified --with-windows-headers path: $saw_windows_headers]); | |
52 | fi | |
53 | elif test -d "$winsup_srcdir/w32api/include/windef.h"; then | |
54 | windows_headers="$winsup_srcdir/w32api/include" | |
55 | else | |
56 | 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) | |
57 | if test -z "$windows_headers" -o ! -d "$windows_headers"; then | |
58 | AC_MSG_ERROR([cannot find windows header files]) | |
59 | fi | |
60 | fi | |
61 | CC=$ac_cv_prog_CC | |
62 | CXX=$ac_cv_prog_CXX | |
63 | export CC | |
64 | export CXX | |
65 | AC_SUBST(windows_headers) | |
66 | AC_SUBST(newlib_headers) | |
67 | AC_SUBST(cygwin_headers) | |
99fc5e10 | 68 | ]) |
4c36016b CF |
69 | |
70 | AC_DEFUN([AC_CONFIGURE_ARGS], [ | |
71 | configure_args=X | |
72 | for f in $ac_configure_args; do | |
73 | case "$f" in | |
74 | *--srcdir*) ;; | |
75 | *) configure_args="$configure_args $f" ;; | |
76 | esac | |
77 | done | |
78 | configure_args=$(/usr/bin/expr "$configure_args" : 'X \(.*\)') | |
79 | AC_SUBST(configure_args) | |
80 | ]) | |
81 | ||
82 | AC_SUBST(target_builddir) | |
83 | AC_SUBST(winsup_srcdir) |