]> sourceware.org Git - newlib-cygwin.git/blob - winsup/mingw/configure.in
b493b483158965b96271bacd2ed97f2e6539311e
[newlib-cygwin.git] / winsup / mingw / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 dnl This file is part of winsup/mingw
4 dnl
5 dnl This program is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 2 of the License, or
8 dnl (at your option) any later version.
9 dnl
10 dnl This program is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 dnl GNU General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with this program; if not, write to the Free Software
17 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 AC_PREREQ(2.12)
20 AC_INIT(dllmain.c)
21
22 dnl FIXME: We temporarily define our own version of AC_PROG_CC. This is
23 dnl copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
24 dnl are probably using a cross compiler, which will not be able to fully
25 dnl link an executable. This should really be fixed in autoconf
26 dnl itself.
27
28 AC_DEFUN(LIB_AC_PROG_CC,
29 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
30 AC_CHECK_TOOL(CC, gcc, gcc)
31 if test -z "$CC"; then
32 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
33 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
34 fi
35
36 AC_PROG_CC_GNU
37
38 if test $ac_cv_prog_gcc = yes; then
39 GCC=yes
40 dnl Check whether -g works, even if CFLAGS is set, in case the package
41 dnl plays around with CFLAGS (such as to build both debugging and
42 dnl normal versions of a library), tasteless as that idea is.
43 ac_test_CFLAGS="${CFLAGS+set}"
44 ac_save_CFLAGS="$CFLAGS"
45 CFLAGS=
46 AC_PROG_CC_G
47 if test "$ac_test_CFLAGS" = set; then
48 CFLAGS="$ac_save_CFLAGS"
49 elif test $ac_cv_prog_cc_g = yes; then
50 CFLAGS="-g -O2"
51 else
52 CFLAGS="-O2"
53 fi
54 if test "$ac_test_CXXFLAGS" != set; then
55 CXXFLAGS='$(CFLAGS)'
56 fi
57 else
58 GCC=
59 test "${CFLAGS+set}" = set || CFLAGS="-g"
60 fi
61 ])
62
63 LIB_AC_PROG_CC
64
65 case "$with_cross_host" in
66 ""|*cygwin*) all_dlls_host='all_dlls_host'
67 install_dlls_host='install_dlls_host';;
68 esac
69 AC_SUBST(all_dlls_host)
70 AC_SUBST(install_dlls_host)
71
72 AC_CHECK_TOOL(AR, ar, ar)
73
74 AC_SUBST(AR)
75 AC_CHECK_TOOL(AS, as, as)
76 AC_SUBST(AS)
77 AC_CHECK_TOOL(RANLIB, ranlib, ranlib)
78 AC_SUBST(RANLIB)
79 AC_CHECK_TOOL(LD, ld, ld)
80 AC_SUBST(LD)
81 AC_CHECK_TOOL(DLLTOOL, dlltool, dlltool)
82 AC_SUBST(DLLTOOL)
83 AC_CHECK_TOOL(DLLWRAP, dlltool, dlltool)
84 AC_SUBST(DLLWRAP)
85 AC_CHECK_TOOL(WINDRES, windres, windres)
86 AC_SUBST(WINDRES)
87
88 AC_ALLOCA
89
90 AC_CANONICAL_SYSTEM
91 SUBDIRS="profile mingwex"
92 configdirs="profile mingwex"
93 HEADER_SUBDIR=""
94
95 LIBGMON_A=libgmon.a
96
97 W32API_INCLUDE='-I $(srcdir)/../w32api/include'
98
99 case "$target_os" in
100 *cygwin*)
101 MNO_CYGWIN=-mno-cygwin
102 LIBM_A=libm.a
103 # Install mingw headers in mingw subdirectory.
104 HEADER_SUBDIR="mingw"
105 ;;
106 *)
107 # Build it for MSVCRT by default.
108 MNO_CYGWIN=
109 LIBM_A=libm.a
110 ;;
111 esac
112
113 # THREAD_DLL used to be set within the above case and was mingwc for CRTDLL.
114 # I can find no reason to do this.
115 #
116 # FIXME: In the future I would like to change the dll name to mingwthrd to
117 # to match the libmingwthrd.a name.
118 THREAD_DLL=mingwm
119
120 if test -n "$configdirs"; then
121 AC_CONFIG_SUBDIRS($configdirs)
122 fi
123
124 MKINSTALLDIRS=$ac_aux_dir/mkinstalldirs
125 AC_SUBST(MKINSTALLDIRS)
126 AC_SUBST(MNO_CYGWIN)
127 AC_SUBST(THREAD_DLL)
128 AC_SUBST(LIBM_A)
129 AC_SUBST(LIBGMON_A)
130 AC_SUBST(SUBDIRS)
131 AC_SUBST(HEADER_SUBDIR)
132 AC_SUBST(W32API_INCLUDE)
133
134 AC_PROG_INSTALL
135 AC_OUTPUT(Makefile)
136
This page took 0.041881 seconds and 4 git commands to generate.