OSDN Git Service

084e901aabf6243b63f46bfa90bc4d17353ab3bf
[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 # Note that if $norecursion is set we're being called from config.status,
22 # so don't check for the compiler; we might be doing a make clean.
23 compiler_name=cc1plus
24 rm -f skip-this-dir
25 if test -n "$r" && [ -z "$norecursion" ] ; then
26   if test -d "$r"/gcc; then
27     if test -f "$r"/gcc/$compiler_name \
28        || test -f "$r"/gcc/$compiler_name$EXEEXT; then
29       true
30     else
31       echo "rm -f multilib.out" > skip-this-dir
32     fi
33   fi
34 fi
35
36 if [ "${srcdir}" = "." ] ; then
37   if [ "${with_target_subdir}" != "." ] ; then
38     topsrcdir=${with_multisrctop}../..
39   else
40     topsrcdir=${with_multisrctop}..
41   fi
42 else
43   topsrcdir=${srcdir}/..
44 fi
45
46 if [ -d ${topsrcdir}/gcc ] ; then
47   configdirs="tests dbz stdio testsuite"
48 else
49   configdirs="tests dbz stdio"
50 fi
51 srctrigger=libioP.h
52 srcname="input/output library"
53 package_makefile_frag=Make.pack
54 package_makefile_rules_frag=Make.pack.r
55
56 # per-host:
57
58 # per-target:
59
60 echo "# Warning: this fragment is automatically generated" > temp.mt
61 frags=
62
63 case "${target}" in
64   *-hpux*)       frags=hpux.mt ;;
65   alpha*-*-linux-gnulibc1)
66                  frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
67   powerpc*-*-linux-gnulibc1)
68                  frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
69   *-linux-gnulibc1)
70                  frags=linuxlibc1.mt ;;
71   *-linux-gnu)   frags="linux.mt mtsafe.mt" ;;
72   *-sco3.2v[45]*)   frags=sco4.mt ;;
73   *-isc*)        frags=isc.mt ;;
74   *-netware*)    frags=netware.mt ;;
75   *)             frags=${target_cpu}.mt ;;
76 esac
77
78 case "${enable_shared}" in
79   yes) shared=yes ;;
80   no) shared=no ;;
81   *libio*) shared=yes ;;
82   *) shared=no ;;
83 esac
84
85 if [ "${shared}" = "yes" ]; then
86   case "${target}" in
87     alpha*-*-linux*)    frags="${frags} ../../config/mh-elfalphapic" ;;
88     arm*-*-*)           frags="${frags} ../../config/mh-armpic" ;;
89     hppa*-*-*)          frags="${frags} ../../config/mh-papic" ;;
90     i[3456]86-*-*)      frags="${frags} ../../config/mh-x86pic" ;;
91     powerpc*-*-aix*)    ;;
92     powerpc*-*-*)       frags="${frags} ../../config/mh-ppcpic" ;;
93     *-*-*)              frags="${frags} ../../config/mh-${target_cpu}pic" ;;
94   esac
95 fi
96
97 # Take care of header file lossage.
98 case "${target}" in
99   alpha*-*-linux-gnulibc1)
100     # For some reason stdio-lock.h is not installed on Red Hat systems.
101     # Further, libc-lock.h needs to define the pthreads stuff weak, and
102     # fails to do this for other than _LIBC.  Install our own versions
103     # of these files.
104     cp ${srcdir}/config/linuxaxp1-libc-lock.h libc-lock.h
105     cp ${srcdir}/config/linuxaxp1-stdio-lock.h stdio-lock.h
106     ;;
107   powerpc*-*-linux-gnulibc1)
108     # For some reason stdio-lock.h is not installed on Red Hat systems.
109     # Further, libc-lock.h needs to define the pthreads stuff weak, and
110     # fails to do this for other than _LIBC.  Install our own versions
111     # of these files.
112     cp ${srcdir}/config/linuxaxp1-libc-lock.h libc-lock.h
113     cp ${srcdir}/config/linuxaxp1-stdio-lock.h stdio-lock.h
114     ;;
115   *-linux-gnu)
116     # We have a correct libc-lock.h in glibc 2.1 but not all glibc 2.0.
117     # Create a wrapper if necessary.
118     (echo "#include <bits/libc-lock.h>" | ${CC-cc} -E -) >/dev/null 2>&1 ||
119       {
120         echo "#include_next <libc-lock.h>" > libc-lock.h
121         echo 'asm (".weak _pthread_cleanup_pop_restore");' >> libc-lock.h
122         echo 'asm (".weak _pthread_cleanup_push_defer");' >> libc-lock.h
123
124       }
125     ;;
126 esac
127
128 for frag in ${frags}; do
129   case ${frag} in
130     ../* )
131       if [ ${srcdir} = . ]; then
132         [ -n "${with_target_subdir}" ] && frag=../${frag}
133         [ -n "${with_multisrctop}" ] && frag=${with_multisrctop}${frag}
134       fi
135       ;;
136   esac
137   frag=${srcdir}/config/$frag
138   if [ -f ${frag} ]; then
139     echo "Appending ${frag} to target-mkfrag"
140     echo "# Following fragment copied from ${frag}" >> temp.mt
141     cat ${frag} >> temp.mt
142   fi
143 done
144
145 target_makefile_frag=target-mkfrag
146 ${moveifchange} temp.mt target-mkfrag
147
148 LIBDIR=yes
149 TO_TOPDIR=../
150 ALL='$(_G_CONFIG_H) libio.a libiostream.a iostream.list'
151 case "${target}" in
152   *-*-cygwin*)
153     XCINCLUDES='-I. -I$(srcdir) -I$(srcdir)/../winsup/include'
154     XCXXINCLUDES='-I. -I$(srcdir) -I$(srcdir)/../winsup/include'
155     ;;
156   *)
157     XCINCLUDES='-I. -I$(srcdir)'
158     XCXXINCLUDES='-I. -I$(srcdir)'
159     ;;
160 esac
161 MOSTLYCLEAN='*.o pic stamp-picdir core iostream.list'
162 DISTCLEAN='config.status Makefile *~ Make.pack target-mkfrag multilib.out'
163 CLEAN='_G_config.h *.a'
164 INFO_FILES=iostream
165 if [ -n "${with_cross_host}" -a -d ${topsrcdir}/gcc ]; then
166     CHECK_SUBDIRS=testsuite
167 fi
168 (. ${srcdir}/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
169
170 # post-target:
171
172 # If cross-compiling, we install in $(tooldir)/lib or in $(libsubdir)
173 # depending on --enable-version-specific-runtime-libs.
174 if [ -n "${with_cross_host}" ] ; then
175     rm -f Makefile.tem
176     sed \
177         -e 's|\(^[      ]*INSTALLDIR[   ]*=[    ]*\)\$(libdir)|\1$(tooldir)/lib|' \
178         Makefile >Makefile.tem
179     mv -f Makefile.tem Makefile
180 fi
181
182 . ${topsrcdir}/config-ml.in
183
184 gxx_include_dir=
185 # Specify the g++ header file directory
186 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
187 if test "${with_gxx_include_dir+set}" = set; then
188   withval="$with_gxx_include_dir"
189   case "${withval}" in
190     yes)
191       echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
192       exit 1
193       ;;
194     no) ;;
195     *)  gxx_include_dir=$with_gxx_include_dir ;;
196   esac
197 fi
198
199 if test x${gxx_include_dir} = x; then
200   if test x${enable_version_specific_runtime_libs} = xyes; then
201     gxx_include_dir='${libsubdir}/include/g++'
202   else
203     topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
204     gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
205   fi
206 fi
207
208 rm -f Makefile.tem
209 sed -e "s%^gxx_include_dir[     ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
210        Makefile >Makefile.tem
211 mv -f Makefile.tem Makefile