]> gcc.gnu.org Git - gcc.git/blame - libio/configure.in
verify a file's existence before copying it
[gcc.git] / libio / configure.in
CommitLineData
6599da04
JM
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
763ecbbc
MK
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.
8case "${host_alias}" in
9*cygwin* | *mingw32*)
10 EXEEXT=.exe
11 ;;
12*)
13 EXEEXT=
14 ;;
15esac
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.
71205e0b
MH
21compiler_name=cc1plus
22rm -f skip-this-dir
23if test -n "$r"; then
24 if test -d "$r"/gcc; then
763ecbbc
MK
25 if test -f "$r"/gcc/$compiler_name \
26 || test -f "$r"/gcc/$compiler_name$EXEEXT; then
71205e0b
MH
27 true
28 else
29 echo "rm -f multilib.out" > skip-this-dir
30 fi
31 fi
32fi
33
4b52c114
L
34if [ "${srcdir}" = "." ] ; then
35 if [ "${with_target_subdir}" != "." ] ; then
36 topsrcdir=${with_multisrctop}../..
37 else
38 topsrcdir=${with_multisrctop}..
39 fi
40else
41 topsrcdir=${srcdir}/..
42fi
43
44if [ -d ${topsrcdir}/gcc ] ; then
af2de9e6
L
45 configdirs="tests dbz stdio testsuite"
46else
47 configdirs="tests dbz stdio"
48fi
6599da04
JM
49srctrigger=libioP.h
50srcname="input/output library"
51package_makefile_frag=Make.pack
c3880e45 52package_makefile_rules_frag=Make.pack.r
6599da04
JM
53
54# per-host:
55
56# per-target:
57
58echo "# Warning: this fragment is automatically generated" > temp.mt
59frags=
60
61case "${target}" in
62 *-hpux*) frags=hpux.mt ;;
20a2fbe2
RH
63 alpha*-*-linux-gnulibc1)
64 frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
65 powerpc*-*-linux-gnulibc1)
66 frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
e693cc28 67 *-linux-gnulibc1)
e693cc28 68 frags=linuxlibc1.mt ;;
d604f4c6 69 *-linux-gnu) frags="linux.mt mtsafe.mt" ;;
6599da04
JM
70 *-sco3.2v[45]*) frags=sco4.mt ;;
71 *-isc*) frags=isc.mt ;;
72 *-netware*) frags=netware.mt ;;
73 *) frags=${target_cpu}.mt ;;
74esac
75
76case "${enable_shared}" in
77 yes) shared=yes ;;
78 no) shared=no ;;
79 *libio*) shared=yes ;;
80 *) shared=no ;;
81esac
82
83if [ "${shared}" = "yes" ]; then
84 case "${target}" in
f24ab9a1
FS
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" ;;
6599da04
JM
92 esac
93fi
94
20a2fbe2 95# Take care of header file lossage.
e693cc28 96case "${target}" in
20a2fbe2
RH
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
e693cc28 104 ;;
20a2fbe2
RH
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
e693cc28 112 ;;
f49b1654
L
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 ;;
e693cc28
UD
124esac
125
6599da04 126for frag in ${frags}; do
e8919ca7
MH
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
6599da04
JM
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
141done
142
143target_makefile_frag=target-mkfrag
144${moveifchange} temp.mt target-mkfrag
145
146LIBDIR=yes
147TO_TOPDIR=../
dbfcb4be 148ALL='$(_G_CONFIG_H) libio.a libiostream.a iostream.list'
2b63596a 149case "${target}" in
8df1d91a 150 *-*-cygwin*)
2b63596a
JL
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 ;;
158esac
6599da04
JM
159MOSTLYCLEAN='*.o pic stamp-picdir core iostream.list'
160DISTCLEAN='config.status Makefile *~ Make.pack target-mkfrag multilib.out'
161CLEAN='_G_config.h *.a'
162INFO_FILES=iostream
4b52c114 163if [ -n "${with_cross_host}" -a -d ${topsrcdir}/gcc ]; then
6599da04
JM
164 CHECK_SUBDIRS=testsuite
165fi
c3880e45 166(. ${srcdir}/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
6599da04
JM
167
168# post-target:
169
842f5115
MH
170# If cross-compiling, we install in $(tooldir)/lib or in $(libsubdir)
171# depending on --enable-version-specific-runtime-libs.
6599da04
JM
172if [ -n "${with_cross_host}" ] ; then
173 rm -f Makefile.tem
174 sed \
842f5115 175 -e 's|\(^[ ]*INSTALLDIR[ ]*=[ ]*\)\$(libdir)|\1$(tooldir)/lib|' \
6599da04
JM
176 Makefile >Makefile.tem
177 mv -f Makefile.tem Makefile
178fi
179
4b52c114 180. ${topsrcdir}/config-ml.in
88101ab9
L
181
182gxx_include_dir=
183# Specify the g++ header file directory
184# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
185if test "${with_gxx_include_dir+set}" = set; then
186 withval="$with_gxx_include_dir"
187 case "${withval}" in
188 yes)
189 echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
190 exit 1
191 ;;
192 no) ;;
193 *) gxx_include_dir=$with_gxx_include_dir ;;
194 esac
195fi
196
197if test x${gxx_include_dir} = x; then
198 if test x${enable_version_specific_runtime_libs} = xyes; then
199 gxx_include_dir='${libsubdir}/include/g++'
200 else
201 topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
202 gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
203 fi
204fi
205
206rm -f Makefile.tem
207sed -e "s%^gxx_include_dir[ ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
208 Makefile >Makefile.tem
209mv -f Makefile.tem Makefile
This page took 0.130343 seconds and 5 git commands to generate.