| 1 | # Configure fragment invoked in the post-target section for subdirs
|
|---|
| 2 | # wanting multilib support.
|
|---|
| 3 | #
|
|---|
| 4 | # It is advisable to support a few --enable/--disable options to let the
|
|---|
| 5 | # user select which libraries s/he really wants.
|
|---|
| 6 | #
|
|---|
| 7 | # Subdirectories wishing to use multilib should put the following lines
|
|---|
| 8 | # in the "post-target" section of configure.in.
|
|---|
| 9 | #
|
|---|
| 10 | # if [ "${srcdir}" = "." ] ; then
|
|---|
| 11 | # if [ "${with_target_subdir}" != "." ] ; then
|
|---|
| 12 | # . ${with_multisrctop}../../config-ml.in
|
|---|
| 13 | # else
|
|---|
| 14 | # . ${with_multisrctop}../config-ml.in
|
|---|
| 15 | # fi
|
|---|
| 16 | # else
|
|---|
| 17 | # . ${srcdir}/../config-ml.in
|
|---|
| 18 | # fi
|
|---|
| 19 | #
|
|---|
| 20 | #
|
|---|
| 21 | # Things are complicated because 6 separate cases must be handled:
|
|---|
| 22 | # 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6.
|
|---|
| 23 | #
|
|---|
| 24 | # srcdir=. is special. It must handle make programs that don't handle VPATH.
|
|---|
| 25 | # To implement this, a symlink tree is built for each library and for each
|
|---|
| 26 | # multilib subdir.
|
|---|
| 27 | #
|
|---|
| 28 | # The build tree is layed out as
|
|---|
| 29 | #
|
|---|
| 30 | # ./
|
|---|
| 31 | # newlib
|
|---|
| 32 | # m68020/
|
|---|
| 33 | # newlib
|
|---|
| 34 | # m68881/
|
|---|
| 35 | # newlib
|
|---|
| 36 | #
|
|---|
| 37 | # The nice feature about this arrangement is that inter-library references
|
|---|
| 38 | # in the build tree work without having to care where you are. Note that
|
|---|
| 39 | # inter-library references also work in the source tree because symlink trees
|
|---|
| 40 | # are built when srcdir=.
|
|---|
| 41 | #
|
|---|
| 42 | # Unfortunately, trying to access the libraries in the build tree requires
|
|---|
| 43 | # the user to manually choose which library to use as GCC won't be able to
|
|---|
| 44 | # find the right one. This is viewed as the lesser of two evils.
|
|---|
| 45 | #
|
|---|
| 46 | # Configure variables:
|
|---|
| 47 | # ${with_target_subdir} = "." for native, or ${target_alias} for cross.
|
|---|
| 48 | # Set by top level Makefile.
|
|---|
| 49 | # ${with_multisrctop} = how many levels of multilibs there are in the source
|
|---|
| 50 | # tree. It exists to handle the case of configuring in the source tree:
|
|---|
| 51 | # ${srcdir} is not constant.
|
|---|
| 52 | # ${with_multisubdir} = name of multilib subdirectory (eg: m68020/m68881).
|
|---|
| 53 | #
|
|---|
| 54 | # Makefile variables:
|
|---|
| 55 | # MULTISRCTOP = number of multilib levels in source tree (+1 if cross)
|
|---|
| 56 | # (FIXME: note that this is different than ${with_multisrctop}. Check out.).
|
|---|
| 57 | # MULTIBUILDTOP = number of multilib levels in build tree
|
|---|
| 58 | # MULTIDIRS = list of multilib subdirs (eg: m68000 m68020 ...)
|
|---|
| 59 | # (only defined in each library's main Makefile).
|
|---|
| 60 | # MULTISUBDIR = installed subdirectory name with leading '/' (eg: /m68000)
|
|---|
| 61 | # (only defined in each multilib subdir).
|
|---|
| 62 |
|
|---|
| 63 | # FIXME: Multilib is currently disabled by default for everything other than
|
|---|
| 64 | # newlib. It is up to each target to turn on multilib support for the other
|
|---|
| 65 | # libraries as desired.
|
|---|
| 66 |
|
|---|
| 67 | # Autoconf incoming variables:
|
|---|
| 68 | # srcdir, host, ac_configure_args
|
|---|
| 69 | #
|
|---|
| 70 | # We *could* figure srcdir and host out, but we'd have to do work that
|
|---|
| 71 | # our caller has already done to figure them out and requiring these two
|
|---|
| 72 | # seems reasonable.
|
|---|
| 73 | # Note that `host' in this case is GCC's `target'. Target libraries are
|
|---|
| 74 | # configured for a particular host.
|
|---|
| 75 |
|
|---|
| 76 | Makefile=${ac_file-Makefile}
|
|---|
| 77 | ml_config_shell=${CONFIG_SHELL-/bin/sh}
|
|---|
| 78 | ml_arguments="${ac_configure_args}"
|
|---|
| 79 | ml_realsrcdir=${srcdir}
|
|---|
| 80 |
|
|---|
| 81 | # Scan all the arguments and set all the ones we need.
|
|---|
| 82 |
|
|---|
| 83 | ml_verbose=--verbose
|
|---|
| 84 | for option in ${ml_arguments}
|
|---|
| 85 | do
|
|---|
| 86 | case $option in
|
|---|
| 87 | --*) ;;
|
|---|
| 88 | -*) option=-$option ;;
|
|---|
| 89 | esac
|
|---|
| 90 |
|
|---|
| 91 | case $option in
|
|---|
| 92 | --*=*)
|
|---|
| 93 | optarg=`echo $option | sed -e 's/^[^=]*=//'`
|
|---|
| 94 | ;;
|
|---|
| 95 | esac
|
|---|
| 96 |
|
|---|
| 97 | case $option in
|
|---|
| 98 | --disable-*)
|
|---|
| 99 | enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
|
|---|
| 100 | eval $enableopt=no
|
|---|
| 101 | ;;
|
|---|
| 102 | --enable-*)
|
|---|
| 103 | case "$option" in
|
|---|
| 104 | *=*) ;;
|
|---|
| 105 | *) optarg=yes ;;
|
|---|
| 106 | esac
|
|---|
| 107 | enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
|
|---|
| 108 | eval $enableopt="$optarg"
|
|---|
| 109 | ;;
|
|---|
| 110 | --norecursion | --no*)
|
|---|
| 111 | ml_norecursion=yes
|
|---|
| 112 | ;;
|
|---|
| 113 | --silent | --sil* | --quiet | --q*)
|
|---|
| 114 | ml_verbose=--silent
|
|---|
| 115 | ;;
|
|---|
| 116 | --verbose | --v | --verb*)
|
|---|
| 117 | ml_verbose=--verbose
|
|---|
| 118 | ;;
|
|---|
| 119 | --with-*)
|
|---|
| 120 | case "$option" in
|
|---|
| 121 | *=*) ;;
|
|---|
| 122 | *) optarg=yes ;;
|
|---|
| 123 | esac
|
|---|
| 124 | withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
|
|---|
| 125 | eval $withopt="$optarg"
|
|---|
| 126 | ;;
|
|---|
| 127 | --without-*)
|
|---|
| 128 | withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
|
|---|
| 129 | eval $withopt=no
|
|---|
| 130 | ;;
|
|---|
| 131 | esac
|
|---|
| 132 | done
|
|---|
| 133 |
|
|---|
| 134 | # Only do this if --enable-multilib.
|
|---|
| 135 | if [ "${enable_multilib}" = yes ]; then
|
|---|
| 136 |
|
|---|
| 137 | # Compute whether this is the library's top level directory
|
|---|
| 138 | # (ie: not a multilib subdirectory, and not a subdirectory like newlib/src).
|
|---|
| 139 | # ${with_multisubdir} tells us we're in the right branch, but we could be
|
|---|
| 140 | # in a subdir of that.
|
|---|
| 141 | # ??? The previous version could void this test by separating the process into
|
|---|
| 142 | # two files: one that only the library's toplevel configure.in ran (to
|
|---|
| 143 | # configure the multilib subdirs), and another that all configure.in's ran to
|
|---|
| 144 | # update the Makefile. It seemed reasonable to collapse all multilib support
|
|---|
| 145 | # into one file, but it does leave us with having to perform this test.
|
|---|
| 146 | ml_toplevel_p=no
|
|---|
| 147 | if [ -z "${with_multisubdir}" ]; then
|
|---|
| 148 | if [ "${srcdir}" = "." ]; then
|
|---|
| 149 | # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
|
|---|
| 150 | # ${with_target_subdir} = "." for native, otherwise target alias.
|
|---|
| 151 | if [ "${with_target_subdir}" = "." ]; then
|
|---|
| 152 | if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
|
|---|
| 153 | ml_toplevel_p=yes
|
|---|
| 154 | fi
|
|---|
| 155 | else
|
|---|
| 156 | if [ -f ${ml_realsrcdir}/../../config-ml.in ]; then
|
|---|
| 157 | ml_toplevel_p=yes
|
|---|
| 158 | fi
|
|---|
| 159 | fi
|
|---|
| 160 | else
|
|---|
| 161 | # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
|
|---|
| 162 | if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
|
|---|
| 163 | ml_toplevel_p=yes
|
|---|
| 164 | fi
|
|---|
| 165 | fi
|
|---|
| 166 | fi
|
|---|
| 167 |
|
|---|
| 168 | # If this is the library's top level directory, set multidirs to the
|
|---|
| 169 | # multilib subdirs to support. This lives at the top because we need
|
|---|
| 170 | # `multidirs' set right away.
|
|---|
| 171 |
|
|---|
| 172 | if [ "${ml_toplevel_p}" = yes ]; then
|
|---|
| 173 |
|
|---|
| 174 | multidirs=
|
|---|
| 175 | for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
|
|---|
| 176 | dir=`echo $i | sed -e 's/;.*$//'`
|
|---|
| 177 | if [ "${dir}" = "." ]; then
|
|---|
| 178 | true
|
|---|
| 179 | else
|
|---|
| 180 | if [ -z "${multidirs}" ]; then
|
|---|
| 181 | multidirs="${dir}"
|
|---|
| 182 | else
|
|---|
| 183 | multidirs="${multidirs} ${dir}"
|
|---|
| 184 | fi
|
|---|
| 185 | fi
|
|---|
| 186 | done
|
|---|
| 187 |
|
|---|
| 188 | # Target libraries are configured for the host they run on, so we check
|
|---|
| 189 | # $host here, not $target.
|
|---|
| 190 |
|
|---|
| 191 | case "${host}" in
|
|---|
| 192 | arc-*-elf*)
|
|---|
| 193 | if [ x$enable_biendian != xyes ]
|
|---|
| 194 | then
|
|---|
| 195 | old_multidirs=${multidirs}
|
|---|
| 196 | multidirs=""
|
|---|
| 197 | for x in ${old_multidirs}; do
|
|---|
| 198 | case "${x}" in
|
|---|
| 199 | *be*) : ;;
|
|---|
| 200 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 201 | esac
|
|---|
| 202 | done
|
|---|
| 203 | fi
|
|---|
| 204 | ;;
|
|---|
| 205 | arm-*-*)
|
|---|
| 206 | if [ x"$enable_fpu" = xno ]
|
|---|
| 207 | then
|
|---|
| 208 | old_multidirs=${multidirs}
|
|---|
| 209 | multidirs=""
|
|---|
| 210 | for x in ${old_multidirs}; do
|
|---|
| 211 | case "${x}" in
|
|---|
| 212 | *fpu*) : ;;
|
|---|
| 213 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 214 | esac
|
|---|
| 215 | done
|
|---|
| 216 | fi
|
|---|
| 217 | if [ x"$enable_26bit" = xno ]
|
|---|
| 218 | then
|
|---|
| 219 | old_multidirs=${multidirs}
|
|---|
| 220 | multidirs=""
|
|---|
| 221 | for x in ${old_multidirs}; do
|
|---|
| 222 | case "${x}" in
|
|---|
| 223 | *26bit*) : ;;
|
|---|
| 224 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 225 | esac
|
|---|
| 226 | done
|
|---|
| 227 | fi
|
|---|
| 228 | if [ x"$enable_underscore" = xno ]
|
|---|
| 229 | then
|
|---|
| 230 | old_multidirs=${multidirs}
|
|---|
| 231 | multidirs=""
|
|---|
| 232 | for x in ${old_multidirs}; do
|
|---|
| 233 | case "${x}" in
|
|---|
| 234 | *under*) : ;;
|
|---|
| 235 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 236 | esac
|
|---|
| 237 | done
|
|---|
| 238 | fi
|
|---|
| 239 | if [ x"$enable_interwork" = xno ]
|
|---|
| 240 | then
|
|---|
| 241 | old_multidirs=${multidirs}
|
|---|
| 242 | multidirs=""
|
|---|
| 243 | for x in ${old_multidirs}; do
|
|---|
| 244 | case "${x}" in
|
|---|
| 245 | *interwork*) : ;;
|
|---|
| 246 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 247 | esac
|
|---|
| 248 | done
|
|---|
| 249 | fi
|
|---|
| 250 | if [ x$enable_biendian = xno ]
|
|---|
| 251 | then
|
|---|
| 252 | old_multidirs="${multidirs}"
|
|---|
| 253 | multidirs=""
|
|---|
| 254 | for x in ${old_multidirs}; do
|
|---|
| 255 | case "$x" in
|
|---|
| 256 | *le* ) : ;;
|
|---|
| 257 | *be* ) : ;;
|
|---|
| 258 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 259 | esac
|
|---|
| 260 | done
|
|---|
| 261 | fi
|
|---|
| 262 | if [ x"$enable_nofmult" = xno ]
|
|---|
| 263 | then
|
|---|
| 264 | old_multidirs="${multidirs}"
|
|---|
| 265 | multidirs=""
|
|---|
| 266 | for x in ${old_multidirs}; do
|
|---|
| 267 | case "$x" in
|
|---|
| 268 | *nofmult* ) : ;;
|
|---|
| 269 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 270 | esac
|
|---|
| 271 | done
|
|---|
| 272 | fi
|
|---|
| 273 | ;;
|
|---|
| 274 | m68*-*-*)
|
|---|
| 275 | if [ x$enable_softfloat = xno ]
|
|---|
| 276 | then
|
|---|
| 277 | old_multidirs="${multidirs}"
|
|---|
| 278 | multidirs=""
|
|---|
| 279 | for x in ${old_multidirs}; do
|
|---|
| 280 | case "$x" in
|
|---|
| 281 | *soft-float* ) : ;;
|
|---|
| 282 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 283 | esac
|
|---|
| 284 | done
|
|---|
| 285 | fi
|
|---|
| 286 | if [ x$enable_m68881 = xno ]
|
|---|
| 287 | then
|
|---|
| 288 | old_multidirs="${multidirs}"
|
|---|
| 289 | multidirs=""
|
|---|
| 290 | for x in ${old_multidirs}; do
|
|---|
| 291 | case "$x" in
|
|---|
| 292 | *m68881* ) : ;;
|
|---|
| 293 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 294 | esac
|
|---|
| 295 | done
|
|---|
| 296 | fi
|
|---|
| 297 | if [ x$enable_m68000 = xno ]
|
|---|
| 298 | then
|
|---|
| 299 | old_multidirs="${multidirs}"
|
|---|
| 300 | multidirs=""
|
|---|
| 301 | for x in ${old_multidirs}; do
|
|---|
| 302 | case "$x" in
|
|---|
| 303 | *m68000* ) : ;;
|
|---|
| 304 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 305 | esac
|
|---|
| 306 | done
|
|---|
| 307 | fi
|
|---|
| 308 | if [ x$enable_m68020 = xno ]
|
|---|
| 309 | then
|
|---|
| 310 | old_multidirs="${multidirs}"
|
|---|
| 311 | multidirs=""
|
|---|
| 312 | for x in ${old_multidirs}; do
|
|---|
| 313 | case "$x" in
|
|---|
| 314 | *m68020* ) : ;;
|
|---|
| 315 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 316 | esac
|
|---|
| 317 | done
|
|---|
| 318 | fi
|
|---|
| 319 | ;;
|
|---|
| 320 | mips*-*-*)
|
|---|
| 321 | if [ x$enable_single_float = xno ]
|
|---|
| 322 | then
|
|---|
| 323 | old_multidirs="${multidirs}"
|
|---|
| 324 | multidirs=""
|
|---|
| 325 | for x in ${old_multidirs}; do
|
|---|
| 326 | case "$x" in
|
|---|
| 327 | *single* ) : ;;
|
|---|
| 328 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 329 | esac
|
|---|
| 330 | done
|
|---|
| 331 | fi
|
|---|
| 332 | if [ x$enable_biendian = xno ]
|
|---|
| 333 | then
|
|---|
| 334 | old_multidirs="${multidirs}"
|
|---|
| 335 | multidirs=""
|
|---|
| 336 | for x in ${old_multidirs}; do
|
|---|
| 337 | case "$x" in
|
|---|
| 338 | *el* ) : ;;
|
|---|
| 339 | *eb* ) : ;;
|
|---|
| 340 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
| 341 | esac
|
|---|
| 342 | done
|
|---|
| 343 | fi
|
|---|
| 344 | if [ x$enable_softfloat = xno ]
|
|---|
| 345 | then
|
|---|
| 346 | old_multidirs="${multidirs}"
|
|---|
| 347 | multidirs=""
|
|---|
| 348 | for x in ${old_multidirs}; do
|
|---|
| 349 | case "$x" in
|
|---|
| 350 | *soft-float* ) : ;;
|
|---|
| 351 | *) multidirs="${multidirs} ${x}" ;;
|
|---|
|
|---|