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