| 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-*)
|
|---|
|
|---|