1 dnl Autoconf configure script for Cygwin.
2 dnl Copyright 2003 Red Hat, Inc.
4 dnl This file is part of Cygwin.
6 dnl This software is a copyrighted work licensed under the terms of the
7 dnl Cygwin license. Please consult the file "CYGWIN_LICENSE" for
10 dnl Process this file with autoconf to produce a configure script.
15 INSTALL=`cd $srcdir/../..; echo $(pwd)/install-sh -c`
19 dnl FIXME: We temporarily define our own version of AC_PROG_CC. This is
20 dnl copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
21 dnl are probably using a cross compiler, which will not be able to fully
22 dnl link an executable. This should really be fixed in autoconf
25 AC_DEFUN(LIB_AC_PROG_CC,
26 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
27 AC_CHECK_TOOL(CC, gcc, gcc)
28 if test -z "$CC"; then
29 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
30 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
35 if test $ac_cv_prog_gcc = yes; then
37 dnl Check whether -g works, even if CFLAGS is set, in case the package
38 dnl plays around with CFLAGS (such as to build both debugging and
39 dnl normal versions of a library), tasteless as that idea is.
40 ac_test_CFLAGS="${CFLAGS+set}"
41 ac_save_CFLAGS="$CFLAGS"
44 if test "$ac_test_CFLAGS" = set; then
45 CFLAGS="$ac_save_CFLAGS"
46 elif test $ac_cv_prog_cc_g = yes; then
53 test "${CFLAGS+set}" = set || CFLAGS="-g"
57 AC_DEFUN(LIB_AC_PROG_CXX,
58 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
59 AC_CHECK_TOOL(CXX, g++, g++)
60 if test -z "$CXX"; then
61 AC_CHECK_PROG(CXX, c++, c++, , , )
62 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
73 case "$with_cross_host" in
76 install_host="install_host"
85 AC_SUBST(install_host)
87 AC_CHECK_TOOL(AR, ar, ar)
88 AC_CHECK_TOOL(AS, as, as)
89 AC_CHECK_TOOL(RANLIB, ranlib, ranlib)
90 AC_CHECK_TOOL(LD, ld, ld)
91 AC_CHECK_TOOL(NM, nm, nm)
92 AC_CHECK_TOOL(DLLTOOL, dlltool, dlltool)
93 AC_CHECK_TOOL(WINDRES, windres, windres)
98 dnl check whether gcc supports __builtin_memset.
99 # Test for builtin mem* functions.
104 void foo(char *s, int c, size_t n)
106 __builtin_memset(s, c, n);
109 use_builtin_memset=yes, use_builtin_memset=no)
110 if test $use_builtin_memset = "yes"; then
111 AC_DEFINE(HAVE_BUILTIN_MEMSET)
115 AC_ARG_ENABLE(debugging,
116 [ --enable-debugging Build a cygwin DLL which has more consistency checking for debugging],
117 [case "${enableval}" in
118 yes) AC_DEFINE(DEBUGGING) ;;