OSDN Git Service

* configure.in: Fix for autoconf 2.5.
[pf3gnuchains/sourceware.git] / tcl / cygwin / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.13)
4
5 AC_INIT(Makefile.in)
6 AC_CANONICAL_SYSTEM
7 AM_INIT_AUTOMAKE(libtcl_cygwin, 8.4)
8 AM_MAINTAINER_MODE
9 AC_EXEEXT
10
11 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
12 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
13 # are probably using a cross compiler, which will not be able to fully
14 # link an executable.  This should really be fixed in autoconf
15 # itself.
16
17 AC_DEFUN(LIB_AC_PROG_CC,
18 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
19 AC_CHECK_PROG(CC, gcc, gcc)
20 if test -z "$CC"; then
21   AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
22   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
23 fi
24
25 if test $ac_cv_prog_gcc = yes; then
26   GCC=yes
27 dnl Check whether -g works, even if CFLAGS is set, in case the package
28 dnl plays around with CFLAGS (such as to build both debugging and
29 dnl normal versions of a library), tasteless as that idea is.
30   ac_test_CFLAGS="${CFLAGS+set}"
31   ac_save_CFLAGS="$CFLAGS"
32   CFLAGS=
33   if test "$ac_test_CFLAGS" = set; then
34     CFLAGS="$ac_save_CFLAGS"
35   elif test $ac_cv_prog_cc_g = yes; then
36     CFLAGS="-g -O2"
37   else
38     CFLAGS="-O2"
39   fi
40 else
41   GCC=
42   test "${CFLAGS+set}" = set || CFLAGS="-g"
43 fi
44 ])
45
46 LIB_AC_PROG_CC
47
48 case "${host}" in
49 *-*-cygwin*)
50         touch ac$$.c
51         if ${CC} -c -mno-win32 ac$$.c >/dev/null 2>&1; then
52             case "$EXTRA_CFLAGS" in
53                 *-mno-win32*) ;;
54                 *) EXTRA_CFLAGS="-mno-win32 $EXTRA_CFLAGS" ;;
55             esac
56         fi
57         rm -f ac$$.o ac$$.c
58         ;;
59 esac
60
61 AC_CHECK_TOOL(AR, ar, ar)
62 AC_SUBST(AR)
63 AC_SUBST(EXTRA_CFLAGS)
64 AC_PROG_RANLIB
65 AC_PROG_INSTALL
66
67 #--------------------------------------------------------------------
68 #       The statements below define the symbol TCL_PACKAGE_PATH, which
69 #       gives a list of directories that may contain packages.  The list
70 #       consists of one directory for machine-dependent binaries and
71 #       another for platform-independent scripts.
72 #--------------------------------------------------------------------
73
74 if test "$prefix" != "$exec_prefix"; then
75     TCL_PACKAGE_PATH="${exec_prefix}/lib ${prefix}/lib"
76 else
77     TCL_PACKAGE_PATH="${prefix}/lib"
78 fi
79
80 TCL_LIBRARY=@datadir@/tcl${VERSION}
81
82 cross_cache=${srcdir}/cygwin-cache
83 . ${cross_cache}
84
85 AC_SUBST(TCL_PACKAGE_PATH)
86 AC_SUBST(TCL_LIBRARY)
87
88 # These variables are needed to get expect working with
89 # the tclConfig.sh script in the cygwin directory.
90 LD_FLAGS=""
91 AC_SUBST(LD_FLAGS)
92 TCL_LD_SEARCH_FLAGS=""
93 AC_SUBST(TCL_LD_SEARCH_FLAGS)
94 DL_LIBS=""
95 AC_SUBST(DL_LIBS)
96 MATH_LIBS=""
97 AC_SUBST(MATH_LIBS)
98 SHLIB_LD='${CC} -shared ${CFLAGS}'
99 AC_SUBST(SHLIB_LD)
100 TCL_BUILD_LIB_SPEC=`pwd`/libtcl_cygwin.a
101 AC_SUBST(TCL_BUILD_LIB_SPEC)
102 TCL_LIB_SPEC="$TCL_BUILD_LIB_SPEC"
103 AC_SUBST(TCL_LIB_SPEC)
104
105
106 AC_OUTPUT([Makefile tclConfig.sh])