]> sourceware.org Git - newlib-cygwin.git/blame - winsup/acinclude.m4
ChangeLog:
[newlib-cygwin.git] / winsup / acinclude.m4
CommitLineData
4c36016b 1dnl This provides configure definitions used by all the cygwin
99fc5e10
CF
2dnl configure.in files.
3
4c36016b
CF
4AC_DEFUN([AC_WINDOWS_HEADERS],[
5AC_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
13AC_DEFUN([AC_WINDOWS_LIBS],[
14AC_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)
20windows_libdir=$(realdirpath "$with_windows_libs")
21if 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
26fi
27AC_SUBST(windows_libdir)
28]
29)
30
31AC_DEFUN([AC_CYGWIN_INCLUDES], [
32addto_CPPFLAGS -nostdinc
33: ${ac_cv_prog_CXX:=$CXX}
34: ${ac_cv_prog_CC:=$CC}
35
36cygwin_headers=$(realdirpath "$winsup_srcdir/cygwin/include")
37if test -z "$cygwin_headers"; then
38 AC_MSG_ERROR([cannot find $winsup_srcdir/cygwin/include directory])
39fi
40
41newlib_headers=$(realdirpath $winsup_srcdir/../newlib/libc/include)
42if test -z "$newlib_headers"; then
43 AC_MSG_ERROR([cannot find newlib source directory: $winsup_srcdir/../newlib/libc/include])
99fc5e10 44fi
4c36016b 45newlib_headers="$target_builddir/newlib/targ-include $newlib_headers"
99fc5e10 46
4c36016b
CF
47if 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
53elif test -d "$winsup_srcdir/w32api/include/windef.h"; then
54 windows_headers="$winsup_srcdir/w32api/include"
55else
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
60fi
61CC=$ac_cv_prog_CC
62CXX=$ac_cv_prog_CXX
63export CC
64export CXX
65AC_SUBST(windows_headers)
66AC_SUBST(newlib_headers)
67AC_SUBST(cygwin_headers)
99fc5e10 68])
4c36016b
CF
69
70AC_DEFUN([AC_CONFIGURE_ARGS], [
71configure_args=X
72for f in $ac_configure_args; do
73 case "$f" in
74 *--srcdir*) ;;
75 *) configure_args="$configure_args $f" ;;
76 esac
77done
78configure_args=$(/usr/bin/expr "$configure_args" : 'X \(.*\)')
79AC_SUBST(configure_args)
80])
81
82AC_SUBST(target_builddir)
83AC_SUBST(winsup_srcdir)
This page took 0.103073 seconds and 5 git commands to generate.