OSDN Git Service

8711d0dd87e68f77d45ff6ba57efadcbd3db9685
[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 AC_PROG_CC_GNU
26
27 if test $ac_cv_prog_gcc = yes; then
28   GCC=yes
29 dnl Check whether -g works, even if CFLAGS is set, in case the package
30 dnl plays around with CFLAGS (such as to build both debugging and
31 dnl normal versions of a library), tasteless as that idea is.
32   ac_test_CFLAGS="${CFLAGS+set}"
33   ac_save_CFLAGS="$CFLAGS"
34   CFLAGS=
35   AC_PROG_CC_G
36   if test "$ac_test_CFLAGS" = set; then
37     CFLAGS="$ac_save_CFLAGS"
38   elif test $ac_cv_prog_cc_g = yes; then
39     CFLAGS="-g -O2"
40   else
41     CFLAGS="-O2"
42   fi
43 else
44   GCC=
45   test "${CFLAGS+set}" = set || CFLAGS="-g"
46 fi
47 ])
48
49 LIB_AC_PROG_CC
50
51 case "${host}" in
52 *-*-cygwin*)
53         touch ac$$.c
54         if ${CC} -c -mno-win32 ac$$.c >/dev/null 2>&1; then
55             case "$EXTRA_CFLAGS" in
56                 *-mno-win32*) ;;
57                 *) EXTRA_CFLAGS="-mno-win32 $EXTRA_CFLAGS" ;;
58             esac
59         fi
60         rm -f ac$$.o ac$$.c
61         ;;
62 esac
63
64 AC_CHECK_TOOL(AR, ar, ar)
65 AC_SUBST(AR)
66 AC_SUBST(EXTRA_CFLAGS)
67 AC_PROG_RANLIB
68 AC_PROG_INSTALL
69
70 #--------------------------------------------------------------------
71 #       The statements below define the symbol TCL_PACKAGE_PATH, which
72 #       gives a list of directories that may contain packages.  The list
73 #       consists of one directory for machine-dependent binaries and
74 #       another for platform-independent scripts.
75 #--------------------------------------------------------------------
76
77 if test "$prefix" != "$exec_prefix"; then
78     TCL_PACKAGE_PATH="${exec_prefix}/lib ${prefix}/lib"
79 else
80     TCL_PACKAGE_PATH="${prefix}/lib"
81 fi
82
83 TCL_LIBRARY=@datadir@/tcl${VERSION}
84
85 cross_cache=${srcdir}/cygwin-cache
86 . ${cross_cache}
87
88 AC_SUBST(TCL_PACKAGE_PATH)
89 AC_SUBST(TCL_LIBRARY)
90
91 # These variables are needed to get expect working with
92 # the tclConfig.sh script in the cygwin directory.
93 LD_FLAGS=""
94 AC_SUBST(LD_FLAGS)
95 TCL_LD_SEARCH_FLAGS=""
96 AC_SUBST(TCL_LD_SEARCH_FLAGS)
97 DL_LIBS=""
98 AC_SUBST(DL_LIBS)
99 MATH_LIBS=""
100 AC_SUBST(MATH_LIBS)
101 SHLIB_LD='${CC} -shared ${CFLAGS}'
102 AC_SUBST(SHLIB_LD)
103 TCL_BUILD_LIB_SPEC=`pwd`/libtcl_cygwin.a
104 AC_SUBST(TCL_BUILD_LIB_SPEC)
105 TCL_LIB_SPEC="$TCL_BUILD_LIB_SPEC"
106 AC_SUBST(TCL_LIB_SPEC)
107
108
109 AC_OUTPUT([Makefile tclConfig.sh])