comparison config-ml.in @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 1830386684a0
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 # Configure fragment invoked in the post-target section for subdirs 1 # Configure fragment invoked in the post-target section for subdirs
2 # wanting multilib support. 2 # wanting multilib support.
3 # 3 #
4 # Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4 # Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5 # 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. 5 # 2005, 2006, 2007, 2008, 2010, 2011, 2014 Free Software Foundation, Inc.
6 # 6 #
7 # This file is free software; you can redistribute it and/or modify 7 # This file is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by 8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or 9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version. 10 # (at your option) any later version.
29 29
30 # It is advisable to support a few --enable/--disable options to let the 30 # It is advisable to support a few --enable/--disable options to let the
31 # user select which libraries s/he really wants. 31 # user select which libraries s/he really wants.
32 # 32 #
33 # Subdirectories wishing to use multilib should put the following lines 33 # Subdirectories wishing to use multilib should put the following lines
34 # in the "post-target" section of configure.in. 34 # in the "post-target" section of configure.ac.
35 # 35 #
36 # if [ "${srcdir}" = "." ] ; then 36 # if [ "${srcdir}" = "." ] ; then
37 # if [ "${with_target_subdir}" != "." ] ; then 37 # if [ "${with_target_subdir}" != "." ] ; then
38 # . ${with_multisrctop}../../config-ml.in 38 # . ${with_multisrctop}../../config-ml.in
39 # else 39 # else
103 ml_config_shell=${CONFIG_SHELL-/bin/sh} 103 ml_config_shell=${CONFIG_SHELL-/bin/sh}
104 ml_realsrcdir=${srcdir} 104 ml_realsrcdir=${srcdir}
105 105
106 # Scan all the arguments and set all the ones we need. 106 # Scan all the arguments and set all the ones we need.
107 107
108 ml_verbose=--verbose 108 scan_arguments ()
109 for option in ${ac_configure_args} 109 {
110 do 110 ml_verbose=--verbose
111 # strip single quotes surrounding individual options 111 for option
112 case $option in 112 do
113 \'*\') eval option=$option ;; 113 # Strip single quotes surrounding individual options, that is, remove one
114 esac 114 # level of shell quoting for these.
115 115 case $option in
116 case $option in 116 \'*\') eval option=$option ;;
117 --*) ;; 117 esac
118 -*) option=-$option ;; 118
119 esac 119 case $option in
120 120 --*) ;;
121 case $option in 121 -*) option=-$option ;;
122 --*=*) 122 esac
123
124 case $option in
125 --*=*)
123 optarg=`echo $option | sed -e 's/^[^=]*=//'` 126 optarg=`echo $option | sed -e 's/^[^=]*=//'`
124 ;; 127 ;;
125 esac 128 esac
126 129
127 case $option in 130 case $option in
128 --disable-*) 131 --disable-*)
129 enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'` 132 enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
130 eval $enableopt=no 133 eval $enableopt=no
131 ;; 134 ;;
132 --enable-*) 135 --enable-*)
133 case "$option" in 136 case "$option" in
134 *=*) ;; 137 *=*) ;;
135 *) optarg=yes ;; 138 *) optarg=yes ;;
136 esac 139 esac
137 enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` 140 enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
138 # enable_shared and enable_static are handled by configure. 141 # enable_shared and enable_static are handled by configure.
139 # Don't undo its work. 142 # Don't undo its work.
140 case $enableopt in 143 case $enableopt in
141 enable_shared | enable_static) ;; 144 enable_shared | enable_static) ;;
142 *) eval $enableopt="$optarg" ;; 145 *) eval $enableopt='$optarg' ;;
143 esac 146 esac
144 ;; 147 ;;
145 --norecursion | --no-recursion) 148 --norecursion | --no-recursion)
146 ml_norecursion=yes 149 ml_norecursion=yes
147 ;; 150 ;;
148 --silent | --sil* | --quiet | --q*) 151 --silent | --sil* | --quiet | --q*)
149 ml_verbose=--silent 152 ml_verbose=--silent
150 ;; 153 ;;
151 --verbose | --v | --verb*) 154 --verbose | --v | --verb*)
152 ml_verbose=--verbose 155 ml_verbose=--verbose
153 ;; 156 ;;
154 --with-*) 157 --with-*)
155 case "$option" in 158 case "$option" in
156 *=*) ;; 159 *=*) ;;
157 *) optarg=yes ;; 160 *) optarg=yes ;;
158 esac 161 esac
159 withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` 162 withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
160 eval $withopt="$optarg" 163 eval $withopt='$optarg'
161 ;; 164 ;;
162 --without-*) 165 --without-*)
163 withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'` 166 withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
164 eval $withopt=no 167 eval $withopt=no
165 ;; 168 ;;
166 esac 169 esac
167 done 170 done
171 }
172 # Use eval to properly handle configure arguments such as
173 # --enable-foo='--enable-a=1 --enable-b=2 --enable-c=3'.
174 eval scan_arguments "${ac_configure_args}"
175 unset scan_arguments
168 176
169 # Only do this if --enable-multilib. 177 # Only do this if --enable-multilib.
170 if [ "${enable_multilib}" = yes ]; then 178 if [ "${enable_multilib}" = yes ]; then
171 179
172 # Compute whether this is the library's top level directory 180 # Compute whether this is the library's top level directory
173 # (ie: not a multilib subdirectory, and not a subdirectory like newlib/src). 181 # (ie: not a multilib subdirectory, and not a subdirectory like newlib/src).
174 # ${with_multisubdir} tells us we're in the right branch, but we could be 182 # ${with_multisubdir} tells us we're in the right branch, but we could be
175 # in a subdir of that. 183 # in a subdir of that.
176 # ??? The previous version could void this test by separating the process into 184 # ??? The previous version could void this test by separating the process into
177 # two files: one that only the library's toplevel configure.in ran (to 185 # two files: one that only the library's toplevel configure.ac ran (to
178 # configure the multilib subdirs), and another that all configure.in's ran to 186 # configure the multilib subdirs), and another that all configure.ac's ran to
179 # update the Makefile. It seemed reasonable to collapse all multilib support 187 # update the Makefile. It seemed reasonable to collapse all multilib support
180 # into one file, but it does leave us with having to perform this test. 188 # into one file, but it does leave us with having to perform this test.
181 ml_toplevel_p=no 189 ml_toplevel_p=no
182 if [ -z "${with_multisubdir}" ]; then 190 if [ -z "${with_multisubdir}" ]; then
183 if [ "${srcdir}" = "." ]; then 191 if [ "${srcdir}" = "." ]; then
222 230
223 # Target libraries are configured for the host they run on, so we check 231 # Target libraries are configured for the host they run on, so we check
224 # $host here, not $target. 232 # $host here, not $target.
225 233
226 case "${host}" in 234 case "${host}" in
227 arc-*-elf*)
228 if [ x$enable_biendian != xyes ]
229 then
230 old_multidirs=${multidirs}
231 multidirs=""
232 for x in ${old_multidirs}; do
233 case "${x}" in
234 *be*) : ;;
235 *) multidirs="${multidirs} ${x}" ;;
236 esac
237 done
238 fi
239 ;;
240 arm-*-*) 235 arm-*-*)
241 if [ x"$enable_fpu" = xno ] 236 if [ x"$enable_fpu" = xno ]
242 then 237 then
243 old_multidirs=${multidirs} 238 old_multidirs=${multidirs}
244 multidirs="" 239 multidirs=""
514 FCFLAGS="$(FCFLAGS) $${flags}" \ 509 FCFLAGS="$(FCFLAGS) $${flags}" \
515 FFLAGS="$(FFLAGS) $${flags}" \ 510 FFLAGS="$(FFLAGS) $${flags}" \
516 ADAFLAGS="$(ADAFLAGS) $${flags}" \ 511 ADAFLAGS="$(ADAFLAGS) $${flags}" \
517 prefix="$(prefix)" \ 512 prefix="$(prefix)" \
518 exec_prefix="$(exec_prefix)" \ 513 exec_prefix="$(exec_prefix)" \
519 GCJFLAGS="$(GCJFLAGS) $${flags}" \
520 GOCFLAGS="$(GOCFLAGS) $${flags}" \ 514 GOCFLAGS="$(GOCFLAGS) $${flags}" \
521 CXXFLAGS="$(CXXFLAGS) $${flags}" \ 515 CXXFLAGS="$(CXXFLAGS) $${flags}" \
522 LIBCFLAGS="$(LIBCFLAGS) $${flags}" \ 516 LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
523 LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \ 517 LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
524 LDFLAGS="$(LDFLAGS) $${flags}" \ 518 LDFLAGS="$(LDFLAGS) $${flags}" \
749 if [ "${dir}" = "${ml_dir}" ]; then 743 if [ "${dir}" = "${ml_dir}" ]; then
750 flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'` 744 flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`
751 break 745 break
752 fi 746 fi
753 done 747 done
754 ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags" GOC="${GOC_}$flags"' 748 ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GFORTRAN="${GFORTRAN_}$flags" GOC="${GOC_}$flags"'
755 749
756 if [ "${with_target_subdir}" = "." ]; then 750 if [ "${with_target_subdir}" = "." ]; then
757 CC_=$CC' ' 751 CC_=$CC' '
758 CXX_=$CXX' ' 752 CXX_=$CXX' '
759 F77_=$F77' ' 753 F77_=$F77' '
760 GCJ_=$GCJ' '
761 GFORTRAN_=$GFORTRAN' ' 754 GFORTRAN_=$GFORTRAN' '
762 GOC_=$GOC' ' 755 GOC_=$GOC' '
763 else 756 else
764 # Create a regular expression that matches any string as long 757 # Create a regular expression that matches any string as long
765 # as ML_POPDIR. 758 # as ML_POPDIR.
798 *) 791 *)
799 F77_="${F77_}${arg} " ;; 792 F77_="${F77_}${arg} " ;;
800 esac 793 esac
801 done 794 done
802 795
803 GCJ_=
804 for arg in ${GCJ}; do
805 case $arg in
806 -[BIL]"${ML_POPDIR}"/*)
807 GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
808 "${ML_POPDIR}"/*)
809 GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
810 *)
811 GCJ_="${GCJ_}${arg} " ;;
812 esac
813 done
814
815 GFORTRAN_= 796 GFORTRAN_=
816 for arg in ${GFORTRAN}; do 797 for arg in ${GFORTRAN}; do
817 case $arg in 798 case $arg in
818 -[BIL]"${ML_POPDIR}"/*) 799 -[BIL]"${ML_POPDIR}"/*)
819 GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; 800 GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
871 fi 852 fi
872 fi 853 fi
873 854
874 if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \ 855 if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
875 --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \ 856 --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
876 ${ac_configure_args} ${ml_config_env} ${ml_srcdiroption} ; then 857 "${ac_configure_args}" ${ml_config_env} ${ml_srcdiroption} ; then
877 true 858 true
878 else 859 else
879 exit 1 860 exit 1
880 fi 861 fi
881 862