A C standard library for sh3eb-elf.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac 111KB

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