Thu Aug 12 10:14:47 1999 Andreas Schwab <schwab@suse.de>
[official-gcc.git] / libio / configure.in
blob36a90bf6d31a76280378c9a2e856d5e9df77e00f
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.
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
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}/..
34 if [ -d ${topsrcdir}/gcc ] ; then
35   configdirs="tests dbz stdio testsuite"
36 else
37   configdirs="tests dbz stdio"
39 srctrigger=libioP.h
40 srcname="input/output library"
41 package_makefile_frag=Make.pack
42 package_makefile_rules_frag=Make.pack.r
44 # per-host:
46 # per-target:
48 echo "# Warning: this fragment is automatically generated" > temp.mt
49 frags=
51 case "${target}" in
52   *-hpux*)       frags=hpux.mt ;;
53   alpha*-*-linux-gnulibc1)
54                  frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
55   powerpc*-*-linux-gnulibc1)
56                  frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
57   *-linux-gnulibc1)
58                  frags=linuxlibc1.mt ;;
59   *-linux-gnu)   frags="linux.mt mtsafe.mt" ;;
60   *-sco3.2v[45]*)   frags=sco4.mt ;;
61   *-isc*)        frags=isc.mt ;;
62   *-netware*)    frags=netware.mt ;;
63   *-dgux*)       frags=dgux.mt ;;
64   *)             frags=${target_cpu}.mt ;;
65 esac
67 case "${enable_shared}" in
68   yes) shared=yes ;;
69   no) shared=no ;;
70   *libio*) shared=yes ;;
71   *) shared=no ;;
72 esac
74 if [ "${shared}" = "yes" ]; then
75   case "${target}" in
76     alpha*-*-linux*)    frags="${frags} ../../config/mh-elfalphapic" ;;
77     arm*-*-*)           frags="${frags} ../../config/mh-armpic" ;;
78     hppa*-*-*)          frags="${frags} ../../config/mh-papic" ;;
79     i[3456]86-*-*)      frags="${frags} ../../config/mh-x86pic" ;;
80     powerpc*-*-aix*)    ;;
81     powerpc*-*-*)       frags="${frags} ../../config/mh-ppcpic" ;;
82     *-*-*)              frags="${frags} ../../config/mh-${target_cpu}pic" ;;
83   esac
86 # Take care of header file lossage.
87 case "${target}" in
88   alpha*-*-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   powerpc*-*-linux-gnulibc1)
97     # For some reason stdio-lock.h is not installed on Red Hat systems.
98     # Further, libc-lock.h needs to define the pthreads stuff weak, and
99     # fails to do this for other than _LIBC.  Install our own versions
100     # of these files.
101     cp ${srcdir}/config/linuxaxp1-libc-lock.h libc-lock.h
102     cp ${srcdir}/config/linuxaxp1-stdio-lock.h stdio-lock.h
103     ;;
104   *-linux-gnu)
105     # We have a correct libc-lock.h in glibc 2.1 but not all glibc 2.0.
106     # Create a wrapper if necessary.
107     (echo "#include <bits/libc-lock.h>" | ${CC-cc} -E -) >/dev/null 2>&1 ||
108       {
109         echo "#include_next <libc-lock.h>" > libc-lock.h
110         echo 'asm (".weak _pthread_cleanup_pop_restore");' >> libc-lock.h
111         echo 'asm (".weak _pthread_cleanup_push_defer");' >> libc-lock.h
113       }
114     ;;
115 esac
117 for frag in ${frags}; do
118   case ${frag} in
119     ../* )
120       if [ ${srcdir} = . ]; then
121         [ -n "${with_target_subdir}" ] && frag=../${frag}
122         [ -n "${with_multisrctop}" ] && frag=${with_multisrctop}${frag}
123       fi
124       ;;
125   esac
126   frag=${srcdir}/config/$frag
127   if [ -f ${frag} ]; then
128     echo "Appending ${frag} to target-mkfrag"
129     echo "# Following fragment copied from ${frag}" >> temp.mt
130     cat ${frag} >> temp.mt
131   fi
132 done
134 target_makefile_frag=target-mkfrag
135 ${moveifchange} temp.mt target-mkfrag
137 LIBDIR=yes
138 TO_TOPDIR=../
139 ALL='$(_G_CONFIG_H) libio.a libiostream.a iostream.list'
140 case "${target}" in
141   *-*-cygwin*)
142     XCINCLUDES='-I. -I$(srcdir) -I$(srcdir)/../winsup/include'
143     XCXXINCLUDES='-I. -I$(srcdir) -I$(srcdir)/../winsup/include'
144     ;;
145   *)
146     XCINCLUDES='-I. -I$(srcdir)'
147     XCXXINCLUDES='-I. -I$(srcdir)'
148     ;;
149 esac
150 MOSTLYCLEAN='*.o pic stamp-picdir core iostream.list'
151 DISTCLEAN='config.status Makefile *~ Make.pack target-mkfrag multilib.out'
152 CLEAN='_G_config.h *.a'
153 INFO_FILES=iostream
154 if [ -n "${with_cross_host}" -a -d ${topsrcdir}/gcc ]; then
155     CHECK_SUBDIRS=testsuite
157 (. ${srcdir}/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
159 # post-target:
161 # If cross-compiling, we install in $(tooldir)/lib or in $(libsubdir)
162 # depending on --enable-version-specific-runtime-libs.
163 if [ -n "${with_cross_host}" ] ; then
164     rm -f Makefile.tem
165     sed \
166         -e 's|\(^[      ]*INSTALLDIR[   ]*=[    ]*\)\$(libdir)|\1$(tooldir)/lib|' \
167         Makefile >Makefile.tem
168     mv -f Makefile.tem Makefile
171 . ${topsrcdir}/config-ml.in
173 gxx_include_dir=
174 # Specify the g++ header file directory
175 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
176 if test "${with_gxx_include_dir+set}" = set; then
177   withval="$with_gxx_include_dir"
178   case "${withval}" in
179     yes)
180       echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
181       exit 1
182       ;;
183     no) ;;
184     *)  gxx_include_dir=$with_gxx_include_dir ;;
185   esac
188 if test x${gxx_include_dir} = x; then
189   if test x${enable_version_specific_runtime_libs} = xyes; then
190     gxx_include_dir='${libsubdir}/include/g++'
191   else
192     . ${topsrcdir}/config.if
193     gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
194   fi
197 rm -f Makefile.tem
198 sed -e "s%^gxx_include_dir[     ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
199        Makefile >Makefile.tem
200 mv -f Makefile.tem Makefile