OSDN Git Service

* configure (gxx_include_dir): Removed.
[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 # find a possible extension of the just-built C++ compiler. Note that this
6 # is not the only choice, taking into cross and canadian cross into
7 # account, and we need to search for with and without the extension.
8 case "${host_alias}" in
9 *cygwin* | *mingw32*)
10   EXEEXT=.exe
11   ;;
12 *)
13   EXEEXT=
14   ;;
15 esac
16
17 # If the language specific compiler does not exist, but the "gcc" directory 
18 # does, we do not build anything. Note, $r is set by the top-level Makefile.
19 # Note that when we look for the compiler, we search both with and without
20 # extension to handle cross and canadian cross builds. 
21 compiler_name=cc1plus
22 rm -f skip-this-dir
23 if test -n "$r"; then
24   if test -d "$r"/gcc; then
25     if test -f "$r"/gcc/$compiler_name \
26        || test -f "$r"/gcc/$compiler_name$EXEEXT; then
27       true
28     else
29       echo "rm -f multilib.out" > skip-this-dir
30     fi
31   fi
32 fi
33
34 if [ "${srcdir}" = "." ] ; then
35   if [ "${with_target_subdir}" != "." ] ; then
36     topsrcdir=${with_multisrctop}../..
37   else
38     topsrcdir=${with_multisrctop}..
39   fi
40 else
41   topsrcdir=${srcdir}/..
42 fi
43
44 if [ -d ${topsrcdir}/gcc ] ; then
45   configdirs="tests testsuite"
46 else
47   configdirs="tests"
48 fi
49 srctrigger=sinst.cc
50 srcname="ANSI C++ library"
51 package_makefile_frag=Make.pack
52 package_makefile_rules_frag=Make.pack.r
53
54 # per-host:
55
56 # per-target:
57
58 echo "# Warning: this fragment is automatically generated" > temp.mt
59 frags=
60
61 # If they didn't specify --enable-shared, don't generate shared libs.
62 case "${enable_shared}" in
63   yes) shared=yes ;;
64   no) shared=no ;;
65   *libstdc++*) shared=yes ;;
66   *) shared=no ;;
67 esac
68
69 if [ "${shared}" = "yes" ]; then
70   case "${target}" in
71     alpha*-*-linux*)    frags=../../config/mh-elfalphapic ;;
72     arm*-*-*)           frags=../../config/mh-armpic ;;
73     hppa*-*-*)          frags=../../config/mh-papic ;;
74     i[3456]86-*-*)      frags=../../config/mh-x86pic ;;
75     powerpc*-*-aix*)    ;;
76     powerpc*-*-*)       frags=../../config/mh-ppcpic ;;
77     *-*-*)              frags=../../config/mh-${target_cpu}pic ;;
78   esac
79   case "${target}" in
80     *-dec-osf*)         frags="${frags} dec-osf.ml";;
81     *-*-hpux*)          frags="${frags} hpux.ml" ;;
82     *-*-irix[56]*)      frags="${frags} irix5.ml" ;;
83     *-*-linux*aout*)    ;;
84     *-*-freebsd2)       ;;
85     *-*-freebsd*)       frags="${frags} freebsd.ml" ;;
86     *-*-linux*)         frags="${frags} linux.ml" ;;
87     *-*-openbsd*)               frags="${frags} openbsd.ml" ;;
88     *-*-sysv[45]*|*-*-udk*)     frags="${frags} elf.ml" ;;
89     *-*-solaris*)       frags="${frags} sol2shm.ml" ;;
90     *-*-sunos4*)        frags="${frags} sunos4.ml" ;;
91     *-*-aix*)           frags="${frags} aix.ml" ;;
92     i[3456]86-*-interix*)       frags="${frags} x86-interix.ml" ;;
93   esac
94 fi
95
96 # Make sure the right flags are defined for multi-threading.
97 case "${target}" in
98   alpha*-*-linux-gnulibc1)      frags="${frags} linux.mt" ;;
99   powerpc*-*-linux-gnulibc1)    frags="${frags} linux.mt" ;;
100   *-*-linux-gnu)                frags="${frags} linux.mt" ;;
101   *-*-openbsd*)         
102         case "x${enable_threads}" in
103                 xyes|xposix)    frags="${frags} openbsd.mt" ;;
104         esac;;
105   m68k-motorola-sysv)           frags="${frags} delta.mt" ;;
106   *-*-solaris*)
107     case "x${enable_threads}" in
108       xposix)                   frags="${frags} sol2pth.mt" ;;
109       xsolaris)                 frags="${frags} sol2solth.mt" ;;
110     esac ;;
111   *)
112     case "x${enable_threads}" in
113       xposix)                   frags="${frags} posix.mt" ;;
114     esac ;;
115 esac
116
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
133
134 target_makefile_frag=target-mkfrag
135 ${moveifchange} temp.mt target-mkfrag
136
137 LIBDIR=yes
138 TO_TOPDIR=../
139 ALL='libs'
140 XCXXINCLUDES="-I${srcdir} -I${srcdir}/stl -I${TO_TOPDIR}libio -I${srcdir}/${TO_TOPDIR}libio"
141 MOSTLYCLEAN='*.o pic stamp-picdir core so_locations $(MOSTLYCLEAN_JUNK)'
142 CLEAN='$(CLEAN_JUNK)'
143 EXTRA_DISTCLEAN='target-mkfrag'
144
145 (. ${srcdir}/${TO_TOPDIR}libio/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
146
147 . ${topsrcdir}/config.if
148 echo "
149 LIBSTDCXX_INTERFACE=${libstdcxx_interface}
150 CXX_INTERFACE=${cxx_interface}
151 LIBC_INTERFACE=${libc_interface}
152 " >> ${package_makefile_frag}
153
154 # This duplicated the AC_PROG_LN_S macro in GNU autoconf.
155 rm -f conttestdata
156 if ln -s X conftestdata 2>/dev/null
157 then
158   rm -f conftestdata
159   LN_S="ln -s"
160 else
161   LN_S=ln
162 fi
163 echo "
164 LN_S=$LN_S
165 " >> ${package_makefile_frag}
166
167 # post-target:
168
169 # If cross-compiling, we install in $(tooldir)/lib or in $(libsubdir)
170 # depending on --enable-version-specific-runtime-libs.
171 if [ -n "${with_cross_host}" ] ; then
172     rm -f Makefile.tem
173     sed \
174         -e 's|^\([      ]*INSTALLDIR[   ]*=[    ]*\)\$(libdir)|\1$(tooldir)/lib|' \
175         Makefile >Makefile.tem
176     mv -f Makefile.tem Makefile
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