configure.ac 110 KB

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