configure.ac 109 KB

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