OSDN Git Service

top level:
[pf3gnuchains/gcc-fork.git] / libstdc++ / 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 testsuite"
36 else
37   configdirs="tests"
38 fi
39 srctrigger=sinst.cc
40 srcname="ANSI C++ 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 # If they didn't specify --enable-shared, don't generate shared libs.
52 case "${enable_shared}" in
53   yes) shared=yes ;;
54   no) shared=no ;;
55   *libstdc++*) shared=yes ;;
56   *) shared=no ;;
57 esac
58
59 if [ "${shared}" = "yes" ]; then
60   case "${target}" in
61     alpha*-*-linux*)    frags=../../config/mh-elfalphapic ;;
62     arm*-*-*)           frags=../../config/mh-armpic ;;
63     hppa*-*-*)          frags=../../config/mh-papic ;;
64     i[3456]86-*-*)      frags=../../config/mh-x86pic ;;
65     powerpc*-*-aix*)    ;;
66     powerpc*-*-*)       frags=../../config/mh-ppcpic ;;
67     sparc*-*-*)         frags=../../config/mh-sparcpic ;;
68     *-*-*)              frags=../../config/mh-${target_cpu}pic ;;
69   esac
70   case "${target}" in
71     *-*-aix*)           frags="${frags} aix.ml" ;;
72     *-*-beos*)          frags="${frags} beos.ml" ;;
73     *-dec-osf*)         frags="${frags} dec-osf.ml";;
74     *-*-freebsd2*)      ;;
75     *-*-freebsd*)       frags="${frags} freebsd.ml" ;;
76     *-*-hpux*)          frags="${frags} hpux.ml" ;;
77     *-*-irix[56]*)      frags="${frags} irix5.ml" ;;
78     *-*-linux*aout*)    ;;
79     *-*-linux*)         frags="${frags} linux.ml" ;;
80     # This must come after *-*-linux*
81     *-*-gnu*)           frags="${frags} gnu.ml" ;;
82     *-*-openbsd*)               frags="${frags} openbsd.ml" ;;
83     *-*-sysv[45]*|*-*-udk*)     frags="${frags} elf.ml" ;;
84     *-*-solaris*)       frags="${frags} sol2shm.ml" ;;
85     *-*-sunos4*)        frags="${frags} sunos4.ml" ;;
86     i[3456]86-*-interix*)       frags="${frags} x86-interix.ml" ;;
87   esac
88 fi
89
90 # Make sure the right flags are defined for multi-threading.
91 case "${target}" in
92   *-*-linux*)
93         case "x${enable_threads}" in
94                 xyes|xposix)    frags="${frags} linux.mt" ;;
95         esac;;
96   *-*-openbsd*) 
97         case "x${enable_threads}" in
98                 xyes|xposix)    frags="${frags} openbsd.mt" ;;
99         esac;;
100   m68k-motorola-sysv)           frags="${frags} delta.mt" ;;
101   *-*-solaris*)
102     case "x${enable_threads}" in
103       xposix)                   frags="${frags} sol2pth.mt" ;;
104       xsolaris)                 frags="${frags} sol2solth.mt" ;;
105     esac ;;
106   *)
107     case "x${enable_threads}" in
108       xposix)                   frags="${frags} posix.mt" ;;
109     esac ;;
110 esac
111
112 for frag in ${frags}; do
113   case ${frag} in
114     ../* )
115       if [ ${srcdir} = . ]; then
116         [ -n "${with_target_subdir}" ] && frag=../${frag}
117         [ -n "${with_multisrctop}" ] && frag=${with_multisrctop}${frag}
118       fi
119       ;;
120   esac
121   frag=${srcdir}/config/$frag
122   if [ -f ${frag} ]; then
123     echo "Appending ${frag} to target-mkfrag"
124     echo "# Following fragment copied from ${frag}" >> temp.mt
125     cat ${frag} >> temp.mt
126   fi
127 done
128
129 target_makefile_frag=target-mkfrag
130 ${moveifchange} temp.mt target-mkfrag
131
132 LIBDIR=yes
133 TO_TOPDIR=../
134 ALL='libs'
135 XCXXINCLUDES="-I${srcdir} -I${srcdir}/stl -I${TO_TOPDIR}libio -I${srcdir}/${TO_TOPDIR}libio"
136 MOSTLYCLEAN='*.o pic stamp-picdir core so_locations $(MOSTLYCLEAN_JUNK)'
137 CLEAN='$(CLEAN_JUNK)'
138 EXTRA_DISTCLEAN='target-mkfrag'
139
140 (. ${srcdir}/${TO_TOPDIR}libio/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
141
142 . ${topsrcdir}/config.if
143 echo "
144 LIBSTDCXX_INTERFACE=${libstdcxx_interface}
145 CXX_INTERFACE=${cxx_interface}
146 LIBC_INTERFACE=${libc_interface}
147 " >> ${package_makefile_frag}
148
149 # This duplicated the AC_PROG_LN_S macro in GNU autoconf.
150 rm -f conttestdata
151 if ln -s X conftestdata 2>/dev/null
152 then
153   rm -f conftestdata
154   LN_S="ln -s"
155 else
156   LN_S=ln
157 fi
158 echo "
159 LN_S=$LN_S
160 " >> ${package_makefile_frag}
161
162 # post-target:
163
164 # If cross-compiling, we install in $(tooldir)/lib or in $(libsubdir)
165 # depending on --enable-version-specific-runtime-libs.
166 if [ -n "${with_cross_host}" ] ; then
167     rm -f Makefile.tem
168     sed \
169         -e 's|^\([      ]*INSTALLDIR[   ]*=[    ]*\)\$(libdir)|\1$(tooldir)/lib|' \
170         Makefile >Makefile.tem
171     mv -f Makefile.tem Makefile
172 fi
173
174 # enable multilib-ing by default.
175 if [ -z "${enable_multilib}" ]; then
176     enable_multilib=yes
177 fi
178
179 . ${topsrcdir}/config-ml.in
180
181 gxx_include_dir=
182 # Specify the g++ header file directory
183 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
184 if test "${with_gxx_include_dir+set}" = set; then
185   withval="$with_gxx_include_dir"
186   case "${withval}" in
187     yes)
188       echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
189       exit 1
190       ;;
191     no) ;;
192     *)  gxx_include_dir=$with_gxx_include_dir ;;
193   esac
194 fi
195
196 if test x${gxx_include_dir} = x; then
197   if test x${enable_version_specific_runtime_libs} = xyes; then
198     gxx_include_dir='${libsubdir}/include/g++'
199   else
200     gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
201   fi
202 fi
203
204 rm -f Makefile.tem
205 sed -e "s%^gxx_include_dir[     ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
206        Makefile >Makefile.tem
207 mv -f Makefile.tem Makefile