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