1 dnl Process this file with autoconf to produce a configure script.
3 dnl This file is part of winsup/mingw
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.
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.
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.
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
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])
38 if test $ac_cv_prog_gcc = yes; then
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"
47 if test "$ac_test_CFLAGS" = set; then
48 CFLAGS="$ac_save_CFLAGS"
49 elif test $ac_cv_prog_cc_g = yes; then
54 if test "$ac_test_CXXFLAGS" != set; then
59 test "${CFLAGS+set}" = set || CFLAGS="-g"
65 case "$with_cross_host" in
66 ""|*cygwin*) all_dlls_host='all_dlls_host'
67 install_dlls_host='install_dlls_host';;
69 AC_SUBST(all_dlls_host)
70 AC_SUBST(install_dlls_host)
72 AC_CHECK_TOOL(AR, ar, ar)
75 AC_CHECK_TOOL(AS, as, as)
77 AC_CHECK_TOOL(RANLIB, ranlib, ranlib)
79 AC_CHECK_TOOL(LD, ld, ld)
81 AC_CHECK_TOOL(DLLTOOL, dlltool, dlltool)
83 AC_CHECK_TOOL(DLLWRAP, dlltool, dlltool)
85 AC_CHECK_TOOL(WINDRES, windres, windres)
91 SUBDIRS="profile mingwex"
92 configdirs="profile mingwex"
97 W32API_INCLUDE='-I $(srcdir)/../w32api/include'
101 MNO_CYGWIN=-mno-cygwin
103 # Install mingw headers in mingw subdirectory.
104 HEADER_SUBDIR="mingw"
107 # Build it for MSVCRT by default.
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.
116 # FIXME: In the future I would like to change the dll name to mingwthrd to
117 # to match the libmingwthrd.a name.
120 if test -n "$configdirs"; then
121 AC_CONFIG_SUBDIRS($configdirs)
124 MKINSTALLDIRS=$ac_aux_dir/mkinstalldirs
125 AC_SUBST(MKINSTALLDIRS)
131 AC_SUBST(HEADER_SUBDIR)
132 AC_SUBST(W32API_INCLUDE)