OSDN Git Service

* gmon.c, i386/gmon-sol2.c, sparc/gmon-sol2.c: Remove advertising
[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 
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. 
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.
11 compiler_name=cc1plus
12 rm -f skip-this-dir
13 if test -n "$r" && [ -z "$norecursion" ] ; then
14   if test -d "$r"/gcc; then
15     if test -f "$r"/gcc/$compiler_name \
16        || test -f "$r"/gcc/$compiler_name.exe; then
17       true
18     else
19       echo "rm -f multilib.out" > skip-this-dir
20     fi
21   fi
22 fi
23
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
35   configdirs="tests dbz stdio testsuite"
36 else
37   configdirs="tests dbz stdio"
38 fi
39 srctrigger=libioP.h
40 srcname="input/output library"
41 package_makefile_frag=Make.pack
42 package_makefile_rules_frag=Make.pack.r
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
52   *-mpeix*)      frags="mpeix.mt" ;;
53   *-hpux*)       frags=hpux.mt ;;
54   alpha*-*-linux-gnulibc1)
55                  frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
56   powerpc*-*-linux-gnulibc1)
57                  frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
58   *-linux-gnulibc1)
59                  frags=linuxlibc1.mt ;;
60   *-linux-gnu)   frags="linux.mt mtsafe.mt" ;;
61   *-sco3.2v[45]*)   frags=sco4.mt ;;
62   *-isc*)        frags=isc.mt ;;
63   *-netware*)    frags=netware.mt ;;
64   *-dgux*)       frags=dgux.mt ;;
65   *vxworks*)     frags="vxworks.mt" ;;
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
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" ;;
85   esac
86 fi
87
88 # Take care of header file lossage.
89 case "${target}" in
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
97     ;;
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
105     ;;
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     ;;
117 esac
118
119 for frag in ${frags}; do
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
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=../
141 ALL='$(_G_CONFIG_H) libio.a libiostream.a iostream.list'
142 case "${target}" in
143   *-*-cygwin*)
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
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
156 if [ -n "${with_cross_host}" -a -d ${topsrcdir}/gcc ]; then
157     CHECK_SUBDIRS=testsuite
158 fi
159 (. ${srcdir}/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
160
161 # post-target:
162
163 # If cross-compiling, we install in $(tooldir)/lib or in $(libsubdir)
164 # depending on --enable-version-specific-runtime-libs.
165 if [ -n "${with_cross_host}" ] ; then
166     rm -f Makefile.tem
167     sed \
168         -e 's|\(^[      ]*INSTALLDIR[   ]*=[    ]*\)\$(libdir)|\1$(tooldir)/lib|' \
169         Makefile >Makefile.tem
170     mv -f Makefile.tem Makefile
171 fi
172
173 . ${topsrcdir}/config-ml.in
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
194     . ${topsrcdir}/config.if
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