configure.ac 115 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679
  1. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
  2. # 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
  3. # 2014, 2015, 2016, 2019, 2020 Free Software Foundation, Inc.
  4. #
  5. # This file is free software; you can redistribute it and/or modify it
  6. # under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; see the file COPYING3. If not see
  17. # <http://www.gnu.org/licenses/>.
  18. ##############################################################################
  19. ### WARNING: this file contains embedded tabs. Do not run untabify on this file.
  20. m4_include(config/acx.m4)
  21. m4_include(config/override.m4)
  22. m4_include(config/proginstall.m4)
  23. m4_include(config/elf.m4)
  24. m4_include(config/gcc-plugin.m4)
  25. m4_include([libtool.m4])
  26. m4_include([ltoptions.m4])
  27. m4_include([ltsugar.m4])
  28. m4_include([ltversion.m4])
  29. m4_include([lt~obsolete.m4])
  30. m4_include([config/isl.m4])
  31. AC_INIT(move-if-change)
  32. AC_DISABLE_OPTION_CHECKING
  33. progname=$0
  34. # if PWD already has a value, it is probably wrong.
  35. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
  36. # Export original configure arguments for use by sub-configures.
  37. # Quote arguments with shell meta charatcers.
  38. TOPLEVEL_CONFIGURE_ARGUMENTS=
  39. set -- "$progname" "$@"
  40. for ac_arg
  41. do
  42. case "$ac_arg" in
  43. *" "*|*" "*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*)
  44. ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
  45. # if the argument is of the form -foo=baz, quote the baz part only
  46. ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9]]*=\)/\\1'/"` ;;
  47. *) ;;
  48. esac
  49. # Add the quoted argument to the list.
  50. TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg"
  51. done
  52. if test "$silent" = yes; then
  53. TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS --silent"
  54. fi
  55. # Remove the initial space we just introduced and, as these will be
  56. # expanded by make, quote '$'.
  57. TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
  58. AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)
  59. # Find the build, host, and target systems.
  60. ACX_NONCANONICAL_BUILD
  61. ACX_NONCANONICAL_HOST
  62. ACX_NONCANONICAL_TARGET
  63. dnl Autoconf 2.5x and later will set a default program prefix if
  64. dnl --target was used, even if it was the same as --host. Disable
  65. dnl that behavior. This must be done before AC_CANONICAL_SYSTEM
  66. dnl to take effect.
  67. test "$host_noncanonical" = "$target_noncanonical" &&
  68. test "$program_prefix$program_suffix$program_transform_name" = \
  69. NONENONEs,x,x, &&
  70. program_transform_name=s,y,y,
  71. AC_CANONICAL_SYSTEM
  72. AC_ARG_PROGRAM
  73. m4_pattern_allow([^AS_FOR_TARGET$])dnl
  74. m4_pattern_allow([^AS_FOR_BUILD$])dnl
  75. # Get 'install' or 'install-sh' and its variants.
  76. AC_PROG_INSTALL
  77. ACX_PROG_LN
  78. AC_PROG_LN_S
  79. AC_PROG_SED
  80. AC_PROG_AWK
  81. srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
  82. # We pass INSTALL explicitly to sub-makes. Make sure that it is not
  83. # a relative path.
  84. if test "$INSTALL" = "${srcdir}/install-sh -c"; then
  85. INSTALL="${srcpwd}/install-sh -c"
  86. fi
  87. # Set srcdir to "." if that's what it is.
  88. # This is important for multilib support.
  89. pwd=`${PWDCMD-pwd}`
  90. if test "${pwd}" = "${srcpwd}" ; then
  91. srcdir=.
  92. fi
  93. topsrcdir=$srcpwd
  94. extra_host_args=
  95. ### To add a new directory to the tree, first choose whether it is a target
  96. ### or a host dependent tool. Then put it into the appropriate list
  97. ### (library or tools, host or target), doing a dependency sort.
  98. # Subdirs will be configured in the order listed in build_configdirs,
  99. # configdirs, or target_configdirs; see the serialization section below.
  100. # Dependency sorting is only needed when *configuration* must be done in
  101. # a particular order. In all cases a dependency should be specified in
  102. # the Makefile, whether or not it's implicitly specified here.
  103. # Double entries in build_configdirs, configdirs, or target_configdirs may
  104. # cause circular dependencies and break everything horribly.
  105. # these library is used by various programs built for the build
  106. # environment
  107. #
  108. build_libs="build-libiberty build-libcpp"
  109. # these tools are built for the build environment
  110. build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"
  111. # these libraries are used by various programs built for the host environment
  112. #f
  113. host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl libelf libiconv libctf"
  114. # these tools are built for the host environment
  115. # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
  116. # know that we are building the simulator.
  117. # binutils, gas and ld appear in that order because it makes sense to run
  118. # "make check" in that particular order.
  119. # If --enable-gold is used, "gold" may replace "ld".
  120. host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
  121. # these libraries are built for the target environment, and are built after
  122. # the host libraries and the host tools (which may be a cross compiler)
  123. # Note that libiberty is not a target library.
  124. target_libraries="target-libgcc \
  125. target-libbacktrace \
  126. target-libgloss \
  127. target-newlib \
  128. target-libgomp \
  129. target-liboffloadmic \
  130. target-libhsail-rt \
  131. target-libatomic \
  132. target-libitm \
  133. target-libstdc++-v3 \
  134. target-libsanitizer \
  135. target-libvtv \
  136. target-libssp \
  137. target-libquadmath \
  138. target-libgfortran \
  139. target-libffi \
  140. target-libobjc \
  141. target-libada \
  142. target-libgo"
  143. # these tools are built using the target libraries, and are intended to
  144. # run only in the target environment
  145. #
  146. # note: any program that *uses* libraries that are in the "target_libraries"
  147. # list belongs in this list.
  148. #
  149. target_tools="target-rda"
  150. ################################################################################
  151. ## All tools belong in one of the four categories, and are assigned above
  152. ## We assign ${configdirs} this way to remove all embedded newlines. This
  153. ## is important because configure will choke if they ever get through.
  154. ## ${configdirs} is directories we build using the host tools.
  155. ## ${target_configdirs} is directories we build using the target tools.
  156. configdirs=`echo ${host_libs} ${host_tools}`
  157. target_configdirs=`echo ${target_libraries} ${target_tools}`
  158. build_configdirs=`echo ${build_libs} ${build_tools}`
  159. m4_divert_text([PARSE_ARGS],
  160. [case $srcdir in
  161. *" "*)
  162. m4_pushdef([AS_MESSAGE_LOG_FD], [])dnl
  163. AC_MSG_ERROR([path to source, $srcdir, contains spaces])
  164. m4_popdef([AS_MESSAGE_LOG_FD])dnl
  165. ;;
  166. esac
  167. ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
  168. ])
  169. ################################################################################
  170. srcname="gnu development package"
  171. # This gets set non-empty for some net releases of packages.
  172. appdirs=""
  173. # Define is_cross_compiler to save on calls to 'test'.
  174. is_cross_compiler=
  175. if test x"${host}" = x"${target}" ; then
  176. is_cross_compiler=no
  177. else
  178. is_cross_compiler=yes
  179. fi
  180. # Find the build and target subdir names.
  181. GCC_TOPLEV_SUBDIRS
  182. # Be sure to cover against remnants of an in-tree build.
  183. if test $srcdir != . && test -d $srcdir/host-${host_noncanonical}; then
  184. AC_MSG_ERROR([building out of tree but $srcdir contains host-${host_noncanonical}.
  185. Use a pristine source tree when building in a separate tree])
  186. fi
  187. # Skipdirs are removed silently.
  188. skipdirs=
  189. # Noconfigdirs are removed loudly.
  190. noconfigdirs=""
  191. use_gnu_ld=
  192. # Make sure we don't let GNU ld be added if we didn't want it.
  193. if test x$with_gnu_ld = xno ; then
  194. use_gnu_ld=no
  195. noconfigdirs="$noconfigdirs ld gold"
  196. fi
  197. use_gnu_as=
  198. # Make sure we don't let GNU as be added if we didn't want it.
  199. if test x$with_gnu_as = xno ; then
  200. use_gnu_as=no
  201. noconfigdirs="$noconfigdirs gas"
  202. fi
  203. use_included_zlib=
  204. AC_ARG_WITH(system-zlib,
  205. [AS_HELP_STRING([--with-system-zlib], [use installed libz])])
  206. # Make sure we don't let ZLIB be added if we didn't want it.
  207. if test x$with_system_zlib = xyes ; then
  208. use_included_zlib=no
  209. noconfigdirs="$noconfigdirs zlib"
  210. fi
  211. # Don't compile the bundled readline/libreadline.a if --with-system-readline
  212. # is provided.
  213. if test x$with_system_readline = xyes ; then
  214. noconfigdirs="$noconfigdirs readline"
  215. fi
  216. # some tools are so dependent upon X11 that if we're not building with X,
  217. # it's not even worth trying to configure, much less build, that tool.
  218. case ${with_x} in
  219. yes | "") ;; # the default value for this tree is that X11 is available
  220. no)
  221. skipdirs="${skipdirs} tk itcl libgui"
  222. # We won't be able to build gdbtk without X.
  223. enable_gdbtk=no
  224. ;;
  225. *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
  226. esac
  227. # Some are only suitable for cross toolchains.
  228. # Remove these if host=target.
  229. cross_only="target-libgloss target-newlib target-opcodes"
  230. case $is_cross_compiler in
  231. no) skipdirs="${skipdirs} ${cross_only}" ;;
  232. esac
  233. # If both --with-headers and --with-libs are specified, default to
  234. # --without-newlib.
  235. if test x"${with_headers}" != x && test x"${with_headers}" != xno \
  236. && test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
  237. if test x"${with_newlib}" = x ; then
  238. with_newlib=no
  239. fi
  240. fi
  241. # Recognize --with-newlib/--without-newlib.
  242. case ${with_newlib} in
  243. no) skipdirs="${skipdirs} target-newlib" ;;
  244. yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
  245. esac
  246. AC_ARG_ENABLE(as-accelerator-for,
  247. [AS_HELP_STRING([--enable-as-accelerator-for=ARG],
  248. [build as offload target compiler.
  249. Specify offload host triple by ARG])])
  250. AC_ARG_ENABLE(offload-targets,
  251. [AS_HELP_STRING([--enable-offload-targets=LIST],
  252. [enable offloading to devices from comma-separated LIST of
  253. TARGET[=DIR]. Use optional path to find offload target compiler
  254. during the build])],
  255. [
  256. if test x"$enable_offload_targets" = x; then
  257. AC_MSG_ERROR([no offload targets specified])
  258. fi
  259. ], [enable_offload_targets=])
  260. # Handle --enable-gold, --enable-ld.
  261. # --disable-gold [--enable-ld]
  262. # Build only ld. Default option.
  263. # --enable-gold [--enable-ld]
  264. # Build both gold and ld. Install gold as "ld.gold", install ld
  265. # as "ld.bfd" and "ld".
  266. # --enable-gold=default [--enable-ld]
  267. # Build both gold and ld. Install gold as "ld.gold" and "ld",
  268. # install ld as "ld.bfd".
  269. # --enable-gold[=default] --disable-ld
  270. # Build only gold, which is then installed as both "ld.gold" and "ld".
  271. # --enable-gold --enable-ld=default
  272. # Build both gold (installed as "ld.gold") and ld (installed as "ld"
  273. # and ld.bfd).
  274. # In other words, ld is default
  275. # --enable-gold=default --enable-ld=default
  276. # Error.
  277. default_ld=
  278. AC_ARG_ENABLE(gold,
  279. [AS_HELP_STRING([[--enable-gold[=ARG]]],
  280. [build gold @<:@ARG={default,yes,no}@:>@])],
  281. ENABLE_GOLD=$enableval,
  282. ENABLE_GOLD=no)
  283. case "${ENABLE_GOLD}" in
  284. yes|default)
  285. # Check for ELF target.
  286. is_elf=no
  287. case "${target}" in
  288. *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
  289. | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
  290. | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
  291. | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-haiku*)
  292. case "${target}" in
  293. *-*-linux*aout* | *-*-linux*oldld*)
  294. ;;
  295. *)
  296. is_elf=yes
  297. ;;
  298. esac
  299. esac
  300. if test "$is_elf" = "yes"; then
  301. # Check for target supported by gold.
  302. case "${target}" in
  303. i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \
  304. | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-*)
  305. configdirs="$configdirs gold"
  306. if test x${ENABLE_GOLD} = xdefault; then
  307. default_ld=gold
  308. fi
  309. ENABLE_GOLD=yes
  310. ;;
  311. esac
  312. fi
  313. ;;
  314. no)
  315. ;;
  316. *)
  317. AC_MSG_ERROR([invalid --enable-gold argument])
  318. ;;
  319. esac
  320. AC_ARG_ENABLE(ld,
  321. [AS_HELP_STRING([[--enable-ld[=ARG]]],
  322. [build ld @<:@ARG={default,yes,no}@:>@])],
  323. ENABLE_LD=$enableval,
  324. ENABLE_LD=yes)
  325. case "${ENABLE_LD}" in
  326. default)
  327. if test x${default_ld} != x; then
  328. AC_MSG_ERROR([either gold or ld can be the default ld])
  329. fi
  330. ;;
  331. yes)
  332. ;;
  333. no)
  334. if test x${ENABLE_GOLD} != xyes; then
  335. AC_MSG_WARN([neither ld nor gold are enabled])
  336. fi
  337. configdirs=`echo " ${configdirs} " | sed -e 's/ ld / /'`
  338. ;;
  339. *)
  340. AC_MSG_ERROR([invalid --enable-ld argument])
  341. ;;
  342. esac
  343. AC_ARG_ENABLE(gprofng,
  344. [AS_HELP_STRING([[--enable-gprofng[=ARG]]],
  345. [build gprofng @<:@ARG={yes,no}@:>@])],
  346. enable_gprofng=$enableval,
  347. enable_gprofng=yes)
  348. if test "$enable_gprofng" = "yes"; then
  349. case "${target}" in
  350. x86_64-*-linux* | i?86-*-linux* | aarch64-*-linux*)
  351. configdirs="$configdirs gprofng"
  352. ;;
  353. esac
  354. fi
  355. # PR gas/19109
  356. # Decide the default method for compressing debug sections.
  357. # Provide a configure time option to override our default.
  358. AC_ARG_ENABLE(compressed_debug_sections,
  359. [AS_HELP_STRING([--enable-compressed-debug-sections={all,gas,gold,ld,none}],
  360. [Enable compressed debug sections for gas, gold or ld by
  361. default])],
  362. [
  363. if test x"$enable_compressed_debug_sections" = xyes; then
  364. AC_MSG_ERROR([no program with compressed debug sections specified])
  365. fi
  366. ], [enable_compressed_debug_sections=])
  367. # Configure extra directories which are host specific
  368. case "${host}" in
  369. *-cygwin*)
  370. configdirs="$configdirs libtermcap" ;;
  371. esac
  372. # A target can indicate whether a language isn't supported for some reason.
  373. # Only spaces may be used in this macro; not newlines or tabs.
  374. unsupported_languages=
  375. # Remove more programs from consideration, based on the host or
  376. # target this usually means that a port of the program doesn't
  377. # exist yet.
  378. case "${host}" in
  379. i[[3456789]]86-*-msdosdjgpp*)
  380. noconfigdirs="$noconfigdirs tcl tk itcl"
  381. ;;
  382. esac
  383. AC_ARG_ENABLE(libquadmath,
  384. AS_HELP_STRING([--disable-libquadmath],
  385. [do not build libquadmath directory]),
  386. ENABLE_LIBQUADMATH=$enableval,
  387. ENABLE_LIBQUADMATH=yes)
  388. if test "${ENABLE_LIBQUADMATH}" = "no" ; then
  389. noconfigdirs="$noconfigdirs target-libquadmath"
  390. fi
  391. AC_ARG_ENABLE(libquadmath-support,
  392. AS_HELP_STRING([--disable-libquadmath-support],
  393. [disable libquadmath support for Fortran]),
  394. ENABLE_LIBQUADMATH_SUPPORT=$enableval,
  395. ENABLE_LIBQUADMATH_SUPPORT=yes)
  396. enable_libquadmath_support=
  397. if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
  398. enable_libquadmath_support=no
  399. fi
  400. AC_ARG_ENABLE(libada,
  401. [AS_HELP_STRING([--enable-libada], [build libada directory])],
  402. ENABLE_LIBADA=$enableval,
  403. ENABLE_LIBADA=yes)
  404. if test "${ENABLE_LIBADA}" != "yes" ; then
  405. noconfigdirs="$noconfigdirs gnattools"
  406. fi
  407. AC_ARG_ENABLE(libssp,
  408. [AS_HELP_STRING([--enable-libssp], [build libssp directory])],
  409. ENABLE_LIBSSP=$enableval,
  410. ENABLE_LIBSSP=yes)
  411. AC_ARG_ENABLE(libstdcxx,
  412. AS_HELP_STRING([--disable-libstdcxx],
  413. [do not build libstdc++-v3 directory]),
  414. ENABLE_LIBSTDCXX=$enableval,
  415. ENABLE_LIBSTDCXX=default)
  416. [if test "${ENABLE_LIBSTDCXX}" = "no" ; then
  417. noconfigdirs="$noconfigdirs target-libstdc++-v3"
  418. fi]
  419. # If this is accelerator compiler and its target is intelmic we enable
  420. # target liboffloadmic by default. If this is compiler with offloading
  421. # for intelmic we enable host liboffloadmic by default. Otherwise
  422. # liboffloadmic is disabled by default.
  423. AC_ARG_ENABLE([liboffloadmic],
  424. AC_HELP_STRING([[--enable-liboffloadmic[=ARG]]],
  425. [build liboffloadmic @<:@ARG={no,host,target}@:>@]),
  426. [case "$enableval" in
  427. no | host | target)
  428. enable_liboffloadmic=$enableval ;;
  429. *)
  430. AC_MSG_ERROR([--enable-liboffloadmic=no/host/target]) ;;
  431. esac],
  432. [if test x"$enable_as_accelerator_for" != x; then
  433. case "${target}" in
  434. *-intelmic-* | *-intelmicemul-*)
  435. enable_liboffloadmic=target
  436. extra_liboffloadmic_configure_flags="--enable-liboffloadmic=target"
  437. ;;
  438. *)
  439. enable_liboffloadmic=no
  440. ;;
  441. esac
  442. else
  443. case "${enable_offload_targets}" in
  444. *-intelmic-* | *-intelmicemul-*)
  445. enable_liboffloadmic=host
  446. extra_liboffloadmic_configure_flags="--enable-liboffloadmic=host"
  447. ;;
  448. *)
  449. enable_liboffloadmic=no
  450. ;;
  451. esac
  452. fi])
  453. AC_SUBST(extra_liboffloadmic_configure_flags)
  454. # Enable libgomp by default on hosted POSIX systems, and a few others.
  455. if test x$enable_libgomp = x ; then
  456. case "${target}" in
  457. *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
  458. ;;
  459. *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
  460. ;;
  461. *-*-solaris2* | *-*-hpux11*)
  462. ;;
  463. *-*-darwin* | *-*-aix*)
  464. ;;
  465. nvptx*-*-*)
  466. ;;
  467. *)
  468. noconfigdirs="$noconfigdirs target-libgomp"
  469. ;;
  470. esac
  471. fi
  472. # Disable libatomic on unsupported systems.
  473. if test -d ${srcdir}/libatomic; then
  474. if test x$enable_libatomic = x; then
  475. AC_MSG_CHECKING([for libatomic support])
  476. if (srcdir=${srcdir}/libatomic; \
  477. . ${srcdir}/configure.tgt; \
  478. test -n "$UNSUPPORTED")
  479. then
  480. AC_MSG_RESULT([no])
  481. noconfigdirs="$noconfigdirs target-libatomic"
  482. else
  483. AC_MSG_RESULT([yes])
  484. fi
  485. fi
  486. fi
  487. # Disable liboffloadmic on unsupported systems.
  488. if test -d ${srcdir}/liboffloadmic; then
  489. if test x$enable_liboffloadmic != xno; then
  490. AC_MSG_CHECKING([for liboffloadmic support])
  491. if (srcdir=${srcdir}/liboffloadmic; \
  492. . ${srcdir}/configure.tgt; \
  493. test -n "$UNSUPPORTED")
  494. then
  495. AC_MSG_RESULT([no])
  496. noconfigdirs="$noconfigdirs target-liboffloadmic"
  497. else
  498. AC_MSG_RESULT([yes])
  499. fi
  500. fi
  501. fi
  502. # Disable libitm on unsupported systems.
  503. if test -d ${srcdir}/libitm; then
  504. if test x$enable_libitm = x; then
  505. AC_MSG_CHECKING([for libitm support])
  506. if (srcdir=${srcdir}/libitm; \
  507. . ${srcdir}/configure.tgt; \
  508. test -n "$UNSUPPORTED")
  509. then
  510. AC_MSG_RESULT([no])
  511. noconfigdirs="$noconfigdirs target-libitm"
  512. else
  513. AC_MSG_RESULT([yes])
  514. fi
  515. fi
  516. fi
  517. # Disable libsanitizer on unsupported systems.
  518. if test -d ${srcdir}/libsanitizer; then
  519. if test x$enable_libsanitizer = x; then
  520. AC_MSG_CHECKING([for libsanitizer support])
  521. if (srcdir=${srcdir}/libsanitizer; \
  522. . ${srcdir}/configure.tgt; \
  523. test -n "$UNSUPPORTED")
  524. then
  525. AC_MSG_RESULT([no])
  526. noconfigdirs="$noconfigdirs target-libsanitizer"
  527. else
  528. AC_MSG_RESULT([yes])
  529. fi
  530. fi
  531. fi
  532. # Disable libvtv on unsupported systems.
  533. if test -d ${srcdir}/libvtv; then
  534. if test x$enable_libvtv = x; then
  535. AC_MSG_CHECKING([for libvtv support])
  536. if (srcdir=${srcdir}/libvtv; \
  537. . ${srcdir}/configure.tgt; \
  538. test "$VTV_SUPPORTED" != "yes")
  539. then
  540. AC_MSG_RESULT([no])
  541. noconfigdirs="$noconfigdirs target-libvtv"
  542. else
  543. AC_MSG_RESULT([yes])
  544. fi
  545. fi
  546. fi
  547. # Disable libhsail-rt on unsupported systems.
  548. if test -d ${srcdir}/libhsail-rt; then
  549. if test x$enable_libhsail_rt = x; then
  550. AC_MSG_CHECKING([for libhsail-rt support])
  551. if (srcdir=${srcdir}/libhsail-rt; \
  552. . ${srcdir}/configure.tgt; \
  553. test -n "$UNSUPPORTED")
  554. then
  555. AC_MSG_RESULT([no])
  556. unsupported_languages="$unsupported_languages brig"
  557. # This implicitly disables also target-libhsail-rt as it won't
  558. # get added to the build without BRIG FE.
  559. else
  560. AC_MSG_RESULT([yes])
  561. fi
  562. fi
  563. fi
  564. # Disable libquadmath for some systems.
  565. case "${target}" in
  566. avr-*-*)
  567. noconfigdirs="$noconfigdirs target-libquadmath"
  568. ;;
  569. # libquadmath is unused on AIX and libquadmath build process use of
  570. # LD_LIBRARY_PATH can break AIX bootstrap.
  571. powerpc-*-aix* | rs6000-*-aix*)
  572. noconfigdirs="$noconfigdirs target-libquadmath"
  573. ;;
  574. esac
  575. # Disable libssp for some systems.
  576. case "${target}" in
  577. avr-*-*)
  578. # No hosted I/O support.
  579. noconfigdirs="$noconfigdirs target-libssp"
  580. ;;
  581. powerpc-*-aix* | rs6000-*-aix*)
  582. noconfigdirs="$noconfigdirs target-libssp"
  583. ;;
  584. rl78-*-*)
  585. # libssp uses a misaligned load to trigger a fault, but the RL78
  586. # doesn't fault for those - instead, it gives a build-time error
  587. # for explicit misaligned loads.
  588. noconfigdirs="$noconfigdirs target-libssp"
  589. ;;
  590. visium-*-*)
  591. # No hosted I/O support.
  592. noconfigdirs="$noconfigdirs target-libssp"
  593. ;;
  594. esac
  595. # Disable libstdc++-v3 for some systems.
  596. # Allow user to override this if they pass --enable-libstdc++-v3
  597. if test "${ENABLE_LIBSTDCXX}" = "default" ; then
  598. case "${target}" in
  599. *-*-vxworks*)
  600. # VxWorks uses the Dinkumware C++ library.
  601. noconfigdirs="$noconfigdirs target-libstdc++-v3"
  602. ;;
  603. arm*-wince-pe*)
  604. # the C++ libraries don't build on top of CE's C libraries
  605. noconfigdirs="$noconfigdirs target-libstdc++-v3"
  606. ;;
  607. avr-*-*)
  608. noconfigdirs="$noconfigdirs target-libstdc++-v3"
  609. ;;
  610. ft32-*-*)
  611. noconfigdirs="$noconfigdirs target-libstdc++-v3"
  612. ;;
  613. esac
  614. fi
  615. # Disable Fortran for some systems.
  616. case "${target}" in
  617. mmix-*-*)
  618. # See <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00572.html>.
  619. unsupported_languages="$unsupported_languages fortran"
  620. ;;
  621. esac
  622. # Disable libffi for some systems.
  623. case "${target}" in
  624. powerpc-*-darwin*)
  625. ;;
  626. i[[3456789]]86-*-darwin*)
  627. ;;
  628. x86_64-*-darwin[[912]]*)
  629. ;;
  630. *-*-darwin*)
  631. noconfigdirs="$noconfigdirs target-libffi"
  632. ;;
  633. *-*-netware*)
  634. noconfigdirs="$noconfigdirs target-libffi"
  635. ;;
  636. *-*-phoenix*)
  637. noconfigdirs="$noconfigdirs target-libffi"
  638. ;;
  639. *-*-rtems*)
  640. noconfigdirs="$noconfigdirs target-libffi"
  641. ;;
  642. *-*-tpf*)
  643. noconfigdirs="$noconfigdirs target-libffi"
  644. ;;
  645. *-*-uclinux*)
  646. noconfigdirs="$noconfigdirs target-libffi"
  647. ;;
  648. *-*-vxworks*)
  649. noconfigdirs="$noconfigdirs target-libffi"
  650. ;;
  651. aarch64*-*-freebsd*)
  652. noconfigdirs="$noconfigdirs target-libffi"
  653. ;;
  654. alpha*-*-*vms*)
  655. noconfigdirs="$noconfigdirs target-libffi"
  656. ;;
  657. arm*-*-freebsd*)
  658. noconfigdirs="$noconfigdirs target-libffi"
  659. ;;
  660. arm-wince-pe)
  661. noconfigdirs="$noconfigdirs target-libffi"
  662. ;;
  663. cris-*-* | crisv32-*-*)
  664. case "${target}" in
  665. *-*-linux*)
  666. ;;
  667. *) # See PR46792 regarding target-libffi.
  668. noconfigdirs="$noconfigdirs target-libffi";;
  669. esac
  670. ;;
  671. hppa*64*-*-hpux*)
  672. noconfigdirs="$noconfigdirs target-libffi"
  673. ;;
  674. hppa*-hp-hpux11*)
  675. ;;
  676. hppa*-*-hpux*)
  677. noconfigdirs="$noconfigdirs target-libffi"
  678. ;;
  679. ia64*-*-*vms*)
  680. noconfigdirs="$noconfigdirs target-libffi"
  681. ;;
  682. i[[3456789]]86-w64-mingw*)
  683. noconfigdirs="$noconfigdirs target-libffi"
  684. ;;
  685. i[[3456789]]86-*-mingw*)
  686. noconfigdirs="$noconfigdirs target-libffi"
  687. ;;
  688. x86_64-*-mingw*)
  689. noconfigdirs="$noconfigdirs target-libffi"
  690. ;;
  691. mmix-*-*)
  692. noconfigdirs="$noconfigdirs target-libffi"
  693. ;;
  694. powerpc-*-aix*)
  695. ;;
  696. rs6000-*-aix*)
  697. ;;
  698. ft32-*-*)
  699. noconfigdirs="$noconfigdirs target-libffi"
  700. ;;
  701. *-*-lynxos*)
  702. noconfigdirs="$noconfigdirs target-libffi"
  703. ;;
  704. esac
  705. # Disable the go frontend on systems where it is known to not work. Please keep
  706. # this in sync with contrib/config-list.mk.
  707. case "${target}" in
  708. *-*-darwin* | *-*-cygwin* | *-*-mingw*)
  709. unsupported_languages="$unsupported_languages go"
  710. ;;
  711. esac
  712. # Only allow gdbserver on some systems.
  713. if test -d ${srcdir}/gdbserver; then
  714. if test x$enable_gdbserver = x; then
  715. AC_MSG_CHECKING([for gdbserver support])
  716. if (srcdir=${srcdir}/gdbserver; \
  717. . ${srcdir}/configure.srv; \
  718. test -n "$UNSUPPORTED")
  719. then
  720. AC_MSG_RESULT([no])
  721. noconfigdirs="$noconfigdirs gdbserver"
  722. else
  723. AC_MSG_RESULT([yes])
  724. fi
  725. fi
  726. fi
  727. # Disable libgo for some systems where it is known to not work.
  728. # For testing, you can easily override this with --enable-libgo.
  729. if test x$enable_libgo = x; then
  730. case "${target}" in
  731. *-*-darwin*)
  732. # PR 46986
  733. noconfigdirs="$noconfigdirs target-libgo"
  734. ;;
  735. *-*-cygwin* | *-*-mingw*)
  736. noconfigdirs="$noconfigdirs target-libgo"
  737. ;;
  738. esac
  739. fi
  740. # Default libgloss CPU subdirectory.
  741. libgloss_dir="$target_cpu"
  742. case "${target}" in
  743. sh*-*-pe|mips*-*-pe|*arm-wince-pe)
  744. libgloss_dir=wince
  745. ;;
  746. aarch64*-*-* )
  747. libgloss_dir=aarch64
  748. ;;
  749. arm*-*-*)
  750. libgloss_dir=arm
  751. ;;
  752. cris-*-* | crisv32-*-*)
  753. libgloss_dir=cris
  754. ;;
  755. hppa*-*-*)
  756. libgloss_dir=pa
  757. ;;
  758. i[[3456789]]86-*-*)
  759. libgloss_dir=i386
  760. ;;
  761. m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
  762. libgloss_dir=m68hc11
  763. ;;
  764. m68*-*-* | fido-*-*)
  765. libgloss_dir=m68k
  766. ;;
  767. mips*-*-*)
  768. libgloss_dir=mips
  769. ;;
  770. powerpc*-*-*)
  771. libgloss_dir=rs6000
  772. ;;
  773. sparc*-*-*)
  774. libgloss_dir=sparc
  775. ;;
  776. esac
  777. # Disable newlib and libgloss for various target OSes.
  778. case "${target}" in
  779. alpha*-dec-osf*)
  780. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  781. ;;
  782. i[[3456789]]86-*-linux*)
  783. # This section makes it possible to build newlib natively on linux.
  784. # If we are using a cross compiler then don't configure newlib.
  785. if test x${is_cross_compiler} != xno ; then
  786. noconfigdirs="$noconfigdirs target-newlib"
  787. fi
  788. noconfigdirs="$noconfigdirs target-libgloss"
  789. # If we are not using a cross compiler, do configure newlib.
  790. # Note however, that newlib will only be configured in this situation
  791. # if the --with-newlib option has been given, because otherwise
  792. # 'target-newlib' will appear in skipdirs.
  793. ;;
  794. i[[3456789]]86-*-rdos*)
  795. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  796. ;;
  797. sh*-*-pe|mips*-*-pe|arm-wince-pe)
  798. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  799. ;;
  800. sparc-*-sunos4*)
  801. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  802. ;;
  803. *-*-aix*)
  804. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  805. ;;
  806. *-*-beos*)
  807. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  808. ;;
  809. *-*-chorusos)
  810. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  811. ;;
  812. *-*-dragonfly*)
  813. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  814. ;;
  815. *-*-freebsd*)
  816. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  817. ;;
  818. *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
  819. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  820. ;;
  821. *-*-lynxos*)
  822. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  823. ;;
  824. *-*-mingw*)
  825. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  826. ;;
  827. *-*-netbsd*)
  828. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  829. ;;
  830. *-*-netware*)
  831. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  832. ;;
  833. *-*-tpf*)
  834. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  835. ;;
  836. *-*-uclinux*)
  837. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  838. ;;
  839. *-*-vxworks*)
  840. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  841. ;;
  842. esac
  843. case "${target}" in
  844. *-*-chorusos)
  845. ;;
  846. aarch64-*-darwin*)
  847. noconfigdirs="$noconfigdirs ld gas gdb gprof"
  848. noconfigdirs="$noconfigdirs sim target-rda"
  849. ;;
  850. arm-*-darwin*)
  851. noconfigdirs="$noconfigdirs ld gas gdb gprof"
  852. noconfigdirs="$noconfigdirs sim target-rda"
  853. ;;
  854. powerpc-*-darwin*)
  855. noconfigdirs="$noconfigdirs ld gas gdb gprof"
  856. noconfigdirs="$noconfigdirs sim target-rda"
  857. ;;
  858. i[[3456789]]86-*-darwin*)
  859. noconfigdirs="$noconfigdirs ld gprof"
  860. noconfigdirs="$noconfigdirs sim target-rda"
  861. ;;
  862. x86_64-*-darwin[[912]]*)
  863. noconfigdirs="$noconfigdirs ld gas gprof"
  864. noconfigdirs="$noconfigdirs sim target-rda"
  865. ;;
  866. *-*-darwin*)
  867. noconfigdirs="$noconfigdirs ld gas gdb gprof"
  868. noconfigdirs="$noconfigdirs sim target-rda"
  869. ;;
  870. *-*-dragonfly*)
  871. ;;
  872. *-*-freebsd*)
  873. if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
  874. && test -f /usr/local/include/gmp.h; then
  875. with_gmp=/usr/local
  876. fi
  877. ;;
  878. *-*-kaos*)
  879. # Remove unsupported stuff on all kaOS configurations.
  880. noconfigdirs="$noconfigdirs target-libgloss"
  881. ;;
  882. *-*-netbsd*)
  883. ;;
  884. *-*-netware*)
  885. ;;
  886. *-*-phoenix*)
  887. noconfigdirs="$noconfigdirs target-libgloss"
  888. ;;
  889. *-*-rtems*)
  890. noconfigdirs="$noconfigdirs target-libgloss"
  891. ;;
  892. # The tpf target doesn't support gdb yet.
  893. *-*-tpf*)
  894. noconfigdirs="$noconfigdirs gdb tcl tk libgui itcl"
  895. ;;
  896. *-*-uclinux*)
  897. noconfigdirs="$noconfigdirs target-rda"
  898. ;;
  899. *-*-vxworks*)
  900. ;;
  901. alpha*-dec-osf*)
  902. # ld works, but does not support shared libraries.
  903. # gas doesn't generate exception information.
  904. noconfigdirs="$noconfigdirs gas ld"
  905. ;;
  906. alpha*-*-*vms*)
  907. noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
  908. ;;
  909. alpha*-*-*)
  910. # newlib is not 64 bit ready
  911. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  912. ;;
  913. sh*-*-pe|mips*-*-pe|*arm-wince-pe)
  914. noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
  915. ;;
  916. arc*-*-*)
  917. noconfigdirs="$noconfigdirs sim"
  918. ;;
  919. arm-*-pe*)
  920. noconfigdirs="$noconfigdirs target-libgloss"
  921. ;;
  922. arm-*-riscix*)
  923. noconfigdirs="$noconfigdirs ld target-libgloss"
  924. ;;
  925. avr-*-*)
  926. if test x${with_avrlibc} != xno; then
  927. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  928. fi
  929. ;;
  930. c4x-*-* | tic4x-*-*)
  931. noconfigdirs="$noconfigdirs target-libgloss"
  932. ;;
  933. tic54x-*-*)
  934. noconfigdirs="$noconfigdirs target-libgloss gdb"
  935. ;;
  936. d10v-*-*)
  937. noconfigdirs="$noconfigdirs target-libgloss"
  938. ;;
  939. d30v-*-*)
  940. noconfigdirs="$noconfigdirs gdb"
  941. ;;
  942. fr30-*-elf*)
  943. noconfigdirs="$noconfigdirs gdb"
  944. ;;
  945. ft32-*-*)
  946. noconfigdirs="$noconfigdirs target-rda gprof"
  947. ;;
  948. moxie-*-*)
  949. noconfigdirs="$noconfigdirs"
  950. ;;
  951. h8300*-*-*)
  952. noconfigdirs="$noconfigdirs target-libgloss"
  953. ;;
  954. h8500-*-*)
  955. noconfigdirs="$noconfigdirs target-libgloss"
  956. ;;
  957. hppa1.1-*-osf* | hppa1.1-*-bsd* )
  958. ;;
  959. hppa*64*-*-hpux*)
  960. noconfigdirs="$noconfigdirs gdb"
  961. ;;
  962. hppa*-*-hpux11*)
  963. noconfigdirs="$noconfigdirs gdb ld"
  964. ;;
  965. hppa*64*-*-linux*)
  966. ;;
  967. hppa*-*-linux*)
  968. ;;
  969. hppa*-*-*elf* | \
  970. hppa*-*-lites* | \
  971. hppa*-*-openbsd* | \
  972. hppa*64*-*-*)
  973. ;;
  974. hppa*-*-pro*)
  975. ;;
  976. hppa*-*-*)
  977. noconfigdirs="$noconfigdirs ld"
  978. ;;
  979. i960-*-*)
  980. noconfigdirs="$noconfigdirs gdb"
  981. ;;
  982. ia64*-*-elf*)
  983. # No gdb support yet.
  984. noconfigdirs="$noconfigdirs readline libgui itcl gdb"
  985. ;;
  986. ia64*-**-hpux*)
  987. # No ld support yet.
  988. noconfigdirs="$noconfigdirs gdb libgui itcl ld"
  989. ;;
  990. ia64*-*-*vms*)
  991. # No ld support yet.
  992. noconfigdirs="$noconfigdirs libgui itcl ld"
  993. ;;
  994. i[[3456789]]86-w64-mingw*)
  995. ;;
  996. i[[3456789]]86-*-mingw*)
  997. target_configdirs="$target_configdirs target-winsup"
  998. ;;
  999. *-*-cygwin*)
  1000. target_configdirs="$target_configdirs target-libtermcap target-winsup"
  1001. noconfigdirs="$noconfigdirs target-libgloss"
  1002. # always build newlib if winsup directory is present.
  1003. if test -d "$srcdir/winsup/cygwin"; then
  1004. skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
  1005. elif test -d "$srcdir/newlib"; then
  1006. echo "Warning: winsup/cygwin is missing so newlib can't be built."
  1007. fi
  1008. ;;
  1009. i[[3456789]]86-*-pe)
  1010. noconfigdirs="$noconfigdirs target-libgloss"
  1011. ;;
  1012. i[[3456789]]86-*-sco3.2v5*)
  1013. # The linker does not yet know about weak symbols in COFF,
  1014. # and is not configured to handle mixed ELF and COFF.
  1015. noconfigdirs="$noconfigdirs ld target-libgloss"
  1016. ;;
  1017. i[[3456789]]86-*-sco*)
  1018. noconfigdirs="$noconfigdirs gprof target-libgloss"
  1019. ;;
  1020. i[[3456789]]86-*-solaris2* | x86_64-*-solaris2.1[[0-9]]*)
  1021. noconfigdirs="$noconfigdirs target-libgloss"
  1022. ;;
  1023. i[[3456789]]86-*-sysv4*)
  1024. noconfigdirs="$noconfigdirs target-libgloss"
  1025. ;;
  1026. i[[3456789]]86-*-beos*)
  1027. noconfigdirs="$noconfigdirs gdb"
  1028. ;;
  1029. i[[3456789]]86-*-rdos*)
  1030. noconfigdirs="$noconfigdirs gdb"
  1031. ;;
  1032. mmix-*-*)
  1033. noconfigdirs="$noconfigdirs gdb"
  1034. ;;
  1035. mt-*-*)
  1036. noconfigdirs="$noconfigdirs sim"
  1037. ;;
  1038. nfp-*-*)
  1039. noconfigdirs="$noconfigdirs ld gas gdb gprof sim"
  1040. noconfigdirs="$noconfigdirs $target_libraries"
  1041. ;;
  1042. pdp11-*-*)
  1043. noconfigdirs="$noconfigdirs gdb gprof"
  1044. ;;
  1045. powerpc-*-aix*)
  1046. # copied from rs6000-*-* entry
  1047. noconfigdirs="$noconfigdirs gprof"
  1048. ;;
  1049. powerpc*-*-winnt* | powerpc*-*-pe*)
  1050. target_configdirs="$target_configdirs target-winsup"
  1051. noconfigdirs="$noconfigdirs gdb tcl tk target-libgloss itcl"
  1052. # always build newlib.
  1053. skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
  1054. ;;
  1055. # This is temporary until we can link against shared libraries
  1056. powerpcle-*-solaris*)
  1057. noconfigdirs="$noconfigdirs gdb sim tcl tk itcl"
  1058. ;;
  1059. powerpc-*-beos*)
  1060. noconfigdirs="$noconfigdirs gdb"
  1061. ;;
  1062. rs6000-*-lynxos*)
  1063. noconfigdirs="$noconfigdirs gprof"
  1064. ;;
  1065. rs6000-*-aix*)
  1066. noconfigdirs="$noconfigdirs gprof"
  1067. ;;
  1068. rs6000-*-*)
  1069. noconfigdirs="$noconfigdirs gprof"
  1070. ;;
  1071. m68k-apollo-*)
  1072. noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
  1073. ;;
  1074. microblaze*)
  1075. noconfigdirs="$noconfigdirs gprof"
  1076. ;;
  1077. mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
  1078. if test x$with_newlib = xyes; then
  1079. noconfigdirs="$noconfigdirs gprof"
  1080. fi
  1081. ;;
  1082. mips*-*-irix5*)
  1083. noconfigdirs="$noconfigdirs gprof target-libgloss"
  1084. ;;
  1085. mips*-*-irix6*)
  1086. noconfigdirs="$noconfigdirs gprof target-libgloss"
  1087. ;;
  1088. mips*-*-bsd*)
  1089. noconfigdirs="$noconfigdirs ld gas gprof target-libgloss"
  1090. ;;
  1091. mips*-*-linux*)
  1092. ;;
  1093. mips*-*-ultrix* | mips*-*-osf* | mips*-*-ecoff* | mips*-*-pe* \
  1094. | mips*-*-irix* | mips*-*-lnews* | mips*-*-riscos*)
  1095. noconfigdirs="$noconfigdirs ld gas gprof"
  1096. ;;
  1097. mips*-*-*)
  1098. noconfigdirs="$noconfigdirs gprof"
  1099. ;;
  1100. nvptx*-*-*)
  1101. noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
  1102. ;;
  1103. sh-*-*)
  1104. case "${target}" in
  1105. sh*-*-elf)
  1106. ;;
  1107. *)
  1108. noconfigdirs="$noconfigdirs target-libgloss" ;;
  1109. esac
  1110. ;;
  1111. sparc-*-sunos4*)
  1112. if test x${is_cross_compiler} = xno ; then
  1113. use_gnu_ld=no
  1114. fi
  1115. ;;
  1116. tic6x-*-*)
  1117. noconfigdirs="$noconfigdirs sim"
  1118. ;;
  1119. tilepro*-*-* | tilegx*-*-*)
  1120. noconfigdirs="$noconfigdirs sim"
  1121. ;;
  1122. v810-*-*)
  1123. noconfigdirs="$noconfigdirs bfd binutils gas gdb ld opcodes target-libgloss"
  1124. ;;
  1125. vax-*-*)
  1126. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  1127. ;;
  1128. wasm32-*-*)
  1129. noconfigdirs="$noconfigdirs ld"
  1130. ;;
  1131. esac
  1132. # If we aren't building newlib, then don't build libgloss, since libgloss
  1133. # depends upon some newlib header files.
  1134. case "${noconfigdirs}" in
  1135. *target-libgloss*) ;;
  1136. *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
  1137. esac
  1138. # Work in distributions that contain no compiler tools, like Autoconf.
  1139. host_makefile_frag=/dev/null
  1140. if test -d ${srcdir}/config ; then
  1141. case "${host}" in
  1142. i[[3456789]]86-*-msdosdjgpp*)
  1143. host_makefile_frag="config/mh-djgpp"
  1144. ;;
  1145. *-cygwin*)
  1146. ACX_CHECK_CYGWIN_CAT_WORKS
  1147. host_makefile_frag="config/mh-cygwin"
  1148. ;;
  1149. *-mingw*)
  1150. host_makefile_frag="config/mh-mingw"
  1151. ;;
  1152. alpha*-linux*)
  1153. host_makefile_frag="config/mh-alpha-linux"
  1154. ;;
  1155. hppa*-hp-hpux10*)
  1156. host_makefile_frag="config/mh-pa-hpux10"
  1157. ;;
  1158. hppa*-hp-hpux*)
  1159. host_makefile_frag="config/mh-pa"
  1160. ;;
  1161. hppa*-*)
  1162. host_makefile_frag="config/mh-pa"
  1163. ;;
  1164. *-*-darwin*)
  1165. host_makefile_frag="config/mh-darwin"
  1166. ;;
  1167. powerpc-*-aix*)
  1168. host_makefile_frag="config/mh-ppc-aix"
  1169. ;;
  1170. rs6000-*-aix*)
  1171. host_makefile_frag="config/mh-ppc-aix"
  1172. ;;
  1173. esac
  1174. fi
  1175. if test "${build}" != "${host}" ; then
  1176. AR_FOR_BUILD=${AR_FOR_BUILD-ar}
  1177. AS_FOR_BUILD=${AS_FOR_BUILD-as}
  1178. CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
  1179. CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
  1180. GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
  1181. GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
  1182. DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
  1183. LD_FOR_BUILD=${LD_FOR_BUILD-ld}
  1184. NM_FOR_BUILD=${NM_FOR_BUILD-nm}
  1185. RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib}
  1186. WINDRES_FOR_BUILD=${WINDRES_FOR_BUILD-windres}
  1187. WINDMC_FOR_BUILD=${WINDMC_FOR_BUILD-windmc}
  1188. else
  1189. AR_FOR_BUILD="\$(AR)"
  1190. AS_FOR_BUILD="\$(AS)"
  1191. CC_FOR_BUILD="\$(CC)"
  1192. CXX_FOR_BUILD="\$(CXX)"
  1193. GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
  1194. GOC_FOR_BUILD="\$(GOC)"
  1195. DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
  1196. LD_FOR_BUILD="\$(LD)"
  1197. NM_FOR_BUILD="\$(NM)"
  1198. RANLIB_FOR_BUILD="\$(RANLIB)"
  1199. WINDRES_FOR_BUILD="\$(WINDRES)"
  1200. WINDMC_FOR_BUILD="\$(WINDMC)"
  1201. fi
  1202. AC_PROG_CC_C99
  1203. AC_PROG_CXX
  1204. # We must set the default linker to the linker used by gcc for the correct
  1205. # operation of libtool. If LD is not defined and we are using gcc, try to
  1206. # set the LD default to the ld used by gcc.
  1207. if test -z "$LD"; then
  1208. if test "$GCC" = yes; then
  1209. case $build in
  1210. *-*-mingw*)
  1211. gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
  1212. *)
  1213. gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
  1214. esac
  1215. case $gcc_prog_ld in
  1216. # Accept absolute paths.
  1217. [[\\/]* | [A-Za-z]:[\\/]*)]
  1218. LD="$gcc_prog_ld" ;;
  1219. esac
  1220. fi
  1221. fi
  1222. # Check whether -static-libstdc++ -static-libgcc is supported.
  1223. have_static_libs=no
  1224. if test "$GCC" = yes; then
  1225. saved_LDFLAGS="$LDFLAGS"
  1226. LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
  1227. AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
  1228. AC_LANG_PUSH(C++)
  1229. AC_LINK_IFELSE([AC_LANG_SOURCE([
  1230. #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
  1231. #error -static-libstdc++ not implemented
  1232. #endif
  1233. int main() {}])],
  1234. [AC_MSG_RESULT([yes]); have_static_libs=yes],
  1235. [AC_MSG_RESULT([no])])
  1236. AC_LANG_POP(C++)
  1237. LDFLAGS="$saved_LDFLAGS"
  1238. fi
  1239. ACX_PROG_GNAT
  1240. ACX_PROG_CMP_IGNORE_INITIAL
  1241. AC_ARG_ENABLE([bootstrap],
  1242. [AS_HELP_STRING([--enable-bootstrap],
  1243. [enable bootstrapping @<:@yes if native build@:>@])],,
  1244. enable_bootstrap=default)
  1245. # Issue errors and warnings for invalid/strange bootstrap combinations.
  1246. if test -r $srcdir/gcc/configure; then
  1247. have_compiler=yes
  1248. else
  1249. have_compiler=no
  1250. fi
  1251. case "$have_compiler:$host:$target:$enable_bootstrap" in
  1252. *:*:*:no) ;;
  1253. # Default behavior. Enable bootstrap if we have a compiler
  1254. # and we are in a native configuration.
  1255. yes:$build:$build:default)
  1256. enable_bootstrap=yes ;;
  1257. *:*:*:default)
  1258. enable_bootstrap=no ;;
  1259. # We have a compiler and we are in a native configuration, bootstrap is ok
  1260. yes:$build:$build:yes)
  1261. ;;
  1262. # Other configurations, but we have a compiler. Assume the user knows
  1263. # what he's doing.
  1264. yes:*:*:yes)
  1265. AC_MSG_WARN([trying to bootstrap a cross compiler])
  1266. ;;
  1267. # No compiler: if they passed --enable-bootstrap explicitly, fail
  1268. no:*:*:yes)
  1269. AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
  1270. # Fail if wrong command line
  1271. *)
  1272. AC_MSG_ERROR([invalid option for --enable-bootstrap])
  1273. ;;
  1274. esac
  1275. # When bootstrapping with GCC, build stage 1 in C++98 mode to ensure that a
  1276. # C++98 compiler can still start the bootstrap.
  1277. if test "$enable_bootstrap:$GXX" = "yes:yes"; then
  1278. CXX="$CXX -std=gnu++98"
  1279. fi
  1280. AC_ARG_ENABLE([pgo-build],
  1281. [AS_HELP_STRING([--enable-pgo-build[[=lto]]],
  1282. [enable the PGO build])],
  1283. [enable_pgo_build=$enableval],
  1284. [enable_pgo_build=no])
  1285. # Issue errors and warnings for invalid/strange PGO build combinations.
  1286. case "$have_compiler:$host:$target:$enable_pgo_build" in
  1287. *:*:*:no) ;;
  1288. # Allow the PGO build only if we aren't building a compiler and
  1289. # we are in a native configuration.
  1290. no:$build:$build:yes | no:$build:$build:lto) ;;
  1291. # Disallow the PGO bootstrap if we are building a compiler.
  1292. yes:*:*:yes | yes:*:*:lto)
  1293. AC_MSG_ERROR([cannot perform the PGO bootstrap when building a compiler]) ;;
  1294. *)
  1295. AC_MSG_ERROR([invalid option for --enable-pgo-build])
  1296. ;;
  1297. esac
  1298. if test "$enable_pgo_build" != "no"; then
  1299. AC_MSG_CHECKING([whether the compiler supports -fprofile-generate])
  1300. old_CFLAGS="$CFLAGS"
  1301. PGO_BUILD_GEN_CFLAGS="-fprofile-generate"
  1302. CFLAGS="$CFLAGS $PGO_BUILD_CFLAGS"
  1303. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int foo;])],,
  1304. [PGO_BUILD_GEN_CFLAGS=])
  1305. CFLAGS="$old_CFLAGS"
  1306. if test -n "$PGO_BUILD_GEN_CFLAGS"; then
  1307. AC_MSG_RESULT([yes])
  1308. PGO_BUILD_USE_CFLAGS="-fprofile-use"
  1309. else
  1310. AC_MSG_RESULT([no])
  1311. AC_MSG_ERROR([cannot perform the PGO build without -fprofile-generate])
  1312. fi
  1313. if test "$enable_pgo_build" = "lto"; then
  1314. AC_MSG_CHECKING([whether the compiler supports -flto=jobserver -ffat-lto-objects])
  1315. old_CFLAGS="$CFLAGS"
  1316. PGO_BUILD_LTO_CFLAGS="-flto=jobserver -ffat-lto-objects"
  1317. CFLAGS="$CFLAGS $PGO_BUILD_LTO_CFLAGS"
  1318. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int foo;])],,
  1319. [PGO_BUILD_LTO_CFLAGS=])
  1320. CFLAGS="$old_CFLAGS"
  1321. if test -n "$PGO_BUILD_LTO_CFLAGS"; then
  1322. AC_MSG_RESULT([yes])
  1323. else
  1324. AC_MSG_RESULT([no])
  1325. AC_MSG_WARN([LTO is disabled for the PGO build])
  1326. fi
  1327. fi
  1328. fi
  1329. AC_SUBST(PGO_BUILD_GEN_CFLAGS)
  1330. AC_SUBST(PGO_BUILD_USE_CFLAGS)
  1331. AC_SUBST(PGO_BUILD_LTO_CFLAGS)
  1332. # Used for setting $lt_cv_objdir
  1333. _LT_CHECK_OBJDIR
  1334. # Check for GMP, MPFR and MPC
  1335. gmplibs="-lmpc -lmpfr -lgmp"
  1336. gmpinc=
  1337. have_gmp=no
  1338. # Specify a location for mpc
  1339. # check for this first so it ends up on the link line before mpfr.
  1340. AC_ARG_WITH(mpc,
  1341. [AS_HELP_STRING([--with-mpc=PATH],
  1342. [specify prefix directory for installed MPC package.
  1343. Equivalent to --with-mpc-include=PATH/include
  1344. plus --with-mpc-lib=PATH/lib])])
  1345. AC_ARG_WITH(mpc-include,
  1346. [AS_HELP_STRING([--with-mpc-include=PATH],
  1347. [specify directory for installed MPC include files])])
  1348. AC_ARG_WITH(mpc-lib,
  1349. [AS_HELP_STRING([--with-mpc-lib=PATH],
  1350. [specify directory for the installed MPC library])])
  1351. if test "x$with_mpc" != x; then
  1352. gmplibs="-L$with_mpc/lib $gmplibs"
  1353. gmpinc="-I$with_mpc/include $gmpinc"
  1354. fi
  1355. if test "x$with_mpc_include" != x; then
  1356. gmpinc="-I$with_mpc_include $gmpinc"
  1357. fi
  1358. if test "x$with_mpc_lib" != x; then
  1359. gmplibs="-L$with_mpc_lib $gmplibs"
  1360. fi
  1361. if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
  1362. gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/'"$lt_cv_objdir $gmplibs"
  1363. gmpinc='-I$$s/mpc/src '"$gmpinc"
  1364. # Do not test the mpc version. Assume that it is sufficient, since
  1365. # it is in the source tree, and the library has not been built yet
  1366. # but it would be included on the link line in the version check below
  1367. # hence making the test fail.
  1368. have_gmp=yes
  1369. fi
  1370. # Specify a location for mpfr
  1371. # check for this first so it ends up on the link line before gmp.
  1372. AC_ARG_WITH(mpfr-dir,
  1373. [AS_HELP_STRING([--with-mpfr-dir=PATH], [this option has been REMOVED])],
  1374. [AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed.
  1375. Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH])])
  1376. AC_ARG_WITH(mpfr,
  1377. [AS_HELP_STRING([--with-mpfr=PATH],
  1378. [specify prefix directory for installed MPFR package.
  1379. Equivalent to --with-mpfr-include=PATH/include
  1380. plus --with-mpfr-lib=PATH/lib])])
  1381. AC_ARG_WITH(mpfr-include,
  1382. [AS_HELP_STRING([--with-mpfr-include=PATH],
  1383. [specify directory for installed MPFR include files])])
  1384. AC_ARG_WITH(mpfr-lib,
  1385. [AS_HELP_STRING([--with-mpfr-lib=PATH],
  1386. [specify directory for the installed MPFR library])])
  1387. if test "x$with_mpfr" != x; then
  1388. gmplibs="-L$with_mpfr/lib $gmplibs"
  1389. gmpinc="-I$with_mpfr/include $gmpinc"
  1390. fi
  1391. if test "x$with_mpfr_include" != x; then
  1392. gmpinc="-I$with_mpfr_include $gmpinc"
  1393. fi
  1394. if test "x$with_mpfr_lib" != x; then
  1395. gmplibs="-L$with_mpfr_lib $gmplibs"
  1396. fi
  1397. if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
  1398. # MPFR v3.1.0 moved the sources into a src sub-directory.
  1399. if ! test -d ${srcdir}/mpfr/src; then
  1400. AC_MSG_ERROR([dnl
  1401. Building GCC with MPFR in the source tree is only handled for MPFR 3.1.0+.])
  1402. fi
  1403. gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
  1404. gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
  1405. extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
  1406. # Do not test the mpfr version. Assume that it is sufficient, since
  1407. # it is in the source tree, and the library has not been built yet
  1408. # but it would be included on the link line in the version check below
  1409. # hence making the test fail.
  1410. have_gmp=yes
  1411. fi
  1412. # Specify a location for gmp
  1413. AC_ARG_WITH(gmp-dir,
  1414. [AS_HELP_STRING([--with-gmp-dir=PATH], [this option has been REMOVED])],
  1415. [AC_MSG_ERROR([The --with-gmp-dir=PATH option has been removed.
  1416. Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH])])
  1417. AC_ARG_WITH(gmp,
  1418. [AS_HELP_STRING([--with-gmp=PATH],
  1419. [specify prefix directory for the installed GMP package.
  1420. Equivalent to --with-gmp-include=PATH/include
  1421. plus --with-gmp-lib=PATH/lib])])
  1422. AC_ARG_WITH(gmp-include,
  1423. [AS_HELP_STRING([--with-gmp-include=PATH],
  1424. [specify directory for installed GMP include files])])
  1425. AC_ARG_WITH(gmp-lib,
  1426. [AS_HELP_STRING([--with-gmp-lib=PATH],
  1427. [specify directory for the installed GMP library])])
  1428. if test "x$with_gmp" != x; then
  1429. gmplibs="-L$with_gmp/lib $gmplibs"
  1430. gmpinc="-I$with_gmp/include $gmpinc"
  1431. fi
  1432. if test "x$with_gmp_include" != x; then
  1433. gmpinc="-I$with_gmp_include $gmpinc"
  1434. fi
  1435. if test "x$with_gmp_lib" != x; then
  1436. gmplibs="-L$with_gmp_lib $gmplibs"
  1437. fi
  1438. if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
  1439. gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs"
  1440. gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc"
  1441. extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
  1442. extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
  1443. extra_isl_gmp_configure_flags='--with-gmp-builddir=$$r/$(HOST_SUBDIR)/gmp'
  1444. # Do not test the gmp version. Assume that it is sufficient, since
  1445. # it is in the source tree, and the library has not been built yet
  1446. # but it would be included on the link line in the version check below
  1447. # hence making the test fail.
  1448. have_gmp=yes
  1449. fi
  1450. if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
  1451. have_gmp=yes
  1452. saved_CFLAGS="$CFLAGS"
  1453. CFLAGS="$CFLAGS $gmpinc"
  1454. # Check for the recommended and required versions of GMP.
  1455. AC_MSG_CHECKING([for the correct version of gmp.h])
  1456. AC_TRY_COMPILE([#include "gmp.h"],[
  1457. #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
  1458. #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
  1459. #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,3)
  1460. choke me
  1461. #endif
  1462. ], [AC_TRY_COMPILE([#include <gmp.h>],[
  1463. #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
  1464. #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
  1465. #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2)
  1466. choke me
  1467. #endif
  1468. ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
  1469. [AC_MSG_RESULT([no]); have_gmp=no])
  1470. # If we have GMP, check the MPFR version.
  1471. if test x"$have_gmp" = xyes; then
  1472. # Check for the recommended and required versions of MPFR.
  1473. AC_MSG_CHECKING([for the correct version of mpfr.h])
  1474. AC_TRY_COMPILE([#include <gmp.h>
  1475. #include <mpfr.h>],[
  1476. #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0)
  1477. choke me
  1478. #endif
  1479. ], [AC_TRY_COMPILE([#include <gmp.h>
  1480. #include <mpfr.h>],[
  1481. #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2)
  1482. choke me
  1483. #endif
  1484. ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
  1485. [AC_MSG_RESULT([no]); have_gmp=no])
  1486. fi
  1487. # Check for the MPC header version.
  1488. if test x"$have_gmp" = xyes ; then
  1489. # Check for the recommended and required versions of MPC.
  1490. AC_MSG_CHECKING([for the correct version of mpc.h])
  1491. AC_TRY_COMPILE([#include <mpc.h>],[
  1492. #if MPC_VERSION < MPC_VERSION_NUM(0,8,0)
  1493. choke me
  1494. #endif
  1495. ], [AC_TRY_COMPILE([#include <mpc.h>],[
  1496. #if MPC_VERSION < MPC_VERSION_NUM(0,8,1)
  1497. choke me
  1498. #endif
  1499. ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
  1500. [AC_MSG_RESULT([no]); have_gmp=no])
  1501. fi
  1502. # Now check the MPFR library.
  1503. if test x"$have_gmp" = xyes; then
  1504. saved_LIBS="$LIBS"
  1505. LIBS="$LIBS $gmplibs"
  1506. AC_MSG_CHECKING([for the correct version of the gmp/mpfr/mpc libraries])
  1507. AC_TRY_LINK([#include <mpc.h>],[
  1508. mpfr_t n;
  1509. mpfr_t x;
  1510. mpc_t c;
  1511. int t;
  1512. mpfr_init (n);
  1513. mpfr_init (x);
  1514. mpfr_atan2 (n, n, x, GMP_RNDN);
  1515. mpfr_erfc (n, x, GMP_RNDN);
  1516. mpfr_subnormalize (x, t, GMP_RNDN);
  1517. mpfr_clear(n);
  1518. mpfr_clear(x);
  1519. mpc_init2 (c, 53);
  1520. mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
  1521. mpc_cosh (c, c, MPC_RNDNN);
  1522. mpc_pow (c, c, c, MPC_RNDNN);
  1523. mpc_acosh (c, c, MPC_RNDNN);
  1524. mpc_clear (c);
  1525. ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
  1526. LIBS="$saved_LIBS"
  1527. fi
  1528. CFLAGS="$saved_CFLAGS"
  1529. # The library versions listed in the error message below should match
  1530. # the HARD-minimums enforced above.
  1531. if test x$have_gmp != xyes; then
  1532. AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
  1533. Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
  1534. their locations. Source code for these libraries can be found at
  1535. their respective hosting sites as well as at
  1536. ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
  1537. http://gcc.gnu.org/install/prerequisites.html for additional info. If
  1538. you obtained GMP, MPFR and/or MPC from a vendor distribution package,
  1539. make sure that you have installed both the libraries and the header
  1540. files. They may be located in separate packages.])
  1541. fi
  1542. fi
  1543. # Flags needed for both GMP, MPFR and/or MPC.
  1544. AC_SUBST(gmplibs)
  1545. AC_SUBST(gmpinc)
  1546. AC_SUBST(extra_mpfr_configure_flags)
  1547. AC_SUBST(extra_mpc_gmp_configure_flags)
  1548. AC_SUBST(extra_mpc_mpfr_configure_flags)
  1549. AC_SUBST(extra_isl_gmp_configure_flags)
  1550. # Libraries to use for stage1 or when not bootstrapping.
  1551. AC_ARG_WITH(stage1-libs,
  1552. [AS_HELP_STRING([--with-stage1-libs=LIBS], [libraries for stage1])],
  1553. [if test "$withval" = "no" -o "$withval" = "yes"; then
  1554. stage1_libs=
  1555. else
  1556. stage1_libs=$withval
  1557. fi],
  1558. [stage1_libs=])
  1559. AC_SUBST(stage1_libs)
  1560. # Whether or not to use -static-libstdc++ and -static-libgcc. The
  1561. # default is yes if gcc is being built; no otherwise. The reason for
  1562. # this default is that gdb is sometimes linked against GNU Source
  1563. # Highlight, which is a shared library that uses C++ exceptions. In
  1564. # this case, -static-libstdc++ will cause crashes.
  1565. AC_ARG_WITH(static-standard-libraries,
  1566. [AS_HELP_STRING([--with-static-standard-libraries],
  1567. [use -static-libstdc++ and -static-libgcc (default=auto)])],
  1568. [], [with_static_standard_libraries=auto])
  1569. if test "$with_static_standard_libraries" = auto; then
  1570. with_static_standard_libraries=$have_compiler
  1571. fi
  1572. # Linker flags to use for stage1 or when not bootstrapping.
  1573. AC_ARG_WITH(stage1-ldflags,
  1574. [AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
  1575. [if test "$withval" = "no" -o "$withval" = "yes"; then
  1576. stage1_ldflags=
  1577. else
  1578. stage1_ldflags=$withval
  1579. fi],
  1580. [stage1_ldflags=
  1581. # In stage 1, default to linking libstdc++ and libgcc statically with GCC
  1582. # if supported. But if the user explicitly specified the libraries to use,
  1583. # trust that they are doing what they want.
  1584. if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
  1585. -a "$have_static_libs" = yes; then
  1586. stage1_ldflags="-static-libstdc++ -static-libgcc"
  1587. fi])
  1588. AC_SUBST(stage1_ldflags)
  1589. # Libraries to use for stage2 and later builds.
  1590. AC_ARG_WITH(boot-libs,
  1591. [AS_HELP_STRING([--with-boot-libs=LIBS], [libraries for stage2 and later])],
  1592. [if test "$withval" = "no" -o "$withval" = "yes"; then
  1593. poststage1_libs=
  1594. else
  1595. poststage1_libs=$withval
  1596. fi],
  1597. [poststage1_libs=])
  1598. AC_SUBST(poststage1_libs)
  1599. # Linker flags to use for stage2 and later builds.
  1600. AC_ARG_WITH(boot-ldflags,
  1601. [AS_HELP_STRING([--with-boot-ldflags=FLAGS],
  1602. [linker flags for stage2 and later])],
  1603. [if test "$withval" = "no" -o "$withval" = "yes"; then
  1604. poststage1_ldflags=
  1605. else
  1606. poststage1_ldflags=$withval
  1607. fi],
  1608. [poststage1_ldflags=
  1609. # In stages 2 and 3, default to linking libstdc++ and libgcc
  1610. # statically. But if the user explicitly specified the libraries to
  1611. # use, trust that they are doing what they want.
  1612. if test "$poststage1_libs" = ""; then
  1613. poststage1_ldflags="-static-libstdc++ -static-libgcc"
  1614. fi])
  1615. AC_SUBST(poststage1_ldflags)
  1616. # GCC GRAPHITE dependency isl.
  1617. # Basic setup is inlined here, actual checks are in config/isl.m4
  1618. AC_ARG_WITH(isl,
  1619. [AS_HELP_STRING(
  1620. [--with-isl=PATH],
  1621. [Specify prefix directory for the installed isl package.
  1622. Equivalent to --with-isl-include=PATH/include
  1623. plus --with-isl-lib=PATH/lib])])
  1624. # Treat --without-isl as a request to disable
  1625. # GRAPHITE support and skip all following checks.
  1626. if test "x$with_isl" != "xno"; then
  1627. # Check for isl
  1628. dnl Provide configure switches and initialize islinc & isllibs
  1629. dnl with user input.
  1630. ISL_INIT_FLAGS
  1631. dnl The versions of isl that work for Graphite
  1632. ISL_CHECK_VERSION()
  1633. dnl Only execute fail-action, if isl has been requested.
  1634. ISL_IF_FAILED([
  1635. AC_MSG_ERROR([Unable to find a usable isl. See config.log for details.])])
  1636. fi
  1637. # If the isl check failed, disable builds of in-tree variant of isl
  1638. if test "x$with_isl" = xno ||
  1639. test "x$gcc_cv_isl" = xno; then
  1640. noconfigdirs="$noconfigdirs isl"
  1641. islinc=
  1642. fi
  1643. AC_SUBST(isllibs)
  1644. AC_SUBST(islinc)
  1645. # Check for LTO support.
  1646. AC_ARG_ENABLE(lto,
  1647. [AS_HELP_STRING([--enable-lto], [enable link time optimization support])],
  1648. enable_lto=$enableval,
  1649. enable_lto=yes; default_enable_lto=yes)
  1650. ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
  1651. build_lto_plugin=yes
  1652. ],[if test x"$default_enable_lto" = x"yes" ; then
  1653. case $target in
  1654. *-apple-darwin[[912]]* | *-cygwin* | *-mingw* | *djgpp*) ;;
  1655. # On other non-ELF platforms, LTO has yet to be validated.
  1656. *) enable_lto=no ;;
  1657. esac
  1658. else
  1659. # Apart from ELF platforms, only Windows and Darwin support LTO so far.
  1660. # It would also be nice to check the binutils support, but we don't
  1661. # have gcc_GAS_CHECK_FEATURE available here. For now, we'll just
  1662. # warn during gcc/ subconfigure; unless you're bootstrapping with
  1663. # -flto it won't be needed until after installation anyway.
  1664. case $target in
  1665. *-cygwin* | *-mingw* | *-apple-darwin* | *djgpp*) ;;
  1666. *) if test x"$enable_lto" = x"yes"; then
  1667. AC_MSG_ERROR([LTO support is not enabled for this target.])
  1668. fi
  1669. ;;
  1670. esac
  1671. fi
  1672. # Among non-ELF, only Windows platforms support the lto-plugin so far.
  1673. # Build it unless LTO was explicitly disabled.
  1674. case $target in
  1675. *-cygwin* | *-mingw*) build_lto_plugin=$enable_lto ;;
  1676. *) ;;
  1677. esac
  1678. ])
  1679. AC_ARG_ENABLE(linker-plugin-configure-flags,
  1680. [AS_HELP_STRING([[--enable-linker-plugin-configure-flags=FLAGS]],
  1681. [additional flags for configuring linker plugins @<:@none@:>@])],
  1682. extra_linker_plugin_configure_flags=$enableval,
  1683. extra_linker_plugin_configure_flags=)
  1684. AC_SUBST(extra_linker_plugin_configure_flags)
  1685. AC_ARG_ENABLE(linker-plugin-flags,
  1686. [AS_HELP_STRING([[--enable-linker-plugin-flags=FLAGS]],
  1687. [additional flags for configuring and building linker plugins @<:@none@:>@])],
  1688. extra_linker_plugin_flags=$enableval,
  1689. extra_linker_plugin_flags=)
  1690. AC_SUBST(extra_linker_plugin_flags)
  1691. # Enable --enable-host-shared.
  1692. # Checked early to determine whether jit is an 'all' language
  1693. AC_ARG_ENABLE(host-shared,
  1694. [AS_HELP_STRING([--enable-host-shared],
  1695. [build host code as shared libraries])],
  1696. [host_shared=$enableval], [host_shared=no])
  1697. AC_SUBST(host_shared)
  1698. # By default, C and C++ are the only stage 1 languages.
  1699. stage1_languages=,c,
  1700. # Target libraries that we bootstrap.
  1701. bootstrap_target_libs=,target-libgcc,
  1702. # Figure out what language subdirectories are present.
  1703. # Look if the user specified --enable-languages="..."; if not, use
  1704. # the environment variable $LANGUAGES if defined. $LANGUAGES might
  1705. # go away some day.
  1706. # NB: embedded tabs in this IF block -- do not untabify
  1707. if test -d ${srcdir}/gcc; then
  1708. if test x"${enable_languages+set}" != xset; then
  1709. if test x"${LANGUAGES+set}" = xset; then
  1710. enable_languages="${LANGUAGES}"
  1711. echo configure.ac: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
  1712. else
  1713. enable_languages=default
  1714. fi
  1715. else
  1716. if test x"${enable_languages}" = x ||
  1717. test x"${enable_languages}" = xyes;
  1718. then
  1719. echo configure.ac: --enable-languages needs at least one language argument 1>&2
  1720. exit 1
  1721. fi
  1722. fi
  1723. enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
  1724. # 'f95' is the old name for the 'fortran' language. We issue a warning
  1725. # and make the substitution.
  1726. case ,${enable_languages}, in
  1727. *,f95,*)
  1728. echo configure.ac: warning: 'f95' as language name is deprecated, use 'fortran' instead 1>&2
  1729. enable_languages=`echo "${enable_languages}" | sed -e 's/f95/fortran/g'`
  1730. ;;
  1731. esac
  1732. # If bootstrapping, C++ must be enabled.
  1733. case ",$enable_languages,:$enable_bootstrap" in
  1734. *,c++,*:*) ;;
  1735. *:yes)
  1736. if test -f ${srcdir}/gcc/cp/config-lang.in; then
  1737. enable_languages="${enable_languages},c++"
  1738. else
  1739. AC_MSG_ERROR([bootstrapping requires c++ sources])
  1740. fi
  1741. ;;
  1742. esac
  1743. # First scan to see if an enabled language requires some other language.
  1744. # We assume that a given config-lang.in will list all the language
  1745. # front ends it requires, even if some are required indirectly.
  1746. for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
  1747. case ${lang_frag} in
  1748. ..) ;;
  1749. # The odd quoting in the next line works around
  1750. # an apparent bug in bash 1.12 on linux.
  1751. ${srcdir}/gcc/[[*]]/config-lang.in) ;;
  1752. *)
  1753. # From the config-lang.in, get $language, $lang_requires, and
  1754. # $lang_requires_boot_languages.
  1755. language=
  1756. lang_requires=
  1757. lang_requires_boot_languages=
  1758. # set srcdir during sourcing lang_frag to the gcc dir.
  1759. # Sadly overriding srcdir on the . line doesn't work in plain sh as it
  1760. # polutes this shell
  1761. saved_srcdir=${srcdir}
  1762. srcdir=${srcdir}/gcc . ${lang_frag}
  1763. srcdir=${saved_srcdir}
  1764. for other in ${lang_requires} ${lang_requires_boot_languages}; do
  1765. case ,${enable_languages}, in
  1766. *,$other,*) ;;
  1767. *,default,*) ;;
  1768. *,all,*) ;;
  1769. *,$language,*)
  1770. echo " \`$other' language required by \`$language'; enabling" 1>&2
  1771. enable_languages="${enable_languages},${other}"
  1772. ;;
  1773. esac
  1774. done
  1775. for other in ${lang_requires_boot_languages} ; do
  1776. if test "$other" != "c"; then
  1777. case ,${enable_stage1_languages}, in
  1778. *,$other,*) ;;
  1779. *,default,*) ;;
  1780. *,all,*) ;;
  1781. *)
  1782. case ,${enable_languages}, in
  1783. *,$language,*)
  1784. echo " '$other' language required by '$language' in stage 1; enabling" 1>&2
  1785. enable_stage1_languages="$enable_stage1_languages,${other}"
  1786. ;;
  1787. esac
  1788. ;;
  1789. esac
  1790. fi
  1791. done
  1792. ;;
  1793. esac
  1794. done
  1795. new_enable_languages=,c,
  1796. # If LTO is enabled, add the LTO front end.
  1797. if test "$enable_lto" = "yes" ; then
  1798. case ,${enable_languages}, in
  1799. *,lto,*) ;;
  1800. *) enable_languages="${enable_languages},lto" ;;
  1801. esac
  1802. if test "${build_lto_plugin}" = "yes" ; then
  1803. configdirs="$configdirs lto-plugin"
  1804. fi
  1805. fi
  1806. # If we're building an offloading compiler, add the LTO front end.
  1807. if test x"$enable_as_accelerator_for" != x ; then
  1808. case ,${enable_languages}, in
  1809. *,lto,*) ;;
  1810. *) enable_languages="${enable_languages},lto" ;;
  1811. esac
  1812. fi
  1813. missing_languages=`echo ",$enable_languages," | sed -e s/,default,/,/ -e s/,all,/,/ -e s/,c,/,/ `
  1814. potential_languages=,c,
  1815. enabled_target_libs=
  1816. disabled_target_libs=
  1817. for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
  1818. case ${lang_frag} in
  1819. ..) ;;
  1820. # The odd quoting in the next line works around
  1821. # an apparent bug in bash 1.12 on linux.
  1822. ${srcdir}/gcc/[[*]]/config-lang.in) ;;
  1823. *)
  1824. # From the config-lang.in, get $language, $target_libs,
  1825. # $lang_dirs, $boot_language, and $build_by_default
  1826. language=
  1827. target_libs=
  1828. lang_dirs=
  1829. subdir_requires=
  1830. boot_language=no
  1831. build_by_default=yes
  1832. # set srcdir during sourcing. See above about save & restore
  1833. saved_srcdir=${srcdir}
  1834. srcdir=${srcdir}/gcc . ${lang_frag}
  1835. srcdir=${saved_srcdir}
  1836. if test x${language} = x; then
  1837. echo "${lang_frag} doesn't set \$language." 1>&2
  1838. exit 1
  1839. fi
  1840. if test "$language" = "c++"; then
  1841. boot_language=yes
  1842. fi
  1843. add_this_lang=no
  1844. # C is always enabled, so no need to add it again
  1845. if test "$language" != "c"; then
  1846. case ,${enable_languages}, in
  1847. *,${language},*)
  1848. # Language was explicitly selected; include it
  1849. add_this_lang=yes
  1850. ;;
  1851. *,all,*)
  1852. # All languages are enabled
  1853. add_this_lang=all
  1854. ;;
  1855. *,default,*)
  1856. # 'default' was selected, select it if it is a default language
  1857. add_this_lang=${build_by_default}
  1858. ;;
  1859. esac
  1860. fi
  1861. # Disable languages that need other directories if these aren't available.
  1862. for i in $subdir_requires; do
  1863. test -f "$srcdir/gcc/$i/config-lang.in" && continue
  1864. case ${add_this_lang} in
  1865. yes)
  1866. # Specifically requested language; tell them.
  1867. AC_MSG_ERROR([The gcc/$i directory contains parts of $language but is missing])
  1868. ;;
  1869. all)
  1870. AC_MSG_WARN([The gcc/$i directory contains parts of $language but is missing])
  1871. add_this_lang=unsupported
  1872. ;;
  1873. *)
  1874. # Silently disable.
  1875. add_this_lang=unsupported
  1876. ;;
  1877. esac
  1878. done
  1879. # Disable Ada if no preexisting GNAT is available.
  1880. case ${add_this_lang}:${language}:${have_gnat} in
  1881. yes:ada:no)
  1882. # Specifically requested language; tell them.
  1883. AC_MSG_ERROR([GNAT is required to build $language])
  1884. ;;
  1885. all:ada:no)
  1886. AC_MSG_WARN([GNAT is required to build $language])
  1887. add_this_lang=unsupported
  1888. ;;
  1889. *:ada:no)
  1890. # Silently disable.
  1891. add_this_lang=unsupported
  1892. ;;
  1893. esac
  1894. # Disable jit if -enable-host-shared not specified
  1895. case ${add_this_lang}:${language}:${host_shared} in
  1896. yes:jit:no)
  1897. # PR jit/64780: explicitly specify --enable-host-shared
  1898. AC_MSG_ERROR([
  1899. Enabling language "jit" requires --enable-host-shared.
  1900. --enable-host-shared typically slows the rest of the compiler down by
  1901. a few %, so you must explicitly enable it.
  1902. If you want to build both the jit and the regular compiler, it is often
  1903. best to do this via two separate configure/builds, in separate
  1904. directories, to avoid imposing the performance cost of
  1905. --enable-host-shared on the regular compiler.])
  1906. ;;
  1907. all:jit:no)
  1908. AC_MSG_WARN([--enable-host-shared required to build $language])
  1909. add_this_lang=unsupported
  1910. ;;
  1911. *:jit:no)
  1912. # Silently disable.
  1913. add_this_lang=unsupported
  1914. ;;
  1915. esac
  1916. # Disable a language that is unsupported by the target.
  1917. case "${add_this_lang}: $unsupported_languages " in
  1918. no:*) ;;
  1919. unsupported:*) ;;
  1920. *:*" $language "*)
  1921. AC_MSG_WARN([${language} not supported for this target])
  1922. add_this_lang=unsupported
  1923. ;;
  1924. esac
  1925. case $add_this_lang in
  1926. unsupported)
  1927. # Remove language-dependent dirs.
  1928. disabled_target_libs="$disabled_target_libs $target_libs"
  1929. noconfigdirs="$noconfigdirs $lang_dirs"
  1930. ;;
  1931. no)
  1932. # Remove language-dependent dirs; still show language as supported.
  1933. disabled_target_libs="$disabled_target_libs $target_libs"
  1934. noconfigdirs="$noconfigdirs $lang_dirs"
  1935. potential_languages="${potential_languages}${language},"
  1936. ;;
  1937. all|yes)
  1938. new_enable_languages="${new_enable_languages}${language},"
  1939. potential_languages="${potential_languages}${language},"
  1940. missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
  1941. enabled_target_libs="$enabled_target_libs $target_libs"
  1942. case "${boot_language}:,$enable_stage1_languages," in
  1943. yes:* | *:*,$language,* | *:*,yes, | *:*,all,)
  1944. # Add to (comma-separated) list of stage 1 languages.
  1945. case ",$stage1_languages," in
  1946. *,$language,* | ,yes, | ,all,) ;;
  1947. *) stage1_languages="${stage1_languages}${language}," ;;
  1948. esac
  1949. # We need to bootstrap any supporting libraries.
  1950. bootstrap_target_libs="${bootstrap_target_libs}${target_libs},"
  1951. ;;
  1952. esac
  1953. ;;
  1954. esac
  1955. ;;
  1956. esac
  1957. done
  1958. # Add target libraries which are only needed for disabled languages
  1959. # to noconfigdirs.
  1960. if test -n "$disabled_target_libs"; then
  1961. for dir in $disabled_target_libs; do
  1962. case " $enabled_target_libs " in
  1963. *" ${dir} "*) ;;
  1964. *) noconfigdirs="$noconfigdirs $dir" ;;
  1965. esac
  1966. done
  1967. fi
  1968. AC_ARG_ENABLE(stage1-languages,
  1969. [AS_HELP_STRING([[--enable-stage1-languages[=all]]],
  1970. [choose additional languages to build during
  1971. stage1. Mostly useful for compiler development])],
  1972. [case ,${enable_stage1_languages}, in
  1973. ,no,|,,)
  1974. # Set it to something that will have no effect in the loop below
  1975. enable_stage1_languages=c ;;
  1976. ,yes,)
  1977. enable_stage1_languages=`echo $new_enable_languages | \
  1978. sed -e "s/^,//" -e "s/,$//" ` ;;
  1979. *,all,*)
  1980. enable_stage1_languages=`echo ,$enable_stage1_languages, | \
  1981. sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;;
  1982. esac
  1983. # Add "good" languages from enable_stage1_languages to stage1_languages,
  1984. # while "bad" languages go in missing_languages. Leave no duplicates.
  1985. for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do
  1986. case $potential_languages in
  1987. *,$i,*)
  1988. case $stage1_languages in
  1989. *,$i,*) ;;
  1990. *) stage1_languages="$stage1_languages$i," ;;
  1991. esac ;;
  1992. *)
  1993. case $missing_languages in
  1994. *,$i,*) ;;
  1995. *) missing_languages="$missing_languages$i," ;;
  1996. esac ;;
  1997. esac
  1998. done])
  1999. # Remove leading/trailing commas that were added for simplicity
  2000. potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"`
  2001. missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"`
  2002. stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"`
  2003. new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"`
  2004. if test "x$missing_languages" != x; then
  2005. AC_MSG_ERROR([
  2006. The following requested languages could not be built: ${missing_languages}
  2007. Supported languages are: ${potential_languages}])
  2008. fi
  2009. if test "x$new_enable_languages" != "x$enable_languages"; then
  2010. echo The following languages will be built: ${new_enable_languages}
  2011. enable_languages="$new_enable_languages"
  2012. fi
  2013. AC_SUBST(stage1_languages)
  2014. ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[[^ ]]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" `
  2015. fi
  2016. # Handle --disable-<component> generically.
  2017. for dir in $configdirs $build_configdirs $target_configdirs ; do
  2018. dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
  2019. varname=`echo $dirname | sed -e s/+/_/g`
  2020. if eval test x\${enable_${varname}} "=" xno ; then
  2021. noconfigdirs="$noconfigdirs $dir"
  2022. fi
  2023. done
  2024. # Check for Boehm's garbage collector
  2025. AC_ARG_ENABLE(objc-gc,
  2026. [AS_HELP_STRING([--enable-objc-gc],
  2027. [enable use of Boehm's garbage collector with the
  2028. GNU Objective-C runtime])])
  2029. AC_ARG_WITH([target-bdw-gc],
  2030. [AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
  2031. [specify prefix directory for installed bdw-gc package.
  2032. Equivalent to --with-target-bdw-gc-include=PATH/include
  2033. plus --with-target-bdw-gc-lib=PATH/lib])])
  2034. AC_ARG_WITH([target-bdw-gc-include],
  2035. [AS_HELP_STRING([--with-target-bdw-gc-include=PATHLIST],
  2036. [specify directories for installed bdw-gc include files])])
  2037. AC_ARG_WITH([target-bdw-gc-lib],
  2038. [AS_HELP_STRING([--with-target-bdw-gc-lib=PATHLIST],
  2039. [specify directories for installed bdw-gc library])])
  2040. case ,${enable_languages},:${enable_objc_gc} in *,objc,*:yes|*,objc,*:auto)
  2041. AC_MSG_CHECKING([for bdw garbage collector])
  2042. if test "x$with_target_bdw_gc$with_target_bdw_gc_include$with_target_bdw_gc_lib" = x; then
  2043. dnl no bdw-gw options, assume default locations
  2044. AC_MSG_RESULT([using bdw-gc in default locations])
  2045. else
  2046. dnl bdw-gw options, first error checking, complete checking in libobjc
  2047. if test "x$with_target_bdw_gc_include" = x && test "x$with_target_bdw_gc_lib" != x; then
  2048. AC_MSG_ERROR([found --with-target-bdw-gc-lib but --with-target-bdw-gc-include missing])
  2049. elif test "x$with_target_bdw_gc_include" != x && test "x$with_target_bdw_gc_lib" = x; then
  2050. AC_MSG_ERROR([found --with-target-bdw-gc-include but --with-target-bdw-gc-lib missing])
  2051. else
  2052. AC_MSG_RESULT([using paths configured with --with-target-bdw-gc options])
  2053. fi
  2054. fi
  2055. esac
  2056. # Disable libitm, libsanitizer, libvtv, liboffloadmic if we're not building C++
  2057. case ,${enable_languages}, in
  2058. *,c++,*)
  2059. # Disable libitm, libsanitizer if we're not building libstdc++
  2060. case "${noconfigdirs}" in
  2061. *target-libstdc++-v3*)
  2062. noconfigdirs="$noconfigdirs target-libitm target-libsanitizer"
  2063. ;;
  2064. *) ;;
  2065. esac
  2066. ;;
  2067. *)
  2068. noconfigdirs="$noconfigdirs target-liboffloadmic target-libitm target-libsanitizer target-libvtv"
  2069. ;;
  2070. esac
  2071. # If gcc/ is not in the source tree then we'll not be building a
  2072. # target compiler, assume in that case we don't want to build any
  2073. # target libraries or tools.
  2074. #
  2075. # This was added primarily for the benefit for binutils-gdb who reuse
  2076. # this configure script, but don't always have target tools available.
  2077. if test ! -d ${srcdir}/gcc; then
  2078. skipdirs="${skipdirs} ${target_configdirs}"
  2079. fi
  2080. # Remove the entries in $skipdirs and $noconfigdirs from $configdirs,
  2081. # $build_configdirs and $target_configdirs.
  2082. # If we have the source for $noconfigdirs entries, add them to $notsupp.
  2083. notsupp=""
  2084. for dir in . $skipdirs $noconfigdirs ; do
  2085. dirname=`echo $dir | sed -e s/target-//g -e s/build-//g`
  2086. if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
  2087. configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
  2088. if test -r $srcdir/$dirname/configure ; then
  2089. if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
  2090. true
  2091. else
  2092. notsupp="$notsupp $dir"
  2093. fi
  2094. fi
  2095. fi
  2096. if test $dir != . && echo " ${build_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
  2097. build_configdirs=`echo " ${build_configdirs} " | sed -e "s/ ${dir} / /"`
  2098. if test -r $srcdir/$dirname/configure ; then
  2099. if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
  2100. true
  2101. else
  2102. notsupp="$notsupp $dir"
  2103. fi
  2104. fi
  2105. fi
  2106. if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
  2107. target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
  2108. if test -r $srcdir/$dirname/configure ; then
  2109. if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
  2110. true
  2111. else
  2112. notsupp="$notsupp $dir"
  2113. fi
  2114. fi
  2115. fi
  2116. done
  2117. # Quietly strip out all directories which aren't configurable in this tree.
  2118. # This relies on all configurable subdirectories being autoconfiscated, which
  2119. # is now the case.
  2120. build_configdirs_all="$build_configdirs"
  2121. build_configdirs=
  2122. for i in ${build_configdirs_all} ; do
  2123. j=`echo $i | sed -e s/build-//g`
  2124. if test -f ${srcdir}/$j/configure ; then
  2125. build_configdirs="${build_configdirs} $i"
  2126. fi
  2127. done
  2128. configdirs_all="$configdirs"
  2129. configdirs=
  2130. for i in ${configdirs_all} ; do
  2131. if test -f ${srcdir}/$i/configure ; then
  2132. configdirs="${configdirs} $i"
  2133. fi
  2134. done
  2135. target_configdirs_all="$target_configdirs"
  2136. target_configdirs=
  2137. for i in ${target_configdirs_all} ; do
  2138. j=`echo $i | sed -e s/target-//g`
  2139. if test -f ${srcdir}/$j/configure ; then
  2140. target_configdirs="${target_configdirs} $i"
  2141. fi
  2142. done
  2143. # libiberty-linker-plugin is special: it doesn't have its own source directory,
  2144. # so we have to add it after the preceding checks.
  2145. if test x"$extra_linker_plugin_flags$extra_linker_plugin_configure_flags" != x
  2146. then
  2147. case " $configdirs " in
  2148. *" libiberty "*)
  2149. # If we can build libiberty, we can also build libiberty-linker-plugin.
  2150. configdirs="$configdirs libiberty-linker-plugin"
  2151. extra_linker_plugin_configure_flags="$extra_linker_plugin_configure_flags \
  2152. --with-libiberty=../libiberty-linker-plugin";;
  2153. *)
  2154. AC_MSG_ERROR([libiberty missing]);;
  2155. esac
  2156. fi
  2157. # Sometimes we have special requirements for the host libiberty.
  2158. extra_host_libiberty_configure_flags=
  2159. extra_host_zlib_configure_flags=
  2160. case " $configdirs " in
  2161. *" lto-plugin "* | *" libcc1 "*)
  2162. # When these are to be built as shared libraries, the same applies to
  2163. # libiberty.
  2164. extra_host_libiberty_configure_flags=--enable-shared
  2165. ;;
  2166. *" bfd "*)
  2167. # When bfd is to be built as a shared library, the same applies to
  2168. # zlib.
  2169. if test "$enable_shared" = "yes"; then
  2170. extra_host_zlib_configure_flags=--enable-host-shared
  2171. fi
  2172. ;;
  2173. esac
  2174. AC_SUBST(extra_host_libiberty_configure_flags)
  2175. AC_SUBST(extra_host_zlib_configure_flags)
  2176. # Produce a warning message for the subdirs we can't configure.
  2177. # This isn't especially interesting in the Cygnus tree, but in the individual
  2178. # FSF releases, it's important to let people know when their machine isn't
  2179. # supported by the one or two programs in a package.
  2180. if test -n "${notsupp}" && test -z "${norecursion}" ; then
  2181. # If $appdirs is non-empty, at least one of those directories must still
  2182. # be configured, or we error out. (E.g., if the gas release supports a
  2183. # specified target in some subdirs but not the gas subdir, we shouldn't
  2184. # pretend that all is well.)
  2185. if test -n "$appdirs" ; then
  2186. for dir in $appdirs ; do
  2187. if test -r $dir/Makefile.in ; then
  2188. if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
  2189. appdirs=""
  2190. break
  2191. fi
  2192. if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then
  2193. appdirs=""
  2194. break
  2195. fi
  2196. fi
  2197. done
  2198. if test -n "$appdirs" ; then
  2199. echo "*** This configuration is not supported by this package." 1>&2
  2200. exit 1
  2201. fi
  2202. fi
  2203. # Okay, some application will build, or we don't care to check. Still
  2204. # notify of subdirs not getting built.
  2205. echo "*** This configuration is not supported in the following subdirectories:" 1>&2
  2206. echo " ${notsupp}" 1>&2
  2207. echo " (Any other directories should still work fine.)" 1>&2
  2208. fi
  2209. case "$host" in
  2210. *msdosdjgpp*)
  2211. enable_gdbtk=no ;;
  2212. esac
  2213. # To find our prefix, in gcc_cv_tool_prefix.
  2214. ACX_TOOL_DIRS
  2215. copy_dirs=
  2216. AC_ARG_WITH([build-sysroot],
  2217. [AS_HELP_STRING([--with-build-sysroot=SYSROOT],
  2218. [use sysroot as the system root during the build])],
  2219. [if test x"$withval" != x ; then
  2220. SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
  2221. fi],
  2222. [SYSROOT_CFLAGS_FOR_TARGET=])
  2223. AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
  2224. AC_ARG_WITH([debug-prefix-map],
  2225. [AS_HELP_STRING([--with-debug-prefix-map='A=B C=D ...'],
  2226. [map A to B, C to D ... in debug information])],
  2227. [if test x"$withval" != x; then
  2228. DEBUG_PREFIX_CFLAGS_FOR_TARGET=
  2229. for debug_map in $withval; do
  2230. DEBUG_PREFIX_CFLAGS_FOR_TARGET="$DEBUG_PREFIX_CFLAGS_FOR_TARGET -fdebug-prefix-map=$debug_map"
  2231. done
  2232. fi],
  2233. [DEBUG_PREFIX_CFLAGS_FOR_TARGET=])
  2234. AC_SUBST(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
  2235. # During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
  2236. # might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
  2237. # might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
  2238. # We want to ensure that TARGET libraries (which we know are built with
  2239. # gcc) are built with "-O2 -g", so include those options when setting
  2240. # CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
  2241. if test "x$CFLAGS_FOR_TARGET" = x; then
  2242. if test "x${is_cross_compiler}" = xyes; then
  2243. CFLAGS_FOR_TARGET="-g -O2"
  2244. else
  2245. CFLAGS_FOR_TARGET=$CFLAGS
  2246. case " $CFLAGS " in
  2247. *" -O2 "*) ;;
  2248. *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
  2249. esac
  2250. case " $CFLAGS " in
  2251. *" -g "* | *" -g3 "*) ;;
  2252. *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
  2253. esac
  2254. fi
  2255. fi
  2256. AC_SUBST(CFLAGS_FOR_TARGET)
  2257. if test "x$CXXFLAGS_FOR_TARGET" = x; then
  2258. if test "x${is_cross_compiler}" = xyes; then
  2259. CXXFLAGS_FOR_TARGET="-g -O2"
  2260. else
  2261. CXXFLAGS_FOR_TARGET=$CXXFLAGS
  2262. case " $CXXFLAGS " in
  2263. *" -O2 "*) ;;
  2264. *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
  2265. esac
  2266. case " $CXXFLAGS " in
  2267. *" -g "* | *" -g3 "*) ;;
  2268. *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
  2269. esac
  2270. fi
  2271. fi
  2272. AC_SUBST(CXXFLAGS_FOR_TARGET)
  2273. AC_SUBST(LDFLAGS_FOR_TARGET)
  2274. # Handle --with-headers=XXX. If the value is not "yes", the contents of
  2275. # the named directory are copied to $(tooldir)/sys-include.
  2276. if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
  2277. if test x${is_cross_compiler} = xno ; then
  2278. echo 1>&2 '***' --with-headers is only supported when cross compiling
  2279. exit 1
  2280. fi
  2281. if test x"${with_headers}" != xyes ; then
  2282. x=${gcc_cv_tool_prefix}
  2283. copy_dirs="${copy_dirs} ${with_headers} $x/${target_noncanonical}/sys-include"
  2284. fi
  2285. fi
  2286. # Handle --with-libs=XXX. If the value is not "yes", the contents of
  2287. # the name directories are copied to $(tooldir)/lib. Multiple directories
  2288. # are permitted.
  2289. if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
  2290. if test x${is_cross_compiler} = xno ; then
  2291. echo 1>&2 '***' --with-libs is only supported when cross compiling
  2292. exit 1
  2293. fi
  2294. if test x"${with_libs}" != xyes ; then
  2295. # Copy the libraries in reverse order, so that files in the first named
  2296. # library override files in subsequent libraries.
  2297. x=${gcc_cv_tool_prefix}
  2298. for l in ${with_libs}; do
  2299. copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}"
  2300. done
  2301. fi
  2302. fi
  2303. # Set with_gnu_as, with_gnu_ld, and with_system_zlib as appropriate.
  2304. #
  2305. # This is done by determining whether or not the appropriate directory
  2306. # is available, and by checking whether or not specific configurations
  2307. # have requested that this magic not happen.
  2308. #
  2309. # The command line options always override the explicit settings in
  2310. # configure.ac, and the settings in configure.ac override this magic.
  2311. #
  2312. # If the default for a toolchain is to use GNU as and ld, and you don't
  2313. # want to do that, then you should use the --without-gnu-as and
  2314. # --without-gnu-ld options for the configure script. Similarly, if
  2315. # the default is to use the included zlib and you don't want to do that,
  2316. # you should use the --with-system-zlib option for the configure script.
  2317. if test x${use_gnu_as} = x &&
  2318. echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
  2319. with_gnu_as=yes
  2320. extra_host_args="$extra_host_args --with-gnu-as"
  2321. fi
  2322. if test x${use_gnu_ld} = x &&
  2323. echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then
  2324. with_gnu_ld=yes
  2325. extra_host_args="$extra_host_args --with-gnu-ld"
  2326. fi
  2327. if test x${use_included_zlib} = x &&
  2328. echo " ${configdirs} " | grep " zlib " > /dev/null 2>&1 ; then
  2329. :
  2330. else
  2331. with_system_zlib=yes
  2332. extra_host_args="$extra_host_args --with-system-zlib"
  2333. fi
  2334. # If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
  2335. # can detect this case.
  2336. if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
  2337. with_newlib=yes
  2338. extra_host_args="$extra_host_args --with-newlib"
  2339. fi
  2340. # Handle ${copy_dirs}
  2341. set fnord ${copy_dirs}
  2342. shift
  2343. while test $# != 0 ; do
  2344. if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then
  2345. :
  2346. else
  2347. echo Copying $1 to $2
  2348. # Use the install script to create the directory and all required
  2349. # parent directories.
  2350. if test -d $2 ; then
  2351. :
  2352. else
  2353. echo >config.temp
  2354. ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
  2355. fi
  2356. # Copy the directory, assuming we have tar.
  2357. # FIXME: Should we use B in the second tar? Not all systems support it.
  2358. (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
  2359. # It is the responsibility of the user to correctly adjust all
  2360. # symlinks. If somebody can figure out how to handle them correctly
  2361. # here, feel free to add the code.
  2362. echo $1 > $2/COPIED
  2363. fi
  2364. shift; shift
  2365. done
  2366. # Determine a target-dependent exec_prefix that the installed
  2367. # gcc will search in. Keep this list sorted by triplet, with
  2368. # the *-*-osname triplets last.
  2369. md_exec_prefix=
  2370. case "${target}" in
  2371. i[[34567]]86-pc-msdosdjgpp*)
  2372. md_exec_prefix=/dev/env/DJDIR/bin
  2373. ;;
  2374. *-*-hpux* | \
  2375. *-*-nto-qnx* | \
  2376. *-*-solaris2*)
  2377. md_exec_prefix=/usr/ccs/bin
  2378. ;;
  2379. esac
  2380. extra_arflags_for_target=
  2381. extra_nmflags_for_target=
  2382. extra_ranlibflags_for_target=
  2383. target_makefile_frag=/dev/null
  2384. case "${target}" in
  2385. spu-*-*)
  2386. target_makefile_frag="config/mt-spu"
  2387. ;;
  2388. mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
  2389. target_makefile_frag="config/mt-sde"
  2390. ;;
  2391. mipsisa*-*-elfoabi*)
  2392. target_makefile_frag="config/mt-mips-elfoabi"
  2393. ;;
  2394. mips*-*-*linux* | mips*-*-gnu*)
  2395. target_makefile_frag="config/mt-mips-gnu"
  2396. ;;
  2397. nios2-*-elf*)
  2398. target_makefile_frag="config/mt-nios2-elf"
  2399. ;;
  2400. *-*-linux-android*)
  2401. target_makefile_frag="config/mt-android"
  2402. ;;
  2403. *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
  2404. target_makefile_frag="config/mt-gnu"
  2405. ;;
  2406. *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
  2407. # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm
  2408. # commands to handle both 32-bit and 64-bit objects. These flags are
  2409. # harmless if we're using GNU nm or ar.
  2410. extra_arflags_for_target=" -X32_64"
  2411. extra_nmflags_for_target=" -B -X32_64"
  2412. ;;
  2413. esac
  2414. alphaieee_frag=/dev/null
  2415. case $target in
  2416. alpha*-*-*)
  2417. # This just makes sure to use the -mieee option to build target libs.
  2418. # This should probably be set individually by each library.
  2419. alphaieee_frag="config/mt-alphaieee"
  2420. ;;
  2421. esac
  2422. # If --enable-target-optspace always use -Os instead of -O2 to build
  2423. # the target libraries, similarly if it is not specified, use -Os
  2424. # on selected platforms.
  2425. ospace_frag=/dev/null
  2426. case "${enable_target_optspace}:${target}" in
  2427. yes:*)
  2428. ospace_frag="config/mt-ospace"
  2429. ;;
  2430. :d30v-*)
  2431. ospace_frag="config/mt-d30v"
  2432. ;;
  2433. :m32r-* | :d10v-* | :fr30-* | :i?86*-*-elfiamcu)
  2434. ospace_frag="config/mt-ospace"
  2435. ;;
  2436. no:* | :*)
  2437. ;;
  2438. *)
  2439. echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
  2440. ;;
  2441. esac
  2442. # Some systems (e.g., one of the i386-aix systems the gas testers are
  2443. # using) don't handle "\$" correctly, so don't use it here.
  2444. tooldir='${exec_prefix}'/${target_noncanonical}
  2445. build_tooldir=${tooldir}
  2446. # Create a .gdbinit file which runs the one in srcdir
  2447. # and tells GDB to look there for source files.
  2448. if test -r ${srcdir}/.gdbinit ; then
  2449. case ${srcdir} in
  2450. .) ;;
  2451. *) cat > ./.gdbinit <<EOF
  2452. # ${NO_EDIT}
  2453. dir ${srcdir}
  2454. dir .
  2455. source ${srcdir}/.gdbinit
  2456. EOF
  2457. ;;
  2458. esac
  2459. fi
  2460. # Make sure that the compiler is able to generate an executable. If it
  2461. # can't, we are probably in trouble. We don't care whether we can run the
  2462. # executable--we might be using a cross compiler--we only care whether it
  2463. # can be created. At this point the main configure script has set CC.
  2464. we_are_ok=no
  2465. echo "int main () { return 0; }" > conftest.c
  2466. ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
  2467. if test $? = 0 ; then
  2468. if test -s conftest || test -s conftest.exe ; then
  2469. we_are_ok=yes
  2470. fi
  2471. fi
  2472. case $we_are_ok in
  2473. no)
  2474. echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
  2475. echo 1>&2 "*** You must set the environment variable CC to a working compiler."
  2476. rm -f conftest*
  2477. exit 1
  2478. ;;
  2479. esac
  2480. rm -f conftest*
  2481. # Decide which environment variable is used to find dynamic libraries.
  2482. case "${host}" in
  2483. *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
  2484. *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
  2485. *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
  2486. *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
  2487. esac
  2488. # On systems where the dynamic library environment variable is PATH,
  2489. # gcc/ will put dynamic libraries into a subdirectory to avoid adding
  2490. # built executables to PATH.
  2491. if test "$RPATH_ENVVAR" = PATH; then
  2492. GCC_SHLIB_SUBDIR=/shlib
  2493. else
  2494. GCC_SHLIB_SUBDIR=
  2495. fi
  2496. # Adjust the toplevel makefile according to whether bootstrap was selected.
  2497. case $enable_bootstrap in
  2498. yes)
  2499. bootstrap_suffix=bootstrap
  2500. BUILD_CONFIG=bootstrap-debug
  2501. ;;
  2502. no)
  2503. bootstrap_suffix=no-bootstrap
  2504. BUILD_CONFIG=
  2505. ;;
  2506. esac
  2507. AC_MSG_CHECKING(for default BUILD_CONFIG)
  2508. AC_ARG_WITH([build-config],
  2509. [AS_HELP_STRING([--with-build-config='NAME NAME2...'],
  2510. [use config/NAME.mk build configuration])],
  2511. [case $with_build_config in
  2512. yes) with_build_config= ;;
  2513. no) with_build_config= BUILD_CONFIG= ;;
  2514. esac])
  2515. if test "x${with_build_config}" != x; then
  2516. BUILD_CONFIG=$with_build_config
  2517. else
  2518. case $BUILD_CONFIG in
  2519. bootstrap-debug)
  2520. if echo "int f (void) { return 0; }" > conftest.c &&
  2521. ${CC} -c conftest.c &&
  2522. mv conftest.o conftest.o.g0 &&
  2523. ${CC} -c -g conftest.c &&
  2524. mv conftest.o conftest.o.g &&
  2525. ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > /dev/null 2>&1; then
  2526. :
  2527. else
  2528. BUILD_CONFIG=
  2529. fi
  2530. rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
  2531. ;;
  2532. esac
  2533. fi
  2534. AC_MSG_RESULT($BUILD_CONFIG)
  2535. AC_SUBST(BUILD_CONFIG)
  2536. # Use same top-level configure hooks in libgcc/libstdc++/libvtv.
  2537. AC_MSG_CHECKING([for --enable-vtable-verify])
  2538. AC_ARG_ENABLE(vtable-verify,
  2539. [AS_HELP_STRING([--enable-vtable-verify],
  2540. [Enable vtable verification feature])],
  2541. [case "$enableval" in
  2542. yes) enable_vtable_verify=yes ;;
  2543. no) enable_vtable_verify=no ;;
  2544. *) enable_vtable_verify=no;;
  2545. esac],
  2546. [enable_vtable_verify=no])
  2547. AC_MSG_RESULT($enable_vtable_verify)
  2548. # Record target_configdirs and the configure arguments for target and
  2549. # build configuration in Makefile.
  2550. target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
  2551. build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'`
  2552. bootstrap_fixincludes=no
  2553. # If we are building libgomp, bootstrap it.
  2554. if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then
  2555. bootstrap_target_libs=${bootstrap_target_libs}target-libgomp,
  2556. fi
  2557. # If we are building libsanitizer and $BUILD_CONFIG contains bootstrap-asan
  2558. # or bootstrap-ubsan, bootstrap it.
  2559. if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1; then
  2560. case "$BUILD_CONFIG" in
  2561. *bootstrap-asan* | *bootstrap-ubsan* )
  2562. bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
  2563. bootstrap_fixincludes=yes
  2564. ;;
  2565. esac
  2566. fi
  2567. # If we are building libvtv and --enable-vtable-verify, bootstrap it.
  2568. if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
  2569. test "$enable_vtable_verify" != no; then
  2570. bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
  2571. fi
  2572. # Determine whether gdb needs tk/tcl or not.
  2573. # Use 'maybe' since enable_gdbtk might be true even if tk isn't available
  2574. # and in that case we want gdb to be built without tk. Ugh!
  2575. # In fact I believe gdb is the *only* package directly dependent on tk,
  2576. # so we should be able to put the 'maybe's in unconditionally and
  2577. # leave out the maybe dependencies when enable_gdbtk is false. I'm not
  2578. # 100% sure that that's safe though.
  2579. gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-libgui"
  2580. case "$enable_gdbtk" in
  2581. no)
  2582. GDB_TK="" ;;
  2583. yes)
  2584. GDB_TK="${gdb_tk}" ;;
  2585. *)
  2586. # Only add the dependency on gdbtk when GDBtk is part of the gdb
  2587. # distro. Eventually someone will fix this and move Insight, nee
  2588. # gdbtk to a separate directory.
  2589. if test -d ${srcdir}/gdb/gdbtk ; then
  2590. GDB_TK="${gdb_tk}"
  2591. else
  2592. GDB_TK=""
  2593. fi
  2594. ;;
  2595. esac
  2596. CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
  2597. INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
  2598. # gdb and gdbserver depend on gnulib and gdbsupport, but as nothing
  2599. # else does, only include them if one of these is built. The Makefile
  2600. # provides the ordering, so it's enough here to add to the list.
  2601. case " ${configdirs} " in
  2602. *\ gdb\ *)
  2603. configdirs="${configdirs} gnulib gdbsupport"
  2604. ;;
  2605. *\ gdbserver\ *)
  2606. configdirs="${configdirs} gnulib gdbsupport"
  2607. ;;
  2608. *\ sim\ *)
  2609. configdirs="${configdirs} gnulib"
  2610. ;;
  2611. esac
  2612. # Strip out unwanted targets.
  2613. # While at that, we remove Makefiles if we were started for recursive
  2614. # configuration, so that the top-level Makefile reconfigures them,
  2615. # like we used to do when configure itself was recursive.
  2616. # Loop over modules. We used to use the "$extrasub" feature from Autoconf
  2617. # but now we're fixing up the Makefile ourselves with the additional
  2618. # commands passed to AC_CONFIG_FILES. Use separate variables
  2619. # extrasub-{build,host,target} not because there is any reason to split
  2620. # the substitutions up that way, but only to remain below the limit of
  2621. # 99 commands in a script, for HP-UX sed.
  2622. # Do not nest @if/@endif or @unless/@endunless pairs, because
  2623. # configure will not warn you at all.
  2624. case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
  2625. yes:yes:*\ gold\ *:*,c++,*) ;;
  2626. yes:yes:*\ gold\ *:*)
  2627. AC_MSG_ERROR([in a combined tree, bootstrapping with --enable-gold requires c++ in stage1_languages])
  2628. ;;
  2629. esac
  2630. extrasub_build=
  2631. for module in ${build_configdirs} ; do
  2632. if test -z "${no_recursion}" \
  2633. && test -f ${build_subdir}/${module}/Makefile; then
  2634. echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
  2635. rm -f ${build_subdir}/${module}/Makefile
  2636. fi
  2637. extrasub_build="$extrasub_build
  2638. /^@if build-$module\$/d
  2639. /^@endif build-$module\$/d
  2640. /^@unless build-$module\$/,/^@endunless build-$module\$/d
  2641. /^@if build-$module-$bootstrap_suffix\$/d
  2642. /^@endif build-$module-$bootstrap_suffix\$/d
  2643. /^@unless build-$module-$bootstrap_suffix\$/,/^@endunless build-$module-$bootstrap_suffix\$/d"
  2644. done
  2645. extrasub_host=
  2646. for module in ${configdirs} ; do
  2647. if test -z "${no_recursion}"; then
  2648. for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do
  2649. if test -f ${file}; then
  2650. echo 1>&2 "*** removing ${file} to force reconfigure"
  2651. rm -f ${file}
  2652. fi
  2653. done
  2654. fi
  2655. case ${module},${bootstrap_fixincludes} in
  2656. fixincludes,no) host_bootstrap_suffix=no-bootstrap ;;
  2657. *) host_bootstrap_suffix=$bootstrap_suffix ;;
  2658. esac
  2659. extrasub_host="$extrasub_host
  2660. /^@if $module\$/d
  2661. /^@endif $module\$/d
  2662. /^@unless $module\$/,/^@endunless $module\$/d
  2663. /^@if $module-$host_bootstrap_suffix\$/d
  2664. /^@endif $module-$host_bootstrap_suffix\$/d
  2665. /^@unless $module-$host_bootstrap_suffix\$/,/^@endunless $module-$host_bootstrap_suffix\$/d"
  2666. done
  2667. extrasub_target=
  2668. for module in ${target_configdirs} ; do
  2669. if test -z "${no_recursion}" \
  2670. && test -f ${target_subdir}/${module}/Makefile; then
  2671. echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
  2672. rm -f ${target_subdir}/${module}/Makefile
  2673. fi
  2674. # We only bootstrap target libraries listed in bootstrap_target_libs.
  2675. case $bootstrap_target_libs in
  2676. *,target-$module,*) target_bootstrap_suffix=$bootstrap_suffix ;;
  2677. *) target_bootstrap_suffix=no-bootstrap ;;
  2678. esac
  2679. extrasub_target="$extrasub_target
  2680. /^@if target-$module\$/d
  2681. /^@endif target-$module\$/d
  2682. /^@unless target-$module\$/,/^@endunless target-$module\$/d
  2683. /^@if target-$module-$target_bootstrap_suffix\$/d
  2684. /^@endif target-$module-$target_bootstrap_suffix\$/d
  2685. /^@unless target-$module-$target_bootstrap_suffix\$/,/^@endunless target-$module-$target_bootstrap_suffix\$/d"
  2686. done
  2687. # Do the final fixup along with target modules.
  2688. extrasub_target="$extrasub_target
  2689. /^@if /,/^@endif /d
  2690. /^@unless /d
  2691. /^@endunless /d"
  2692. if test "$enable_pgo_build" != "no"; then
  2693. extrasub_build="$extrasub_build
  2694. /^@if pgo-build\$/d
  2695. /^@endif pgo-build\$/d"
  2696. fi
  2697. # Create the serialization dependencies. This uses a temporary file.
  2698. AC_ARG_ENABLE([serial-configure],
  2699. [AS_HELP_STRING([[--enable-serial-[{host,target,build}-]configure]],
  2700. [force sequential configuration of
  2701. sub-packages for the host, target or build
  2702. machine, or all sub-packages])])
  2703. case ${enable_serial_configure} in
  2704. yes)
  2705. enable_serial_build_configure=yes
  2706. enable_serial_host_configure=yes
  2707. enable_serial_target_configure=yes
  2708. ;;
  2709. esac
  2710. # These force 'configure's to be done one at a time, to avoid problems
  2711. # with contention over a shared config.cache.
  2712. rm -f serdep.tmp
  2713. echo '# serdep.tmp' > serdep.tmp
  2714. olditem=
  2715. test "x${enable_serial_build_configure}" = xyes &&
  2716. for item in ${build_configdirs} ; do
  2717. case ${olditem} in
  2718. "") ;;
  2719. *) echo "configure-build-${item}: configure-build-${olditem}" >> serdep.tmp ;;
  2720. esac
  2721. olditem=${item}
  2722. done
  2723. olditem=
  2724. test "x${enable_serial_host_configure}" = xyes &&
  2725. for item in ${configdirs} ; do
  2726. case ${olditem} in
  2727. "") ;;
  2728. *) echo "configure-${item}: configure-${olditem}" >> serdep.tmp ;;
  2729. esac
  2730. olditem=${item}
  2731. done
  2732. olditem=
  2733. test "x${enable_serial_target_configure}" = xyes &&
  2734. for item in ${target_configdirs} ; do
  2735. case ${olditem} in
  2736. "") ;;
  2737. *) echo "configure-target-${item}: configure-target-${olditem}" >> serdep.tmp ;;
  2738. esac
  2739. olditem=${item}
  2740. done
  2741. serialization_dependencies=serdep.tmp
  2742. AC_SUBST_FILE(serialization_dependencies)
  2743. # Base args. Strip norecursion, cache-file, srcdir, host, build,
  2744. # target, nonopt, and variable assignments. These are the ones we
  2745. # might not want to pass down to subconfigures. The exception being
  2746. # --cache-file=/dev/null, which is used to turn off the use of cache
  2747. # files altogether, and which should be passed on to subconfigures.
  2748. # Also strip program-prefix, program-suffix, and program-transform-name,
  2749. # so that we can pass down a consistent program-transform-name.
  2750. baseargs=
  2751. tbaseargs=
  2752. keep_next=no
  2753. skip_next=no
  2754. eval "set -- $ac_configure_args"
  2755. for ac_arg
  2756. do
  2757. if test X"$skip_next" = X"yes"; then
  2758. skip_next=no
  2759. continue
  2760. fi
  2761. if test X"$keep_next" = X"yes"; then
  2762. case $ac_arg in
  2763. *\'*)
  2764. ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
  2765. esac
  2766. baseargs="$baseargs '$ac_arg'"
  2767. tbaseargs="$tbaseargs '$ac_arg'"
  2768. keep_next=no
  2769. continue
  2770. fi
  2771. # Handle separated arguments. Based on the logic generated by
  2772. # autoconf 2.59.
  2773. case $ac_arg in
  2774. *=* | --config-cache | -C | -disable-* | --disable-* \
  2775. | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
  2776. | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
  2777. | -with-* | --with-* | -without-* | --without-* | --x)
  2778. separate_arg=no
  2779. ;;
  2780. -*)
  2781. separate_arg=yes
  2782. ;;
  2783. *)
  2784. separate_arg=no
  2785. ;;
  2786. esac
  2787. skip_targ=no
  2788. case $ac_arg in
  2789. changequote(,)
  2790. --with-* | --without-*)
  2791. libopt=`echo "$ac_arg" | sed -e 's,^--[^-_]*[-_],,' -e 's,=.*$,,'`
  2792. case $libopt in
  2793. *[-_]include)
  2794. lib=`echo "$libopt" | sed 's,[-_]include$,,'`
  2795. ;;
  2796. *[-_]lib)
  2797. lib=`echo "$libopt" | sed 's,[-_]lib$,,'`
  2798. ;;
  2799. *)
  2800. lib=$libopt
  2801. ;;
  2802. esac
  2803. changequote([,])
  2804. case $lib in
  2805. mpc | mpfr | gmp | isl)
  2806. # If we're processing --with-$lib, --with-$lib-include or
  2807. # --with-$lib-lib, for one of the libs above, and target is
  2808. # different from host, don't pass the current argument to any
  2809. # target library's configure.
  2810. if test x$is_cross_compiler = xyes; then
  2811. skip_targ=yes
  2812. fi
  2813. ;;
  2814. esac
  2815. ;;
  2816. esac
  2817. case "$ac_arg" in
  2818. --cache-file=/dev/null | \
  2819. -cache-file=/dev/null )
  2820. # Handled here to avoid the test to skip args below.
  2821. baseargs="$baseargs '$ac_arg'"
  2822. tbaseargs="$tbaseargs '$ac_arg'"
  2823. # Assert: $separate_arg should always be no.
  2824. keep_next=$separate_arg
  2825. ;;
  2826. --no*)
  2827. continue
  2828. ;;
  2829. --c* | \
  2830. --sr* | \
  2831. --ho* | \
  2832. --bu* | \
  2833. --t* | \
  2834. --program-* | \
  2835. -cache_file* | \
  2836. -srcdir* | \
  2837. -host* | \
  2838. -build* | \
  2839. -target* | \
  2840. -program-prefix* | \
  2841. -program-suffix* | \
  2842. -program-transform-name* )
  2843. skip_next=$separate_arg
  2844. continue
  2845. ;;
  2846. -*)
  2847. # An option. Add it.
  2848. case $ac_arg in
  2849. *\'*)
  2850. ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
  2851. esac
  2852. baseargs="$baseargs '$ac_arg'"
  2853. if test X"$skip_targ" = Xno; then
  2854. tbaseargs="$tbaseargs '$ac_arg'"
  2855. fi
  2856. keep_next=$separate_arg
  2857. ;;
  2858. *)
  2859. # Either a variable assignment, or a nonopt (triplet). Don't
  2860. # pass it down; let the Makefile handle this.
  2861. continue
  2862. ;;
  2863. esac
  2864. done
  2865. # Remove the initial space we just introduced and, as these will be
  2866. # expanded by make, quote '$'.
  2867. baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
  2868. # Add in --program-transform-name, after --program-prefix and
  2869. # --program-suffix have been applied to it. Autoconf has already
  2870. # doubled dollar signs and backslashes in program_transform_name; we want
  2871. # the backslashes un-doubled, and then the entire thing wrapped in single
  2872. # quotes, because this will be expanded first by make and then by the shell.
  2873. # Also, because we want to override the logic in subdir configure scripts to
  2874. # choose program_transform_name, replace any s,x,x, with s,y,y,.
  2875. sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
  2876. ${program_transform_name}
  2877. EOF_SED
  2878. gcc_transform_name=`cat conftestsed.out`
  2879. rm -f conftestsed.out
  2880. baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
  2881. tbaseargs="$tbaseargs --program-transform-name='${gcc_transform_name}'"
  2882. if test "$silent" = yes; then
  2883. baseargs="$baseargs --silent"
  2884. tbaseargs="$tbaseargs --silent"
  2885. fi
  2886. baseargs="$baseargs --disable-option-checking"
  2887. tbaseargs="$tbaseargs --disable-option-checking"
  2888. # Record and document user additions to sub configure arguments.
  2889. AC_ARG_VAR([build_configargs],
  2890. [additional configure arguments for build directories])
  2891. AC_ARG_VAR([host_configargs],
  2892. [additional configure arguments for host directories])
  2893. AC_ARG_VAR([target_configargs],
  2894. [additional configure arguments for target directories])
  2895. # For the build-side libraries, we just need to pretend we're native,
  2896. # and not use the same cache file. Multilibs are neither needed nor
  2897. # desired. We can't even use the same cache file for all build-side
  2898. # libraries, as they're compiled differently; some with C, some with
  2899. # C++ or with different feature-enabling options.
  2900. build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}"
  2901. # For host modules, accept cache file option, or specification as blank.
  2902. case "${cache_file}" in
  2903. "") # empty
  2904. cache_file_option="" ;;
  2905. /* | [[A-Za-z]]:[[\\/]]* ) # absolute path
  2906. cache_file_option="--cache-file=${cache_file}" ;;
  2907. *) # relative path
  2908. cache_file_option="--cache-file=../${cache_file}" ;;
  2909. esac
  2910. # Host dirs don't like to share a cache file either, horribly enough.
  2911. # This seems to be due to autoconf 2.5x stupidity.
  2912. host_configargs="$host_configargs --cache-file=./config.cache ${extra_host_args} ${baseargs}"
  2913. target_configargs="$target_configargs ${tbaseargs}"
  2914. # Passing a --with-cross-host argument lets the target libraries know
  2915. # whether they are being built with a cross-compiler or being built
  2916. # native. However, it would be better to use other mechanisms to make the
  2917. # sorts of decisions they want to make on this basis. Please consider
  2918. # this option to be deprecated. FIXME.
  2919. if test x${is_cross_compiler} = xyes ; then
  2920. target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}"
  2921. fi
  2922. # Special user-friendly check for native x86_64-linux build, if
  2923. # multilib is not explicitly enabled.
  2924. case "$target:$have_compiler:$host:$target:$enable_multilib" in
  2925. x86_64-*linux*:yes:$build:$build:)
  2926. # Make sure we have a development environment that handles 32-bit
  2927. dev64=no
  2928. echo "int main () { return 0; }" > conftest.c
  2929. ${CC} -m32 -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
  2930. if test $? = 0 ; then
  2931. if test -s conftest || test -s conftest.exe ; then
  2932. dev64=yes
  2933. fi
  2934. fi
  2935. rm -f conftest*
  2936. if test x${dev64} != xyes ; then
  2937. AC_MSG_ERROR([I suspect your system does not have 32-bit development libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.])
  2938. fi
  2939. ;;
  2940. esac
  2941. # Default to --enable-multilib.
  2942. if test x${enable_multilib} = x ; then
  2943. target_configargs="--enable-multilib ${target_configargs}"
  2944. fi
  2945. # Pass --with-newlib if appropriate. Note that target_configdirs has
  2946. # changed from the earlier setting of with_newlib.
  2947. if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
  2948. target_configargs="--with-newlib ${target_configargs}"
  2949. fi
  2950. # Different target subdirs use different values of certain variables
  2951. # (notably CXX). Worse, multilibs use *lots* of different values.
  2952. # Worse yet, autoconf 2.5x makes some of these 'precious', meaning that
  2953. # it doesn't automatically accept command-line overrides of them.
  2954. # This means it's not safe for target subdirs to share a cache file,
  2955. # which is disgusting, but there you have it. Hopefully this can be
  2956. # fixed in future. It's still worthwhile to use a cache file for each
  2957. # directory. I think.
  2958. # Pass the appropriate --build, --host, --target and --cache-file arguments.
  2959. # We need to pass --target, as newer autoconf's requires consistency
  2960. # for target_alias and gcc doesn't manage it consistently.
  2961. target_configargs="--cache-file=./config.cache ${target_configargs}"
  2962. FLAGS_FOR_TARGET=
  2963. case " $target_configdirs " in
  2964. *" newlib "*)
  2965. case " $target_configargs " in
  2966. *" --with-newlib "*)
  2967. case "$target" in
  2968. *-cygwin*)
  2969. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -isystem $$s/winsup/cygwin/include'
  2970. ;;
  2971. esac
  2972. # If we're not building GCC, don't discard standard headers.
  2973. if test -d ${srcdir}/gcc; then
  2974. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
  2975. if test "${build}" != "${host}"; then
  2976. # On Canadian crosses, CC_FOR_TARGET will have already been set
  2977. # by `configure', so we won't have an opportunity to add -Bgcc/
  2978. # to it. This is right: we don't want to search that directory
  2979. # for binaries, but we want the header files in there, so add
  2980. # them explicitly.
  2981. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/$(HOST_SUBDIR)/gcc/include -isystem $$r/$(HOST_SUBDIR)/gcc/include-fixed'
  2982. # Someone might think of using the pre-installed headers on
  2983. # Canadian crosses, in case the installed compiler is not fully
  2984. # compatible with the compiler being built. In this case, it
  2985. # would be better to flag an error than risking having
  2986. # incompatible object files being constructed. We can't
  2987. # guarantee that an error will be flagged, but let's hope the
  2988. # compiler will do it, when presented with incompatible header
  2989. # files.
  2990. fi
  2991. fi
  2992. case "${target}-${is_cross_compiler}" in
  2993. i[[3456789]]86-*-linux*-no)
  2994. # Here host == target, so we don't need to build gcc,
  2995. # so we don't want to discard standard headers.
  2996. FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
  2997. ;;
  2998. *)
  2999. # If we're building newlib, use its generic headers last, but search
  3000. # for any libc-related directories first (so make it the last -B
  3001. # switch).
  3002. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
  3003. # If we're building libgloss, find the startup file, simulator library
  3004. # and linker script.
  3005. case " $target_configdirs " in
  3006. *" libgloss "*)
  3007. # Look for startup file, simulator library and maybe linker script.
  3008. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/'"$libgloss_dir"
  3009. # Look for libnosys.a in case the target needs it.
  3010. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys'
  3011. # Most targets have the linker script in the source directory.
  3012. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$s/libgloss/'"$libgloss_dir"
  3013. ;;
  3014. esac
  3015. ;;
  3016. esac
  3017. ;;
  3018. esac
  3019. ;;
  3020. esac
  3021. case "$target" in
  3022. x86_64-*mingw* | *-w64-mingw*)
  3023. # MinGW-w64 does not use newlib, nor does it use winsup. It may,
  3024. # however, use a symlink named 'mingw' in ${prefix} .
  3025. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L${prefix}/${target}/lib -L${prefix}/mingw/lib -isystem ${prefix}/${target}/include -isystem ${prefix}/mingw/include'
  3026. ;;
  3027. *-mingw*)
  3028. # MinGW can't be handled as Cygwin above since it does not use newlib.
  3029. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include'
  3030. ;;
  3031. esac
  3032. # Allow the user to override the flags for
  3033. # our build compiler if desired.
  3034. if test x"${build}" = x"${host}" ; then
  3035. CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
  3036. CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}}
  3037. LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
  3038. fi
  3039. # On Canadian crosses, we'll be searching the right directories for
  3040. # the previously-installed cross compiler, so don't bother to add
  3041. # flags for directories within the install tree of the compiler
  3042. # being built; programs in there won't even run.
  3043. if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
  3044. # Search for pre-installed headers if nothing else fits.
  3045. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
  3046. fi
  3047. if test "x${use_gnu_ld}" = x &&
  3048. echo " ${configdirs} " | grep " ld " > /dev/null ; then
  3049. # Arrange for us to find uninstalled linker scripts.
  3050. FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld'
  3051. fi
  3052. # Search for other target-specific linker scripts and such.
  3053. case "${target}" in
  3054. mep*)
  3055. FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary"
  3056. ;;
  3057. esac
  3058. # Makefile fragments.
  3059. for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag;
  3060. do
  3061. eval fragval=\$$frag
  3062. if test $fragval != /dev/null; then
  3063. eval $frag=${srcdir}/$fragval
  3064. fi
  3065. done
  3066. AC_SUBST_FILE(host_makefile_frag)
  3067. AC_SUBST_FILE(target_makefile_frag)
  3068. AC_SUBST_FILE(alphaieee_frag)
  3069. AC_SUBST_FILE(ospace_frag)
  3070. # Miscellanea: directories, flags, etc.
  3071. AC_SUBST(RPATH_ENVVAR)
  3072. AC_SUBST(GCC_SHLIB_SUBDIR)
  3073. AC_SUBST(tooldir)
  3074. AC_SUBST(build_tooldir)
  3075. AC_SUBST(CONFIGURE_GDB_TK)
  3076. AC_SUBST(GDB_TK)
  3077. AC_SUBST(INSTALL_GDB_TK)
  3078. # Build module lists & subconfigure args.
  3079. AC_SUBST(build_configargs)
  3080. AC_SUBST(build_configdirs)
  3081. # Host module lists & subconfigure args.
  3082. AC_SUBST(host_configargs)
  3083. AC_SUBST(configdirs)
  3084. AC_SUBST(target_configdirs)
  3085. # Target module lists & subconfigure args.
  3086. AC_SUBST(target_configargs)
  3087. # Build tools.
  3088. AC_SUBST(AR_FOR_BUILD)
  3089. AC_SUBST(AS_FOR_BUILD)
  3090. AC_SUBST(CC_FOR_BUILD)
  3091. AC_SUBST(CFLAGS_FOR_BUILD)
  3092. AC_SUBST(CXXFLAGS_FOR_BUILD)
  3093. AC_SUBST(CXX_FOR_BUILD)
  3094. AC_SUBST(DLLTOOL_FOR_BUILD)
  3095. AC_SUBST(GFORTRAN_FOR_BUILD)
  3096. AC_SUBST(GOC_FOR_BUILD)
  3097. AC_SUBST(LDFLAGS_FOR_BUILD)
  3098. AC_SUBST(LD_FOR_BUILD)
  3099. AC_SUBST(NM_FOR_BUILD)
  3100. AC_SUBST(RANLIB_FOR_BUILD)
  3101. AC_SUBST(WINDMC_FOR_BUILD)
  3102. AC_SUBST(WINDRES_FOR_BUILD)
  3103. # Generate default definitions for YACC, M4, LEX and other programs that run
  3104. # on the build machine. These are used if the Makefile can't locate these
  3105. # programs in objdir.
  3106. MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
  3107. AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [$MISSING bison -y])
  3108. case " $build_configdirs " in
  3109. *" bison "*) YACC='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' ;;
  3110. esac
  3111. AC_CHECK_PROGS([BISON], [bison], [$MISSING bison])
  3112. case " $build_configdirs " in
  3113. *" bison "*) BISON='$$r/$(BUILD_SUBDIR)/bison/tests/bison' ;;
  3114. esac
  3115. AC_CHECK_PROGS([M4], [gm4 gnum4 m4], [$MISSING m4])
  3116. case " $build_configdirs " in
  3117. *" m4 "*) M4='$$r/$(BUILD_SUBDIR)/m4/m4' ;;
  3118. esac
  3119. AC_CHECK_PROGS([LEX], [flex lex], [$MISSING flex])
  3120. case " $build_configdirs " in
  3121. *" flex "*) LEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
  3122. *" lex "*) LEX='$$r/$(BUILD_SUBDIR)/lex/lex' ;;
  3123. esac
  3124. AC_CHECK_PROGS([FLEX], [flex], [$MISSING flex])
  3125. case " $build_configdirs " in
  3126. *" flex "*) FLEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
  3127. esac
  3128. AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo])
  3129. case " $build_configdirs " in
  3130. *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
  3131. *)
  3132. changequote(,)
  3133. # For an installed makeinfo, we require it to be from texinfo 4.7 or
  3134. # higher, else we use the "missing" dummy.
  3135. if ${MAKEINFO} --version \
  3136. | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
  3137. :
  3138. else
  3139. MAKEINFO="$MISSING makeinfo"
  3140. fi
  3141. ;;
  3142. changequote([,])
  3143. esac
  3144. # FIXME: expect and dejagnu may become build tools?
  3145. AC_CHECK_PROGS(EXPECT, expect, expect)
  3146. case " $configdirs " in
  3147. *" expect "*)
  3148. test $host = $build && EXPECT='$$r/$(HOST_SUBDIR)/expect/expect'
  3149. ;;
  3150. esac
  3151. AC_CHECK_PROGS(RUNTEST, runtest, runtest)
  3152. case " $configdirs " in
  3153. *" dejagnu "*)
  3154. test $host = $build && RUNTEST='$$s/$(HOST_SUBDIR)/dejagnu/runtest'
  3155. ;;
  3156. esac
  3157. # Host tools.
  3158. NCN_STRICT_CHECK_TOOLS(AR, ar)
  3159. NCN_STRICT_CHECK_TOOLS(AS, as)
  3160. NCN_STRICT_CHECK_TOOLS(DLLTOOL, dlltool)
  3161. NCN_STRICT_CHECK_TOOLS(LD, ld)
  3162. NCN_STRICT_CHECK_TOOLS(LIPO, lipo)
  3163. NCN_STRICT_CHECK_TOOLS(NM, nm)
  3164. NCN_STRICT_CHECK_TOOLS(RANLIB, ranlib, true)
  3165. NCN_STRICT_CHECK_TOOLS(STRIP, strip, true)
  3166. NCN_STRICT_CHECK_TOOLS(WINDRES, windres)
  3167. NCN_STRICT_CHECK_TOOLS(WINDMC, windmc)
  3168. NCN_STRICT_CHECK_TOOLS(OBJCOPY, objcopy)
  3169. NCN_STRICT_CHECK_TOOLS(OBJDUMP, objdump)
  3170. NCN_STRICT_CHECK_TOOLS(READELF, readelf)
  3171. AC_SUBST(CC)
  3172. AC_SUBST(CXX)
  3173. AC_SUBST(CFLAGS)
  3174. AC_SUBST(CXXFLAGS)
  3175. AC_SUBST(PKG_CONFIG_PATH)
  3176. GCC_PLUGIN_OPTION(PLUGIN_OPTION)
  3177. AR_PLUGIN_OPTION=
  3178. RANLIB_PLUGIN_OPTION=
  3179. if test -n "$PLUGIN_OPTION"; then
  3180. if $AR --help 2>&1 | grep -q "\--plugin"; then
  3181. AR_PLUGIN_OPTION="$PLUGIN_OPTION"
  3182. fi
  3183. if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
  3184. RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
  3185. fi
  3186. else
  3187. if test "$enable_pgo_build" != "no"; then
  3188. AC_MSG_ERROR([AR with --plugin and rc is required for LTO build])
  3189. fi
  3190. fi
  3191. AC_SUBST(AR_PLUGIN_OPTION)
  3192. AC_SUBST(RANLIB_PLUGIN_OPTION)
  3193. # Target tools.
  3194. AC_ARG_WITH([build-time-tools],
  3195. [AS_HELP_STRING([--with-build-time-tools=PATH],
  3196. [use given path to find target tools during the build])],
  3197. [case x"$withval" in
  3198. x/*) ;;
  3199. *)
  3200. with_build_time_tools=
  3201. AC_MSG_WARN([argument to --with-build-time-tools must be an absolute path])
  3202. ;;
  3203. esac],
  3204. [with_build_time_tools=])
  3205. NCN_STRICT_CHECK_TARGET_TOOLS(CC_FOR_TARGET, cc gcc)
  3206. NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TARGET, c++ g++ cxx gxx)
  3207. NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET})
  3208. NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
  3209. NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
  3210. ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar)
  3211. ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as)
  3212. ACX_CHECK_INSTALLED_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
  3213. ACX_CHECK_INSTALLED_TARGET_TOOL(LD_FOR_TARGET, ld)
  3214. ACX_CHECK_INSTALLED_TARGET_TOOL(LIPO_FOR_TARGET, lipo)
  3215. ACX_CHECK_INSTALLED_TARGET_TOOL(NM_FOR_TARGET, nm)
  3216. ACX_CHECK_INSTALLED_TARGET_TOOL(OBJCOPY_FOR_TARGET, objcopy)
  3217. ACX_CHECK_INSTALLED_TARGET_TOOL(OBJDUMP_FOR_TARGET, objdump)
  3218. ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib)
  3219. ACX_CHECK_INSTALLED_TARGET_TOOL(READELF_FOR_TARGET, readelf)
  3220. ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip)
  3221. ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
  3222. ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)
  3223. RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
  3224. GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar])
  3225. GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
  3226. GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
  3227. dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS
  3228. GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX,
  3229. [gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
  3230. c++)
  3231. GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
  3232. [gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
  3233. c++)
  3234. GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool])
  3235. GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
  3236. GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN,
  3237. [gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran)
  3238. GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
  3239. [gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
  3240. GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
  3241. GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
  3242. GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
  3243. GCC_TARGET_TOOL(objcopy, OBJCOPY_FOR_TARGET, OBJCOPY, [binutils/objcopy])
  3244. GCC_TARGET_TOOL(objdump, OBJDUMP_FOR_TARGET, OBJDUMP, [binutils/objdump])
  3245. GCC_TARGET_TOOL(ranlib, RANLIB_FOR_TARGET, RANLIB, [binutils/ranlib])
  3246. GCC_TARGET_TOOL(readelf, READELF_FOR_TARGET, READELF, [binutils/readelf])
  3247. GCC_TARGET_TOOL(strip, STRIP_FOR_TARGET, STRIP, [binutils/strip-new])
  3248. GCC_TARGET_TOOL(windres, WINDRES_FOR_TARGET, WINDRES, [binutils/windres])
  3249. GCC_TARGET_TOOL(windmc, WINDMC_FOR_TARGET, WINDMC, [binutils/windmc])
  3250. AC_SUBST(FLAGS_FOR_TARGET)
  3251. AC_SUBST(RAW_CXX_FOR_TARGET)
  3252. # Certain tools may need extra flags.
  3253. AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
  3254. RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
  3255. NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
  3256. # When building target libraries, except in a Canadian cross, we use
  3257. # the same toolchain as the compiler we just built.
  3258. COMPILER_AS_FOR_TARGET='$(AS_FOR_TARGET)'
  3259. COMPILER_LD_FOR_TARGET='$(LD_FOR_TARGET)'
  3260. COMPILER_NM_FOR_TARGET='$(NM_FOR_TARGET)'
  3261. if test $host = $build; then
  3262. case " $configdirs " in
  3263. *" gcc "*)
  3264. COMPILER_AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/as'
  3265. COMPILER_LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/collect-ld'
  3266. COMPILER_NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/nm'${extra_nmflags_for_target}
  3267. ;;
  3268. esac
  3269. fi
  3270. AC_SUBST(COMPILER_AS_FOR_TARGET)
  3271. AC_SUBST(COMPILER_LD_FOR_TARGET)
  3272. AC_SUBST(COMPILER_NM_FOR_TARGET)
  3273. AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  3274. AC_ARG_ENABLE(maintainer-mode,
  3275. [AS_HELP_STRING([--enable-maintainer-mode],
  3276. [enable make rules and dependencies not useful
  3277. (and sometimes confusing) to the casual installer])],
  3278. USE_MAINTAINER_MODE=$enableval,
  3279. USE_MAINTAINER_MODE=no)
  3280. AC_MSG_RESULT($USE_MAINTAINER_MODE)
  3281. AC_SUBST(MAINTAINER_MODE_TRUE)
  3282. AC_SUBST(MAINTAINER_MODE_FALSE)
  3283. if test "$USE_MAINTAINER_MODE" = yes; then
  3284. MAINTAINER_MODE_TRUE=
  3285. MAINTAINER_MODE_FALSE='#'
  3286. else
  3287. MAINTAINER_MODE_TRUE='#'
  3288. MAINTAINER_MODE_FALSE=
  3289. fi
  3290. MAINT=$MAINTAINER_MODE_TRUE
  3291. AC_SUBST(MAINT)dnl
  3292. # ---------------------
  3293. # GCC bootstrap support
  3294. # ---------------------
  3295. # Stage specific cflags for build.
  3296. stage1_cflags="-g"
  3297. case $build in
  3298. vax-*-*)
  3299. case ${GCC} in
  3300. yes) stage1_cflags="-g -Wa,-J" ;;
  3301. *) stage1_cflags="-g -J" ;;
  3302. esac ;;
  3303. esac
  3304. AC_SUBST(stage1_cflags)
  3305. # Enable --enable-checking in stage1 of the compiler.
  3306. AC_ARG_ENABLE(stage1-checking,
  3307. [AS_HELP_STRING([[--enable-stage1-checking[=all]]],
  3308. [choose additional checking for stage1 of the compiler])],
  3309. [stage1_checking=--enable-checking=${enable_stage1_checking}],
  3310. [if test "x$enable_checking" = xno || test "x$enable_checking" = x; then
  3311. # For --disable-checking or implicit --enable-checking=release, avoid
  3312. # setting --enable-checking=gc in the default stage1 checking for LTO
  3313. # bootstraps. See PR62077.
  3314. case $BUILD_CONFIG in
  3315. *lto*)
  3316. stage1_checking=--enable-checking=release,misc,gimple,rtlflag,tree,types;;
  3317. *)
  3318. stage1_checking=--enable-checking=yes,types;;
  3319. esac
  3320. if test "x$enable_checking" = x && \
  3321. test -d ${srcdir}/gcc && \
  3322. test x"`cat ${srcdir}/gcc/DEV-PHASE`" = xexperimental; then
  3323. stage1_checking=--enable-checking=yes,types,extra
  3324. fi
  3325. else
  3326. stage1_checking=--enable-checking=$enable_checking,types
  3327. fi])
  3328. AC_SUBST(stage1_checking)
  3329. # Enable -Werror in bootstrap stage2 and later.
  3330. AC_ARG_ENABLE(werror,
  3331. [AS_HELP_STRING([--enable-werror],
  3332. [enable -Werror in bootstrap stage2 and later])],
  3333. [
  3334. case ${enable_werror} in
  3335. yes) stage2_werror_flag="--enable-werror-always" ;;
  3336. *) stage2_werror_flag="" ;;
  3337. esac
  3338. ],
  3339. [
  3340. if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
  3341. case $BUILD_CONFIG in
  3342. bootstrap-debug)
  3343. stage2_werror_flag="--enable-werror-always" ;;
  3344. "")
  3345. stage2_werror_flag="--enable-werror-always" ;;
  3346. esac
  3347. fi
  3348. ])
  3349. AC_SUBST(stage2_werror_flag)
  3350. # Specify what files to not compare during bootstrap.
  3351. compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
  3352. case "$target" in
  3353. hppa*64*-*-hpux*) ;;
  3354. hppa*-*-hpux*) compare_exclusions="gcc/cc*-checksum\$(objext) | */libgcc/lib2funcs* | gcc/ada/*tools/* | gcc/function-tests.o" ;;
  3355. powerpc*-ibm-aix*) compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/* | *libgomp*\$(objext)" ;;
  3356. esac
  3357. AC_SUBST(compare_exclusions)
  3358. AC_CONFIG_FILES([Makefile],
  3359. [sed "$extrasub_build" Makefile |
  3360. sed "$extrasub_host" |
  3361. sed "$extrasub_target" > mf$$
  3362. mv -f mf$$ Makefile],
  3363. [extrasub_build="$extrasub_build"
  3364. extrasub_host="$extrasub_host"
  3365. extrasub_target="$extrasub_target"])
  3366. AC_OUTPUT