]> sourceware.org Git - newlib-cygwin.git/blob - winsup/configure.in
d252adaa655ef69ee3a038b2de21f8f09fc07510
[newlib-cygwin.git] / winsup / configure.in
1 dnl Autoconf configure script for Cygwin.
2 dnl Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 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(Makefile.in)
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="-g -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 use_cygserver='yes'
74 AC_ARG_ENABLE(server,
75 [ --enable-server Build a cygwin DLL which can communicate with cygserver],
76 [case "${enableval}" in
77 yes) ;;
78 no) use_cygserver=;;
79 esac
80 ])
81
82 SUBDIRS='cygwin w32api'
83 test -d $srcdir/mingw && SUBDIRS="mingw $SUBDIRS"
84
85 case "$with_cross_host" in
86 ""|*cygwin*)
87 # test -d $srcdir/bz2lib && SUBDIRS="$SUBDIRS bz2lib"
88 # test -d $srcdir/zlib && SUBDIRS="$SUBDIRS zlib"
89 # test -d $srcdir/subauth && SUBDIRS="$SUBDIRS subauth"
90 test -n "$use_cygserver" -a -d $srcdir/cygserver && SUBDIRS="$SUBDIRS cygserver"
91 SUBDIRS="$SUBDIRS utils doc"
92 ;;
93 esac
94
95 AC_CONFIG_SUBDIRS($SUBDIRS)
96
97 AC_PROG_MAKE_SET
98
99 AC_SUBST(SUBDIRS)
100 AC_OUTPUT(Makefile)
This page took 0.042784 seconds and 4 git commands to generate.