OSDN Git Service

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