configure (enable_version_specific_runtime_libs): Implement new flag --enable-version...
[gcc.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 if [ "${srcdir}" = "." ] ; then
6 if [ "${with_target_subdir}" != "." ] ; then
7 topsrcdir=${with_multisrctop}../..
8 else
9 topsrcdir=${with_multisrctop}..
10 fi
11 else
12 topsrcdir=${srcdir}/..
13 fi
14
15 if [ -d ${topsrcdir}/gcc ] ; then
16 configdirs="tests dbz stdio testsuite"
17 else
18 configdirs="tests dbz stdio"
19 fi
20 srctrigger=libioP.h
21 srcname="input/output library"
22 package_makefile_frag=Make.pack
23 package_makefile_rules_frag=Make.pack.r
24
25 # per-host:
26
27 # per-target:
28
29 echo "# Warning: this fragment is automatically generated" > temp.mt
30 frags=
31
32 case "${target}" in
33 *-hpux*) frags=hpux.mt ;;
34 alpha*-*-linux-gnulibc1)
35 frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
36 powerpc*-*-linux-gnulibc1)
37 frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
38 *-linux-gnulibc1)
39 frags=linuxlibc1.mt ;;
40 *-linux-gnu) frags="linux.mt mtsafe.mt" ;;
41 *-sco3.2v[45]*) frags=sco4.mt ;;
42 *-isc*) frags=isc.mt ;;
43 *-netware*) frags=netware.mt ;;
44 *) frags=${target_cpu}.mt ;;
45 esac
46
47 case "${enable_shared}" in
48 yes) shared=yes ;;
49 no) shared=no ;;
50 *libio*) shared=yes ;;
51 *) shared=no ;;
52 esac
53
54 if [ "${shared}" = "yes" ]; then
55 case "${target}" in
56 hppa*-*) frags="${frags} ../../config/mh-papic" ;;
57 i[3456]86-*) frags="${frags} ../../config/mh-x86pic" ;;
58 alpha*-*-linux*)
59 frags="${frags} ../../config/mh-elfalphapic" ;;
60 *) frags="${frags} ../../config/mh-${target_cpu}pic" ;;
61 esac
62 fi
63
64 # Take care of header file lossage.
65 case "${target}" in
66 alpha*-*-linux-gnulibc1)
67 # For some reason stdio-lock.h is not installed on Red Hat systems.
68 # Further, libc-lock.h needs to define the pthreads stuff weak, and
69 # fails to do this for other than _LIBC. Install our own versions
70 # of these files.
71 cp ${srcdir}/config/linuxaxp1-libc-lock.h libc-lock.h
72 cp ${srcdir}/config/linuxaxp1-stdio-lock.h stdio-lock.h
73 ;;
74 powerpc*-*-linux-gnulibc1)
75 # For some reason stdio-lock.h is not installed on Red Hat systems.
76 # Further, libc-lock.h needs to define the pthreads stuff weak, and
77 # fails to do this for other than _LIBC. Install our own versions
78 # of these files.
79 cp ${srcdir}/config/linuxaxp1-libc-lock.h libc-lock.h
80 cp ${srcdir}/config/linuxaxp1-stdio-lock.h stdio-lock.h
81 ;;
82 *-linux-gnu)
83 # We have a correct libc-lock.h in glibc 2.1 but not all glibc 2.0.
84 # Create a wrapper if necessary.
85 (echo "#include <bits/libc-lock.h>" | ${CC-cc} -E -) >/dev/null 2>&1 ||
86 {
87 echo "#include_next <libc-lock.h>" > libc-lock.h
88 echo 'asm (".weak _pthread_cleanup_pop_restore");' >> libc-lock.h
89 echo 'asm (".weak _pthread_cleanup_push_defer");' >> libc-lock.h
90
91 }
92 ;;
93 esac
94
95 for frag in ${frags}; do
96 case ${frag} in
97 ../* )
98 if [ ${srcdir} = . ]; then
99 [ -n "${with_target_subdir}" ] && frag=../${frag}
100 [ -n "${with_multisrctop}" ] && frag=${with_multisrctop}${frag}
101 fi
102 ;;
103 esac
104 frag=${srcdir}/config/$frag
105 if [ -f ${frag} ]; then
106 echo "Appending ${frag} to target-mkfrag"
107 echo "# Following fragment copied from ${frag}" >> temp.mt
108 cat ${frag} >> temp.mt
109 fi
110 done
111
112 target_makefile_frag=target-mkfrag
113 ${moveifchange} temp.mt target-mkfrag
114
115 LIBDIR=yes
116 TO_TOPDIR=../
117 ALL='$(_G_CONFIG_H) libio.a libiostream.a iostream.list'
118 case "${target}" in
119 *-*-cygwin32*)
120 XCINCLUDES='-I. -I$(srcdir) -I$(srcdir)/../winsup/include'
121 XCXXINCLUDES='-I. -I$(srcdir) -I$(srcdir)/../winsup/include'
122 ;;
123 *)
124 XCINCLUDES='-I. -I$(srcdir)'
125 XCXXINCLUDES='-I. -I$(srcdir)'
126 ;;
127 esac
128 MOSTLYCLEAN='*.o pic stamp-picdir core iostream.list'
129 DISTCLEAN='config.status Makefile *~ Make.pack target-mkfrag multilib.out'
130 CLEAN='_G_config.h *.a'
131 INFO_FILES=iostream
132 if [ -n "${with_cross_host}" -a -d ${topsrcdir}/gcc ]; then
133 CHECK_SUBDIRS=testsuite
134 fi
135 (. ${srcdir}/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
136
137 # post-target:
138
139 # If cross-compiling, don't build gperf or the utils. They
140 # will get built by the target compiler, which is confusing.
141 # We cannot test the installation. We install in $(tooldir).
142 if [ -n "${with_cross_host}" ] ; then
143 rm -f Makefile.tem
144 sed \
145 -e 's|INSTALLDIR.*=.*$|INSTALLDIR = $(tooldir)/lib|' \
146 Makefile >Makefile.tem
147 mv -f Makefile.tem Makefile
148 fi
149
150 . ${topsrcdir}/config-ml.in