OSDN Git Service

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