]> sourceware.org Git - newlib-cygwin.git/blob - winsup/cygserver/configure.in
* wincap.cc: New file.
[newlib-cygwin.git] / winsup / cygserver / configure.in
1 dnl Autoconf configure script for Cygwin.
2 dnl Copyright 2003 Red Hat, Inc.
3 dnl
4 dnl This file is part of Cygwin.
5 dnl
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
8 dnl details.
9 dnl
10 dnl Process this file with autoconf to produce a configure script.
11
12 AC_PREREQ(2.12)dnl
13 AC_INIT(cygserver.cc)
14
15 INSTALL=`cd $srcdir/../..; echo $(pwd)/install-sh -c`
16
17 AC_PROG_INSTALL
18
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
23 dnl itself.
24
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])
31 fi
32
33 AC_PROG_CC_GNU
34
35 if test $ac_cv_prog_gcc = yes; then
36 GCC=yes
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"
42 CFLAGS=
43 AC_PROG_CC_G
44 if test "$ac_test_CFLAGS" = set; then
45 CFLAGS="$ac_save_CFLAGS"
46 elif test $ac_cv_prog_cc_g = yes; then
47 CFLAGS="-gstabs+ -O2"
48 else
49 CFLAGS="-O2"
50 fi
51 else
52 GCC=
53 test "${CFLAGS+set}" = set || CFLAGS="-g"
54 fi
55 ])
56
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])
63 fi
64
65 CXXFLAGS='$(CFLAGS)'
66 ])
67
68 AC_CANONICAL_SYSTEM
69
70 LIB_AC_PROG_CC
71 LIB_AC_PROG_CXX
72
73 case "$with_cross_host" in
74 ""|*cygwin*)
75 all_host="all_host"
76 install_host="install_host"
77 ;;
78 *)
79 all_host=
80 install_host=
81 ;;
82 esac
83
84 AC_SUBST(all_host)
85 AC_SUBST(install_host)
86
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)
94
95 AC_ALLOCA
96 AC_PROG_MAKE_SET
97
98 dnl check whether gcc supports __builtin_memset.
99 # Test for builtin mem* functions.
100 AC_LANG_SAVE
101 AC_LANG_CPLUSPLUS
102 AC_TRY_COMPILE([
103 #include <string.h>
104 void foo(char *s, int c, size_t n)
105 {
106 __builtin_memset(s, c, n);
107 }
108 ], [ ],
109 use_builtin_memset=yes, use_builtin_memset=no)
110 if test $use_builtin_memset = "yes"; then
111 AC_DEFINE(HAVE_BUILTIN_MEMSET)
112 fi
113 AC_LANG_RESTORE
114
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) ;;
119 no) ;;
120 esac
121 ])
122
123 AC_OUTPUT(Makefile)
This page took 0.039914 seconds and 5 git commands to generate.