OSDN Git Service

* flow.c (mark_used_regs): Improve handling of ASMs.
[pf3gnuchains/gcc-fork.git] / libio / configure.in
1 # This file is a shell script fragment that supplies the information
2 # necessary for a configure script to process the program in
3 # this directory.  For more information, look at ../configure.
4
5 # find a possible extension of the just-built C++ compiler. Note that this
6 # is not the only choice, taking into cross and canadian cross into
7 # account, and we need to search for with and without the extension.
8 case "${host_alias}" in
9 *cygwin* | *mingw32*)
10   EXEEXT=.exe
11   ;;
12 *)
13   EXEEXT=
14   ;;
15 esac
16
17 # If the language specific compiler does not exist, but the "gcc" directory 
18 # does, we do not build anything. Note, $r is set by the top-level Makefile.
19 # Note that when we look for the compiler, we search both with and without
20 # extension to handle cross and canadian cross builds. 
21 compiler_name=cc1plus
22 rm -f skip-this-dir
23 if test -n "$r"; then
24   if test -d "$r"/gcc; then
25     if test -f "$r"/gcc/$compiler_name \
26        || test -f "$r"/gcc/$compiler_name$EXEEXT; then
27       true
28     else
29       echo "rm -f multilib.out" > skip-this-dir
30     fi
31   fi
32 fi
33
34 if [ "${srcdir}" = "." ] ; then
35   if [ "${with_target_subdir}" != "." ] ; then
36     topsrcdir=${with_multisrctop}../..
37   else
38     topsrcdir=${with_multisrctop}..
39   fi
40 else
41   topsrcdir=${srcdir}/..
42 fi
43
44 if [ -d ${topsrcdir}/gcc ] ; then
45   configdirs="tests dbz stdio testsuite"
46 else
47   configdirs="tests dbz stdio"
48 fi
49 srctrigger=libioP.h
50 srcname="input/output library"
51 package_makefile_frag=Make.pack
52 package_makefile_rules_frag=Make.pack.r
53
54 # per-host:
55
56 # per-target:
57
58 echo "# Warning: this fragment is automatically generated" > temp.mt
59 frags=
60
61 case "${target}" in
62   *-hpux*)       frags=hpux.mt ;;
63   alpha*-*-linux-gnulibc1)
64                  frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
65   powerpc*-*-linux-gnulibc1)
66                  frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
67   *-linux-gnulibc1)
68                  frags=linuxlibc1.mt ;;
69   *-linux-gnu)   frags="linux.mt mtsafe.mt" ;;
70   *-sco3.2v[45]*)   frags=sco4.mt ;;
71   *-isc*)        frags=isc.mt ;;
72   *-netware*)    frags=netware.mt ;;
73   *)             frags=${target_cpu}.mt ;;
74 esac
75
76 case "${enable_shared}" in
77   yes) shared=yes ;;
78   no) shared=no ;;
79   *libio*) shared=yes ;;
80   *) shared=no ;;
81 esac
82
83 if [ "${shared}" = "yes" ]; then
84   case "${target}" in
85     alpha*-*-linux*)    frags="${frags} ../../config/mh-elfalphapic" ;;
86     arm*-*-*)           frags="${frags} ../../config/mh-armpic" ;;
87     hppa*-*-*)          frags="${frags} ../../config/mh-papic" ;;
88     i[3456]86-*-*)      frags="${frags} ../../config/mh-x86pic" ;;
89     powerpc*-*-aix*)    ;;
90     powerpc*-*-*)       frags="${frags} ../../config/mh-ppcpic" ;;
91     *-*-*)              frags="${frags} ../../config/mh-${target_cpu}pic" ;;
92   esac
93 fi
94
95 # Take care of header file lossage.
96 case "${target}" in
97   alpha*-*-linux-gnulibc1)
98     # For some reason stdio-lock.h is not installed on Red Hat systems.
99     # Further, libc-lock.h needs to define the pthreads stuff weak, and
100     # fails to do this for other than _LIBC.  Install our own versions
101     # of these files.
102     cp ${srcdir}/config/linuxaxp1-libc-lock.h libc-lock.h
103     cp ${srcdir}/config/linuxaxp1-stdio-lock.h stdio-lock.h
104     ;;
105   powerpc*-*-linux-gnulibc1)
106     # For some reason stdio-lock.h is not installed on Red Hat systems.
107     # Further, libc-lock.h needs to define the pthreads stuff weak, and
108     # fails to do this for other than _LIBC.  Install our own versions
109     # of these files.
110     cp ${srcdir}/config/linuxaxp1-libc-lock.h libc-lock.h
111     cp ${srcdir}/config/linuxaxp1-stdio-lock.h stdio-lock.h
112     ;;
113   *-linux-gnu)
114     # We have a correct libc-lock.h in glibc 2.1 but not all glibc 2.0.
115     # Create a wrapper if necessary.
116     (echo "#include <bits/libc-lock.h>" | ${CC-cc} -E -) >/dev/null 2>&1 ||
117       {
118         echo "#include_next <libc-lock.h>" > libc-lock.h
119         echo 'asm (".weak _pthread_cleanup_pop_restore");' >> libc-lock.h
120         echo 'asm (".weak _pthread_cleanup_push_defer");' >> libc-lock.h
121
122       }
123     ;;
124 esac
125
126 for frag in ${frags}; do
127   case ${frag} in
128     ../* )
129       if [ ${srcdir} = . ]; then
130         [ -n "${with_target_subdir}" ] && frag=../${frag}
131         [ -n "${with_multisrctop}" ] && frag=${with_multisrctop}${frag}
132       fi
133       ;;
134   esac
135   frag=${srcdir}/config/$frag
136   if [ -f ${frag} ]; then
137     echo "Appending ${frag} to target-mkfrag"
138     echo "# Following fragment copied from ${frag}" >> temp.mt
139     cat ${frag} >> temp.mt
140   fi
141 done
142
143 target_makefile_frag=target-mkfrag
144 ${moveifchange} temp.mt target-mkfrag
145
146 LIBDIR=yes
147 TO_TOPDIR=../
148 ALL='$(_G_CONFIG_H) libio.a libiostream.a iostream.list'
149 case "${target}" in
150   *-*-cygwin32*)
151     XCINCLUDES='-I. -I$(srcdir) -I$(srcdir)/../winsup/include'
152     XCXXINCLUDES='-I. -I$(srcdir) -I$(srcdir)/../winsup/include'
153     ;;
154   *)
155     XCINCLUDES='-I. -I$(srcdir)'
156     XCXXINCLUDES='-I. -I$(srcdir)'
157     ;;
158 esac
159 MOSTLYCLEAN='*.o pic stamp-picdir core iostream.list'
160 DISTCLEAN='config.status Makefile *~ Make.pack target-mkfrag multilib.out'
161 CLEAN='_G_config.h *.a'
162 INFO_FILES=iostream
163 if [ -n "${with_cross_host}" -a -d ${topsrcdir}/gcc ]; then
164     CHECK_SUBDIRS=testsuite
165 fi
166 (. ${srcdir}/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
167
168 # post-target:
169
170 # If cross-compiling, we install in $(tooldir)/lib or in $(libsubdir)
171 # depending on --enable-version-specific-runtime-libs.
172 if [ -n "${with_cross_host}" ] ; then
173     rm -f Makefile.tem
174     sed \
175         -e 's|\(^[      ]*INSTALLDIR[   ]*=[    ]*\)\$(libdir)|\1$(tooldir)/lib|' \
176         Makefile >Makefile.tem
177     mv -f Makefile.tem Makefile
178 fi
179
180 . ${topsrcdir}/config-ml.in