Makefile.am 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392
  1. # Makefile.am -- Go library Makefile.
  2. # Copyright 2009 The Go Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style
  4. # license that can be found in the LICENSE file.
  5. # Process this file with autoreconf to produce Makefile.in.
  6. # Go support.
  7. SUFFIXES = .c .go .gox .o .obj .lo .a
  8. if LIBGO_IS_RTEMS
  9. subdirs = testsuite
  10. endif
  11. if LIBGO_IS_DARWIN
  12. GO_EXPORT_SECTION_NAME = __GNU_GO.__go_export
  13. else
  14. GO_EXPORT_SECTION_NAME = .go_export
  15. endif
  16. SUBDIRS = ${subdirs}
  17. gcc_version := $(shell $(GOC) -dumpversion)
  18. MAINT_CHARSET = latin1
  19. mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
  20. PWD_COMMAND = $${PWDCMD-pwd}
  21. STAMP = echo timestamp >
  22. toolexecdir = $(glibgo_toolexecdir)
  23. toolexeclibdir = $(glibgo_toolexeclibdir)
  24. toolexeclibgodir = $(nover_glibgo_toolexeclibdir)/go/$(gcc_version)/$(target_alias)
  25. libexecsubdir = $(libexecdir)/gcc/$(target_alias)/$(gcc_version)
  26. LIBFFI = @LIBFFI@
  27. LIBFFIINCS = @LIBFFIINCS@
  28. LIBATOMIC = @LIBATOMIC@
  29. WARN_CFLAGS = $(WARN_FLAGS) $(WERROR)
  30. # -I/-D flags to pass when compiling.
  31. AM_CPPFLAGS = -I $(srcdir)/runtime $(LIBFFIINCS) $(PTHREAD_CFLAGS)
  32. ACLOCAL_AMFLAGS = -I ./config -I ../config
  33. AM_CFLAGS = -fexceptions -fnon-call-exceptions \
  34. $(SPLIT_STACK) $(WARN_CFLAGS) \
  35. $(STRINGOPS_FLAG) $(HWCAP_CFLAGS) $(OSCFLAGS) \
  36. -I $(srcdir)/../libgcc -I $(srcdir)/../libbacktrace \
  37. -I $(MULTIBUILDTOP)../../gcc/include
  38. AM_LDFLAGS =
  39. if USING_SPLIT_STACK
  40. AM_LDFLAGS += -XCClinker $(SPLIT_STACK)
  41. endif
  42. if LIBGO_IS_AIX
  43. # Using an import file for libgo avoid requiring to use the -brtl flag
  44. # when builing a go program
  45. AM_LDFLAGS += -Wl,-bbigtoc -Wl,-bI:$(srcdir)/libgo.imp
  46. EXTRA_libgo_la_DEPENDENCIES = libgo.imp
  47. endif
  48. # Multilib support.
  49. MAKEOVERRIDES=
  50. # Work around what appears to be a GNU make handling MAKEFLAGS
  51. # values defined in terms of make variables, as is the case for CC and
  52. # friends when we are called from the top level Makefile.
  53. AM_MAKEFLAGS = \
  54. "AR_FLAGS=$(AR_FLAGS)" \
  55. "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
  56. "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
  57. "CFLAGS=$(CFLAGS)" \
  58. "CXXFLAGS=$(CXXFLAGS)" \
  59. "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
  60. "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
  61. "GOC_FOR_TARGET=$(GOC_FOR_TARGET)" \
  62. "GOC=$(GOC)" \
  63. "GOCFLAGS=$(GOCFLAGS)" \
  64. "INSTALL=$(INSTALL)" \
  65. "INSTALL_DATA=$(INSTALL_DATA)" \
  66. "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  67. "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
  68. "LDFLAGS=$(LDFLAGS)" \
  69. "LIBCFLAGS=$(LIBCFLAGS)" \
  70. "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
  71. "MAKE=$(MAKE)" \
  72. "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
  73. "PICFLAG=$(PICFLAG)" \
  74. "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
  75. "SHELL=$(SHELL)" \
  76. "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
  77. "exec_prefix=$(exec_prefix)" \
  78. "infodir=$(infodir)" \
  79. "libdir=$(libdir)" \
  80. "includedir=$(includedir)" \
  81. "prefix=$(prefix)" \
  82. "tooldir=$(tooldir)" \
  83. "gxx_include_dir=$(gxx_include_dir)" \
  84. "AR=$(AR)" \
  85. "AS=$(AS)" \
  86. "LD=$(LD)" \
  87. "RANLIB=$(RANLIB)" \
  88. "NM=$(NM)" \
  89. "NM_FOR_BUILD=$(NM_FOR_BUILD)" \
  90. "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
  91. "DESTDIR=$(DESTDIR)" \
  92. "WERROR=$(WERROR)"
  93. # Subdir rules rely on $(FLAGS_TO_PASS)
  94. FLAGS_TO_PASS = $(AM_MAKEFLAGS)
  95. if GOC_IS_LLGO
  96. toolexeclib_LTLIBRARIES = libgo-llgo.la
  97. toolexeclib_LIBRARIES = libgobegin-llgo.a
  98. else
  99. toolexeclib_LTLIBRARIES = libgo.la
  100. toolexeclib_LIBRARIES = libgobegin.a libgolibbegin.a
  101. endif
  102. noinst_LIBRARIES = libgotool.a
  103. toolexeclibgo_DATA = \
  104. bufio.gox \
  105. bytes.gox \
  106. context.gox \
  107. crypto.gox \
  108. embed.gox \
  109. encoding.gox \
  110. errors.gox \
  111. expvar.gox \
  112. flag.gox \
  113. fmt.gox \
  114. hash.gox \
  115. html.gox \
  116. image.gox \
  117. io.gox \
  118. log.gox \
  119. math.gox \
  120. mime.gox \
  121. net.gox \
  122. os.gox \
  123. path.gox \
  124. reflect.gox \
  125. regexp.gox \
  126. runtime.gox \
  127. sort.gox \
  128. strconv.gox \
  129. strings.gox \
  130. sync.gox \
  131. syscall.gox \
  132. testing.gox \
  133. time.gox \
  134. unicode.gox
  135. toolexeclibgoarchivedir = $(toolexeclibgodir)/archive
  136. toolexeclibgoarchive_DATA = \
  137. archive/tar.gox \
  138. archive/zip.gox
  139. toolexeclibgocompressdir = $(toolexeclibgodir)/compress
  140. toolexeclibgocompress_DATA = \
  141. compress/bzip2.gox \
  142. compress/flate.gox \
  143. compress/gzip.gox \
  144. compress/lzw.gox \
  145. compress/zlib.gox
  146. toolexeclibgocontainerdir = $(toolexeclibgodir)/container
  147. toolexeclibgocontainer_DATA = \
  148. container/heap.gox \
  149. container/list.gox \
  150. container/ring.gox
  151. toolexeclibgocryptodir = $(toolexeclibgodir)/crypto
  152. toolexeclibgocrypto_DATA = \
  153. crypto/aes.gox \
  154. crypto/cipher.gox \
  155. crypto/des.gox \
  156. crypto/dsa.gox \
  157. crypto/ecdsa.gox \
  158. crypto/ed25519.gox \
  159. crypto/elliptic.gox \
  160. crypto/hmac.gox \
  161. crypto/md5.gox \
  162. crypto/rand.gox \
  163. crypto/rc4.gox \
  164. crypto/rsa.gox \
  165. crypto/sha1.gox \
  166. crypto/sha256.gox \
  167. crypto/sha512.gox \
  168. crypto/subtle.gox \
  169. crypto/tls.gox \
  170. crypto/x509.gox
  171. toolexeclibgocryptox509dir = $(toolexeclibgocryptodir)/x509
  172. toolexeclibgocryptox509_DATA = \
  173. crypto/x509/pkix.gox
  174. toolexeclibgodatabasedir = $(toolexeclibgodir)/database
  175. toolexeclibgodatabase_DATA = \
  176. database/sql.gox
  177. toolexeclibgodatabasesqldir = $(toolexeclibgodatabasedir)/sql
  178. toolexeclibgodatabasesql_DATA = \
  179. database/sql/driver.gox
  180. toolexeclibgodebugdir = $(toolexeclibgodir)/debug
  181. toolexeclibgodebug_DATA = \
  182. debug/buildinfo.gox \
  183. debug/dwarf.gox \
  184. debug/elf.gox \
  185. debug/gosym.gox \
  186. debug/macho.gox \
  187. debug/pe.gox \
  188. debug/plan9obj.gox
  189. toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding
  190. toolexeclibgoencoding_DATA = \
  191. encoding/ascii85.gox \
  192. encoding/asn1.gox \
  193. encoding/base32.gox \
  194. encoding/base64.gox \
  195. encoding/binary.gox \
  196. encoding/csv.gox \
  197. encoding/gob.gox \
  198. encoding/hex.gox \
  199. encoding/json.gox \
  200. encoding/pem.gox \
  201. encoding/xml.gox
  202. toolexeclibgogodir = $(toolexeclibgodir)/go
  203. toolexeclibgogo_DATA = \
  204. go/ast.gox \
  205. go/build.gox \
  206. go/constant.gox \
  207. go/doc.gox \
  208. go/format.gox \
  209. go/importer.gox \
  210. go/parser.gox \
  211. go/printer.gox \
  212. go/scanner.gox \
  213. go/token.gox \
  214. go/types.gox
  215. toolexeclibgogobuilddir = $(toolexeclibgogodir)/build
  216. toolexeclibgogobuild_DATA = \
  217. go/build/constraint.gox
  218. toolexeclibgohashdir = $(toolexeclibgodir)/hash
  219. toolexeclibgohash_DATA = \
  220. hash/adler32.gox \
  221. hash/crc32.gox \
  222. hash/crc64.gox \
  223. hash/fnv.gox \
  224. hash/maphash.gox
  225. toolexeclibgohtmldir = $(toolexeclibgodir)/html
  226. toolexeclibgohtml_DATA = \
  227. html/template.gox
  228. toolexeclibgoimagedir = $(toolexeclibgodir)/image
  229. toolexeclibgoimage_DATA = \
  230. image/color.gox \
  231. image/draw.gox \
  232. image/gif.gox \
  233. image/jpeg.gox \
  234. image/png.gox
  235. toolexeclibgoimagecolordir = $(toolexeclibgoimagedir)/color
  236. toolexeclibgoimagecolor_DATA = \
  237. image/color/palette.gox
  238. toolexeclibgoindexdir = $(toolexeclibgodir)/index
  239. toolexeclibgoindex_DATA = \
  240. index/suffixarray.gox
  241. toolexeclibgoiodir = $(toolexeclibgodir)/io
  242. toolexeclibgoio_DATA = \
  243. io/fs.gox \
  244. io/ioutil.gox
  245. toolexeclibgologdir = $(toolexeclibgodir)/log
  246. toolexeclibgolog_DATA = \
  247. log/syslog.gox
  248. toolexeclibgomathdir = $(toolexeclibgodir)/math
  249. toolexeclibgomath_DATA = \
  250. math/big.gox \
  251. math/bits.gox \
  252. math/cmplx.gox \
  253. math/rand.gox
  254. toolexeclibgomimedir = $(toolexeclibgodir)/mime
  255. toolexeclibgomime_DATA = \
  256. mime/multipart.gox \
  257. mime/quotedprintable.gox
  258. toolexeclibgonetdir = $(toolexeclibgodir)/net
  259. toolexeclibgonet_DATA = \
  260. net/http.gox \
  261. net/mail.gox \
  262. net/netip.gox \
  263. net/rpc.gox \
  264. net/smtp.gox \
  265. net/textproto.gox \
  266. net/url.gox
  267. toolexeclibgonethttpdir = $(toolexeclibgonetdir)/http
  268. toolexeclibgonethttp_DATA = \
  269. net/http/cgi.gox \
  270. net/http/cookiejar.gox \
  271. net/http/fcgi.gox \
  272. net/http/httptest.gox \
  273. net/http/httptrace.gox \
  274. net/http/httputil.gox \
  275. net/http/pprof.gox
  276. toolexeclibgonetrpcdir = $(toolexeclibgonetdir)/rpc
  277. toolexeclibgonetrpc_DATA = \
  278. net/rpc/jsonrpc.gox
  279. toolexeclibgoosdir = $(toolexeclibgodir)/os
  280. toolexeclibgoos_DATA = \
  281. os/exec.gox \
  282. os/signal.gox \
  283. os/user.gox
  284. toolexeclibgopathdir = $(toolexeclibgodir)/path
  285. toolexeclibgopath_DATA = \
  286. path/filepath.gox
  287. toolexeclibgoregexpdir = $(toolexeclibgodir)/regexp
  288. toolexeclibgoregexp_DATA = \
  289. regexp/syntax.gox
  290. toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime
  291. toolexeclibgoruntime_DATA = \
  292. runtime/cgo.gox \
  293. runtime/debug.gox \
  294. runtime/metrics.gox \
  295. runtime/pprof.gox \
  296. runtime/trace.gox
  297. toolexeclibgosyncdir = $(toolexeclibgodir)/sync
  298. toolexeclibgosync_DATA = \
  299. sync/atomic.gox
  300. toolexeclibgotestingdir = $(toolexeclibgodir)/testing
  301. toolexeclibgotesting_DATA = \
  302. testing/fstest.gox \
  303. testing/iotest.gox \
  304. testing/quick.gox
  305. toolexeclibgotestinginternaldir = $(toolexeclibgotestingdir)/internal
  306. toolexeclibgotestinginternal_DATA = \
  307. testing/internal/testdeps.gox
  308. toolexeclibgotextdir = $(toolexeclibgodir)/text
  309. toolexeclibgotext_DATA = \
  310. text/scanner.gox \
  311. text/tabwriter.gox \
  312. text/template.gox
  313. toolexeclibgotexttemplatedir = $(toolexeclibgotextdir)/template
  314. toolexeclibgotexttemplate_DATA = \
  315. text/template/parse.gox
  316. toolexeclibgotimedir = $(toolexeclibgodir)/time
  317. toolexeclibgotime_DATA = \
  318. time/tzdata.gox
  319. toolexeclibgounicodedir = $(toolexeclibgodir)/unicode
  320. toolexeclibgounicode_DATA = \
  321. unicode/utf16.gox \
  322. unicode/utf8.gox
  323. # Some internal packages are needed to bootstrap the gc toolchain.
  324. toolexeclibgointernaldir = $(toolexeclibgodir)/internal
  325. toolexeclibgointernal_DATA = \
  326. internal/reflectlite.gox \
  327. internal/unsafeheader.gox
  328. # Some packages are only needed for tests, so unlike the other
  329. # internal packages nothing will explicitly depend on them.
  330. # Force them to be built.
  331. noinst_DATA = \
  332. golang.org/x/net/nettest.gox \
  333. internal/cfg.gox \
  334. internal/obscuretestdata.gox \
  335. internal/profile.gox \
  336. internal/testenv.gox \
  337. internal/trace.gox \
  338. net/internal/socktest.gox \
  339. os/exec/internal/fdtest.gox \
  340. os/signal/internal/pty.gox \
  341. reflect/internal/example1.gox \
  342. reflect/internal/example2.gox
  343. if LIBGO_IS_RTEMS
  344. rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
  345. else
  346. rtems_task_variable_add_file =
  347. endif
  348. runtime_context_asm_file =
  349. if LIBGO_IS_X86
  350. if LIBGO_IS_LINUX
  351. runtime_context_asm_file += runtime/go-context.S
  352. endif
  353. endif
  354. runtime_files = \
  355. runtime/aeshash.c \
  356. runtime/go-assert.c \
  357. runtime/go-caller.c \
  358. runtime/go-callers.c \
  359. runtime/go-cgo.c \
  360. runtime/go-construct-map.c \
  361. runtime/go-ffi.c \
  362. runtime/go-fieldtrack.c \
  363. runtime/go-matherr.c \
  364. runtime/go-memclr.c \
  365. runtime/go-memmove.c \
  366. runtime/go-memequal.c \
  367. runtime/go-nanotime.c \
  368. runtime/go-now.c \
  369. runtime/go-nosys.c \
  370. runtime/go-reflect-call.c \
  371. runtime/go-setenv.c \
  372. runtime/go-signal.c \
  373. runtime/go-unsafe-pointer.c \
  374. runtime/go-unsetenv.c \
  375. runtime/go-unwind.c \
  376. runtime/go-varargs.c \
  377. runtime/env_posix.c \
  378. runtime/panic.c \
  379. runtime/print.c \
  380. runtime/proc.c \
  381. runtime/runtime_c.c \
  382. runtime/stack.c \
  383. runtime/yield.c \
  384. $(runtime_context_asm_file) \
  385. $(rtems_task_variable_add_file)
  386. version.go: s-version; @true
  387. s-version: Makefile
  388. rm -f version.go.tmp
  389. echo "package sys" > version.go.tmp
  390. echo 'const GccgoToolDir = "$(libexecsubdir)"' >> version.go.tmp
  391. echo 'const StackGuardMultiplierDefault = 1' >> version.go.tmp
  392. $(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
  393. $(STAMP) $@
  394. zgoarch.go: s-zgoarch; @true
  395. s-zgoarch: Makefile goarch.sh
  396. rm -f zgoarch.go.tmp
  397. echo "package goarch" > zgoarch.go.tmp
  398. echo >> zgoarch.go.tmp
  399. echo 'const GOARCH = "'$(GOARCH)'"' >> zgoarch.go.tmp
  400. echo >> zgoarch.go.tmp
  401. echo 'const (' >> zgoarch.go.tmp
  402. echo " _ArchFamily = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) family`" >> zgoarch.go.tmp
  403. echo " _BigEndian = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) bigendian`" >> zgoarch.go.tmp
  404. echo " _DefaultPhysPageSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) defaultphyspagesize`" >> zgoarch.go.tmp
  405. echo " _Int64Align = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) int64align`" >> zgoarch.go.tmp
  406. echo " _MinFrameSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) minframesize`" >> zgoarch.go.tmp
  407. echo " _PCQuantum = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) pcquantum`" >> zgoarch.go.tmp
  408. echo " _StackAlign = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) stackalign`" >> zgoarch.go.tmp
  409. echo ")" >> zgoarch.go.tmp
  410. echo >> zgoarch.go.tmp
  411. echo "const (" >> zgoarch.go.tmp
  412. echo " UNKNOWN ArchFamilyType = iota" >> zgoarch.go.tmp
  413. for a in $(ALLGOARCHFAMILY); do \
  414. echo " $${a}" >> zgoarch.go.tmp; \
  415. done
  416. echo ")" >> zgoarch.go.tmp
  417. echo >> zgoarch.go.tmp
  418. for a in $(ALLGOARCH); do \
  419. f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
  420. n="$${f}`echo $${a} | sed -e 's/.//'`"; \
  421. if test "$${a}" = "$(GOARCH)"; then \
  422. echo "const Is$${n} = 1" >> zgoarch.go.tmp; \
  423. else \
  424. echo "const Is$${n} = 0" >> zgoarch.go.tmp; \
  425. fi; \
  426. done
  427. $(SHELL) $(srcdir)/mvifdiff.sh zgoarch.go.tmp zgoarch.go
  428. $(STAMP) $@
  429. zgoos.go: s-zgoos; @true
  430. s-zgoos: Makefile
  431. rm -f zgoos.go.tmp
  432. echo "package goos" > zgoos.go.tmp
  433. echo >> zgoos.go.tmp
  434. echo 'const GOOS = "'$(GOOS)'"' >> zgoos.go.tmp
  435. echo >> zgoos.go.tmp
  436. for a in $(ALLGOOS); do \
  437. f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
  438. n="$${f}`echo $${a} | sed -e 's/.//'`"; \
  439. if test "$${a}" = "$(GOOS)"; then \
  440. echo "const Is$${n} = 1" >> zgoos.go.tmp; \
  441. else \
  442. echo "const Is$${n} = 0" >> zgoos.go.tmp; \
  443. fi; \
  444. done
  445. $(SHELL) $(srcdir)/mvifdiff.sh zgoos.go.tmp zgoos.go
  446. $(STAMP) $@
  447. cpugen.go: s-cpu; @true
  448. s-cpu: Makefile goarch.sh
  449. rm -f cpugen.go.tmp
  450. echo "package cpu" > cpugen.go.tmp
  451. echo "const CacheLinePadSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> cpugen.go.tmp
  452. echo "const FunctionDescriptors = $(FUNCTION_DESCRIPTORS)" >> cpugen.go.tmp
  453. $(SHELL) $(srcdir)/mvifdiff.sh cpugen.go.tmp cpugen.go
  454. $(STAMP) $@
  455. gcpugen.go: s-gcpu; @true
  456. s-gcpu: Makefile goarch.sh
  457. rm -f gcpugen.go.tmp
  458. echo "package cpu" > gcpugen.go.tmp
  459. echo "const cacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> gcpugen.go.tmp
  460. $(SHELL) $(srcdir)/mvifdiff.sh gcpugen.go.tmp gcpugen.go
  461. $(STAMP) $@
  462. goroot.go: s-goroot; @true
  463. s-goroot: Makefile
  464. rm -f goroot.go.tmp
  465. echo "package runtime" > goroot.go.tmp
  466. echo 'var defaultGOROOT = `$(prefix)`' >> goroot.go.tmp
  467. $(SHELL) $(srcdir)/mvifdiff.sh goroot.go.tmp goroot.go
  468. $(STAMP) $@
  469. buildcfg.go: s-buildcfg; @true
  470. s-buildcfg: Makefile
  471. rm -f buildcfg.go.tmp
  472. echo "package buildcfg" > buildcfg.go.tmp
  473. echo "import \"runtime\"" >> buildcfg.go.tmp
  474. echo 'func defaultGOROOTValue() string { return `$(prefix)` }' >> buildcfg.go.tmp
  475. echo 'const defaultGO386 = `sse2`' >> buildcfg.go.tmp
  476. echo 'const defaultGOAMD64 = `v1`' >> buildcfg.go.tmp
  477. echo 'const defaultGOARM = `5`' >> buildcfg.go.tmp
  478. echo 'const defaultGOMIPS = `hardfloat`' >> buildcfg.go.tmp
  479. echo 'const defaultGOMIPS64 = `hardfloat`' >> buildcfg.go.tmp
  480. echo 'const defaultGOPPC64 = `power8`' >> buildcfg.go.tmp
  481. echo 'const defaultGOEXPERIMENT = `fieldtrack`' >> buildcfg.go.tmp
  482. echo 'const defaultGO_EXTLINK_ENABLED = ``' >> buildcfg.go.tmp
  483. echo 'const defaultGO_LDSO = ``' >> buildcfg.go.tmp
  484. echo 'const version = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> buildcfg.go.tmp
  485. echo 'const defaultGOOS = runtime.GOOS' >> buildcfg.go.tmp
  486. echo 'const defaultGOARCH = runtime.GOARCH' >> buildcfg.go.tmp
  487. $(SHELL) $(srcdir)/mvifdiff.sh buildcfg.go.tmp buildcfg.go
  488. $(STAMP) $@
  489. objabi.go: s-objabi; @true
  490. s-objabi: Makefile
  491. rm -f objabi.go.tmp
  492. echo "package objabi" > objabi.go.tmp
  493. echo 'const stackGuardMultiplierDefault = 1' >> objabi.go.tmp
  494. $(SHELL) $(srcdir)/mvifdiff.sh objabi.go.tmp objabi.go
  495. $(STAMP) $@
  496. gccgosizes.go: s-gccgosizes; @true
  497. s-gccgosizes: Makefile goarch.sh
  498. rm -f gccgosizes.go.tmp
  499. echo "package types" > gccgosizes.go.tmp
  500. echo >> gccgosizes.go.tmp
  501. echo "var gccgoArchSizes = map[string]*StdSizes{" >> gccgosizes.go.tmp
  502. for a in $(ALLGOARCH); do \
  503. ptrsize=`$(SHELL) $(srcdir)/goarch.sh $$a ptrsize`; \
  504. maxalign=`$(SHELL) $(srcdir)/goarch.sh $$a maxalign`; \
  505. echo " \"$$a\": {$${ptrsize}, $${maxalign}}," >> gccgosizes.go.tmp; \
  506. done
  507. echo "}" >> gccgosizes.go.tmp
  508. $(SHELL) $(srcdir)/mvifdiff.sh gccgosizes.go.tmp gccgosizes.go
  509. $(STAMP) $@
  510. os_linknames.go: s-os_linknames; @true
  511. s-os_linknames: os-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/os/*.go
  512. rm -f os_linknames.go.tmp
  513. $(AWK) -f $(srcdir)/mklinknames.awk -v package=os `cat os-list` > os_linknames.go.tmp
  514. $(SHELL) $(srcdir)/mvifdiff.sh os_linknames.go.tmp os_linknames.go
  515. $(STAMP) $@
  516. os-list: s-os-list; @true
  517. s-os-list: Makefile $(srcdir)/go/os/*.go
  518. rm -f os-list.tmp
  519. $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/os > os-list.tmp
  520. $(SHELL) $(srcdir)/mvifdiff.sh os-list.tmp os-list
  521. $(STAMP) $@
  522. os_user_linknames.go: s-os_user_linknames; @true
  523. s-os_user_linknames: os-user-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/os/user/*.go
  524. rm -f os_user_linknames.go.tmp
  525. $(AWK) -f $(srcdir)/mklinknames.awk -v package=user `cat os-user-list` > os_user_linknames.go.tmp
  526. $(SHELL) $(srcdir)/mvifdiff.sh os_user_linknames.go.tmp os_user_linknames.go
  527. $(STAMP) $@
  528. os-user-list: s-os-user-list; @true
  529. s-os-user-list: Makefile $(srcdir)/go/os/user/*.go
  530. rm -f os-user-list.tmp
  531. $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/os/user > os-user-list.tmp
  532. $(SHELL) $(srcdir)/mvifdiff.sh os-user-list.tmp os-user-list
  533. $(STAMP) $@
  534. runtime_linknames.go: s-runtime_linknames; @true
  535. s-runtime_linknames: runtime-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/runtime/*.go
  536. rm -f runtime_linknames.go.tmp
  537. $(AWK) -f $(srcdir)/mklinknames.awk -v package=runtime `cat runtime-list` > runtime_linknames.go.tmp
  538. $(SHELL) $(srcdir)/mvifdiff.sh runtime_linknames.go.tmp runtime_linknames.go
  539. $(STAMP) $@
  540. runtime-list: s-runtime-list; @true
  541. s-runtime-list: Makefile $(srcdir)/go/runtime/*.go
  542. rm -f runtime-list.tmp
  543. $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/runtime > runtime-list.tmp
  544. $(SHELL) $(srcdir)/mvifdiff.sh runtime-list.tmp runtime-list
  545. $(STAMP) $@
  546. runtime_sysinfo.go: s-runtime_sysinfo; @true
  547. s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
  548. GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mkrsysinfo.sh
  549. $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
  550. $(STAMP) $@
  551. sigtab.go: s-sigtab; @true
  552. s-sigtab: $(srcdir)/mksigtab.sh gen-sysinfo.go
  553. GOOS=$(GOOS) $(SHELL) $(srcdir)/mksigtab.sh > tmp-sigtab.go
  554. $(SHELL) $(srcdir)/mvifdiff.sh tmp-sigtab.go sigtab.go
  555. $(STAMP) $@
  556. GCCGO_INSTALL_NAME := $(shell echo gccgo|sed '$(program_transform_name)')
  557. GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
  558. GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
  559. zdefaultcc.go: s-zdefaultcc; @true
  560. s-zdefaultcc: Makefile
  561. echo 'package cfg' > zdefaultcc.go.tmp
  562. echo >> zdefaultcc.go.tmp
  563. echo 'func DefaultGCCGO(goos, goarch string) string { return "$(bindir)/$(GCCGO_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
  564. echo 'func DefaultCC(goos, goarch string) string { return "$(GCC_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
  565. echo 'func DefaultCXX(goos, goarch string) string { return "$(GXX_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
  566. echo 'const DefaultPkgConfig = "pkg-config"' >> zdefaultcc.go.tmp
  567. echo 'var OSArchSupportsCgo = map[string]bool{}' >> zdefaultcc.go.tmp
  568. $(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go
  569. $(STAMP) $@
  570. # Post-process runtime.inc.raw (raw output of -fgo-c-header option when
  571. # compiling runtime) to prune out certain types that should not be
  572. # exported back to C. See comments in mkruntimeinc.sh for more details.
  573. runtime.inc: s-runtime-inc; @true
  574. s-runtime-inc: runtime.lo mkruntimeinc.sh Makefile
  575. $(SHELL) $(srcdir)/mkruntimeinc.sh
  576. $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime.inc runtime.inc
  577. $(STAMP) $@
  578. noinst_DATA += zdefaultcc.go
  579. # Generate the list of go std packages that were included in libgo
  580. zstdpkglist.go: s-zstdpkglist; @true
  581. s-zstdpkglist: Makefile libgo-packages.txt
  582. rm -f zstdpkglist.go.tmp
  583. echo 'package goroot' > zstdpkglist.go.tmp
  584. echo "" >> zstdpkglist.go.tmp
  585. echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
  586. echo $(libgo_go_objs) 'unsafe.lo' | sed 's|[a-z0-9_./]*_c\.lo||g' | sed 's|golang\.org/[a-z0-9_./]*\.lo||g' | sed 's|\([a-z0-9_./]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp
  587. echo '}' >> zstdpkglist.go.tmp
  588. $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
  589. $(STAMP) $@
  590. if LIBGO_IS_LINUX
  591. syscall_epoll_file = epoll.go
  592. else
  593. syscall_epoll_file =
  594. endif
  595. libcalls.go: s-libcalls; @true
  596. s-libcalls: libcalls-list go/syscall/mksyscall.awk $(srcdir)/go/syscall/*.go
  597. rm -f libcalls.go.tmp
  598. $(AWK) -f $(srcdir)/go/syscall/mksyscall.awk `cat libcalls-list` > libcalls.go.tmp
  599. $(SHELL) $(srcdir)/mvifdiff.sh libcalls.go.tmp libcalls.go
  600. $(STAMP) $@
  601. libcalls-list: s-libcalls-list; @true
  602. s-libcalls-list: Makefile $(srcdir)/go/syscall/*.go
  603. rm -f libcalls-list.tmp
  604. $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/syscall $(matchargs_syscall) > libcalls-list.tmp
  605. $(SHELL) $(srcdir)/mvifdiff.sh libcalls-list.tmp libcalls-list
  606. $(STAMP) $@
  607. syscall_arch.go: s-syscall_arch; @true
  608. s-syscall_arch: Makefile
  609. rm -f syscall_arch.go.tmp
  610. echo "package syscall" > syscall_arch.go.tmp
  611. echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
  612. echo 'const OS = "'$(GOOS)'"' >> syscall_arch.go.tmp
  613. $(SHELL) $(srcdir)/mvifdiff.sh syscall_arch.go.tmp syscall_arch.go
  614. $(STAMP) $@
  615. syscall_linknames.go: s-syscall_linknames; @true
  616. s-syscall_linknames: libcalls.go gen-sysinfo.go $(srcdir)/mklinknames.awk
  617. rm -f syscall_linknames.go.tmp
  618. $(AWK) -v package=syscall -f $(srcdir)/mklinknames.awk libcalls.go > syscall_linknames.go.tmp
  619. $(SHELL) $(srcdir)/mvifdiff.sh syscall_linknames.go.tmp syscall_linknames.go
  620. $(STAMP) $@
  621. SYSINFO_FLAGS = \
  622. $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
  623. $(CPPFLAGS) $(OSCFLAGS) -O
  624. gen-sysinfo.go: s-gen-sysinfo; @true
  625. s-gen-sysinfo: $(srcdir)/sysinfo.c config.h
  626. $(CC) $(SYSINFO_FLAGS) -fdump-go-spec=tmp-gen-sysinfo.go -std=gnu99 -S -o sysinfo.s $(srcdir)/sysinfo.c
  627. rm -f sysinfo.s
  628. $(SHELL) $(srcdir)/mvifdiff.sh tmp-gen-sysinfo.go gen-sysinfo.go
  629. $(STAMP) $@
  630. errno.i: s-errno; @true
  631. s-errno:
  632. echo '#include <errno.h>' | $(CC) $(SYSINFO_FLAGS) -x c - -E -dM > tmp-errno.i
  633. $(SHELL) $(srcdir)/mvifdiff.sh tmp-errno.i errno.i
  634. $(STAMP) $@
  635. sysinfo.go: s-sysinfo; @true
  636. s-sysinfo: $(srcdir)/mksysinfo.sh gen-sysinfo.go errno.i
  637. GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh
  638. $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go
  639. $(STAMP) $@
  640. # The epoll struct has an embedded union and is packed on x86_64,
  641. # which is too complicated for mksysinfo.sh. We find the offset of
  642. # the only field we care about in configure.ac, and generate the
  643. # struct here.
  644. epoll.go: s-epoll; @true
  645. s-epoll: Makefile
  646. rm -f epoll.go.tmp
  647. echo 'package syscall' > epoll.go.tmp
  648. echo 'type EpollEvent struct {' >> epoll.go.tmp
  649. echo ' Events uint32' >> epoll.go.tmp
  650. case "$(SIZEOF_STRUCT_EPOLL_EVENT),$(STRUCT_EPOLL_EVENT_FD_OFFSET)" in \
  651. 0,0) echo 1>&2 "*** struct epoll_event data.fd offset unknown"; \
  652. exit 1; ;; \
  653. 8,4) echo ' Fd int32' >> epoll.go.tmp; ;; \
  654. 12,4) echo ' Fd int32' >> epoll.go.tmp; \
  655. echo ' Pad [4]byte' >> epoll.go.tmp; ;; \
  656. 12,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
  657. echo ' Fd int32' >> epoll.go.tmp; ;; \
  658. 16,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
  659. echo ' Fd int32' >> epoll.go.tmp; \
  660. echo ' Pad2 [4]byte' >> epoll.go.tmp; ;; \
  661. *) echo 1>&2 "*** struct epoll_event unsupported"; \
  662. exit 1; ;; \
  663. esac
  664. echo '}' >> epoll.go.tmp
  665. $(SHELL) $(srcdir)/mvifdiff.sh epoll.go.tmp epoll.go
  666. $(STAMP) $@
  667. if LIBGO_IS_LINUX
  668. syscall_lib_clone_lo = syscall/clone_linux.lo
  669. else
  670. syscall_lib_clone_lo =
  671. endif
  672. if LIBGO_IS_X86
  673. golangorg_x_sys_cpu_gccgo_x86_lo = golang.org/x/sys/cpu_gccgo_x86.lo
  674. else
  675. golangorg_x_sys_cpu_gccgo_x86_lo =
  676. endif
  677. PACKAGES = $(shell cat $(srcdir)/libgo-packages.txt)
  678. libgo_go_objs = \
  679. $(addsuffix .lo,$(PACKAGES)) \
  680. internal/bytealg/bytealg.lo \
  681. reflect/makefunc_ffi_c.lo \
  682. $(syscall_lib_clone_lo) \
  683. syscall/errno.lo \
  684. syscall/signame.lo \
  685. syscall/wait.lo \
  686. runtime/internal/syscall/errno.lo \
  687. os/dir_gccgo_c.lo \
  688. $(golangorg_x_net_lif_lo) \
  689. $(golangorg_x_net_route_lo) \
  690. log/syslog/syslog_c.lo \
  691. $(os_lib_inotify_lo) \
  692. runtime/internal/atomic_c.lo \
  693. sync/atomic_c.lo \
  694. internal/cpu/cpu_gccgo.lo \
  695. $(golangorg_x_sys_cpu_gccgo_x86_lo)
  696. libgo_ldflags = \
  697. -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
  698. libgo_libadd = \
  699. $(libgo_go_objs) ../libbacktrace/libbacktrace.la \
  700. $(LIBATOMIC) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS)
  701. libgo_la_SOURCES = $(runtime_files)
  702. libgo_la_LDFLAGS = $(libgo_ldflags)
  703. libgo_la_LIBADD = $(libgo_libadd)
  704. libgo_llgo_la_SOURCES = $(runtime_files)
  705. libgo_llgo_la_LDFLAGS = $(libgo_ldflags)
  706. libgo_llgo_la_LIBADD = $(libgo_libadd)
  707. libgobegin_a_SOURCES = \
  708. runtime/go-main.c
  709. libgobegin_llgo_a_SOURCES = \
  710. runtime/go-main.c
  711. # Use -fPIC for libgobegin so that it can be put in a PIE.
  712. libgobegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
  713. libgobegin_llgo_a_CFLAGS = $(AM_CFLAGS) -fPIC
  714. libgolibbegin_a_SOURCES = \
  715. runtime/go-libmain.c
  716. libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
  717. GOTOOL_PACKAGES = $(shell cat $(srcdir)/gotool-packages.txt)
  718. libgotool_a_SOURCES =
  719. libgotool_a_DEPENDENCIES = $(addsuffix .lo,$(GOTOOL_PACKAGES))
  720. libgotool_a_LIBADD = $(addsuffix .o,$(GOTOOL_PACKAGES))
  721. define STATIC_template
  722. $(subst -,_,$(subst .,_,$(subst /,_,$(1))))_GOCFLAGS = -static
  723. endef
  724. $(foreach package,$(GOTOOL_PACKAGES),$(eval $(call STATIC_template,$(package).lo)))
  725. # Make sure runtime.inc is built before compiling any .c file.
  726. $(libgo_la_OBJECTS): runtime.inc
  727. $(libgo_llgo_la_OBJECTS): runtime.inc
  728. $(libgobegin_a_OBJECTS): runtime.inc
  729. $(libgobegin_llgo_a_OBJECTS): runtime.inc
  730. $(libgolibbegin_a_OBJECTS): runtime.inc
  731. LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
  732. GOCFLAGS = $(CFLAGS)
  733. AM_GOCFLAGS = $(STRINGOPS_FLAG) $(GO_SPLIT_STACK)
  734. GOCOMPILE = $(GOC) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_GOCFLAGS) $(GOCFLAGS)
  735. LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \
  736. $(AM_GOCFLAGS) $(GOCFLAGS)
  737. GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \
  738. $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_GOCFLAGS) $(LTLDFLAGS) -o $@
  739. # Build the dependencies for a Go package.
  740. BUILDDEPS = \
  741. $(MKDIR_P) $(@D); \
  742. dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \
  743. files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$$dir --extrafiles="$(extra_go_files_$(subst .,_,$(subst /,_,$(subst .lo.dep,,$@))))" $(matchargs_$(subst /,_,$(subst .lo.dep,,$@)))`; \
  744. $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \
  745. if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \
  746. rm -f `echo $@ | sed -e 's/\.dep$$//'`; \
  747. fi; \
  748. mv -f $@.tmp $@
  749. # Build the .go files for a package, generating a .lo file.
  750. BUILDPACKAGE = \
  751. $(MKDIR_P) $(@D); \
  752. files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
  753. $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
  754. # How to build a .gox file from a .lo file.
  755. # Matching .o file can either be in the same directory as the .lo (non-PIC
  756. # object) or in the .libs directory (PIC object).
  757. BUILDGOX = \
  758. f="$(basename $<).o"; \
  759. if test ! -f $$f; then \
  760. f="$(basename $(<D)/.libs/$(<F)).o"; \
  761. fi; \
  762. $(OBJCOPY) -j $(GO_EXPORT_SECTION_NAME) $$f $@.tmp; \
  763. $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
  764. GOTESTFLAGS =
  765. GOBENCH =
  766. # Check a package.
  767. CHECK = \
  768. GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
  769. export GC; \
  770. GOLIBS="$(extra_check_libs_$(subst .,_,$(subst /,_,$(@D)))) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS) $(LIBS)"; \
  771. export GOLIBS; \
  772. RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
  773. export RUNTESTFLAGS; \
  774. MAKE="$(MAKE)"; \
  775. export MAKE; \
  776. NM="$(NM)"; \
  777. export NM; \
  778. libgccdir=`${GOC} ${GOCFLAGS} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \
  779. LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \
  780. LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
  781. export LD_LIBRARY_PATH; \
  782. $(MKDIR_P) $(@D); \
  783. rm -f $@-testsum $@-testlog; \
  784. files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst .,_,$(subst /,_,$(@D))))" $(matchargs_$(subst /,_,$(@D)))`; \
  785. if test "$(USE_DEJAGNU)" = "yes"; then \
  786. $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
  787. elif test "$(GOBENCH)" != ""; then \
  788. $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
  789. else \
  790. if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \
  791. echo "PASS: $(@D)" >> $@-testlog; \
  792. echo "PASS: $(@D)"; \
  793. echo "PASS: $(@D)" > $@-testsum; \
  794. else \
  795. echo "FAIL: $(@D)" >> $@-testlog; \
  796. cat $@-testlog; \
  797. echo "FAIL: $(@D)" > $@-testsum; \
  798. exit 1; \
  799. fi; \
  800. fi
  801. # Build all packages before checking any.
  802. CHECK_DEPS = \
  803. $(toolexeclibgo_DATA) \
  804. $(toolexeclibgoarchive_DATA) \
  805. $(toolexeclibgocompress_DATA) \
  806. $(toolexeclibgocontainer_DATA) \
  807. $(toolexeclibgocrypto_DATA) \
  808. $(toolexeclibgodebug_DATA) \
  809. $(toolexeclibgoencoding_DATA) \
  810. $(toolexeclibgogo_DATA) \
  811. $(toolexeclibgohash_DATA) \
  812. $(toolexeclibgoimage_DATA) \
  813. $(toolexeclibgoindex_DATA) \
  814. $(toolexeclibgoio_DATA) \
  815. $(toolexeclibgolog_DATA) \
  816. $(toolexeclibgomath_DATA) \
  817. $(toolexeclibgomime_DATA) \
  818. $(toolexeclibgonet_DATA) \
  819. $(toolexeclibgonethttp_DATA) \
  820. $(toolexeclibgoos_DATA) \
  821. $(toolexeclibgopath_DATA) \
  822. $(toolexeclibgorpc_DATA) \
  823. $(toolexeclibgoruntime_DATA) \
  824. $(toolexeclibgosync_DATA) \
  825. $(toolexeclibgotesting_DATA) \
  826. $(toolexeclibgotext_DATA) \
  827. $(toolexeclibgotexttemplate_DATA) \
  828. $(toolexeclibgounicode_DATA) \
  829. $(noinst_DATA) \
  830. $(noinst_LIBRARIES)
  831. if GOC_IS_LLGO
  832. CHECK_DEPS += libgo-llgo.la libgobegin-llgo.a
  833. else
  834. CHECK_DEPS += libgo.la libgobegin.a
  835. endif
  836. # PACKAGE_template defines the rules for each package.
  837. # For example, for the package bufio, it produces:
  838. #
  839. # @go_include@ bufio.lo.dep
  840. # bufio.lo.dep: $(srcdir)/go/bufio/*.go
  841. # $(BUILDDEPS)
  842. # bufio.lo:
  843. # $(BUILDPACKAGE)
  844. # bufio/check: $(CHECK_DEPS)
  845. # @$(CHECK)
  846. # .PHONY: bufio/check
  847. #
  848. # This is invoked with $(1) set to a package, which is a directory name,
  849. # such as "bufio" or "archive/tar".
  850. define PACKAGE_template
  851. @go_include@ $(1).lo.dep
  852. $(1).lo.dep: $(srcdir)/go/$(1)/*.go
  853. $$(BUILDDEPS)
  854. $(1).lo:
  855. $$(BUILDPACKAGE)
  856. $(1)/check: $$(CHECK_DEPS)
  857. @$$(CHECK)
  858. .PHONY: $(1)/check
  859. $(1).gox: $(1).s-gox; @true
  860. $(1).s-gox: $(1).lo
  861. $$(BUILDGOX)
  862. $$(STAMP) $$@
  863. endef
  864. # This line expands PACKAGE_template once for each package name listed
  865. # in $(PACKAGES).
  866. $(foreach package,$(PACKAGES),$(eval $(call PACKAGE_template,$(package))))
  867. $(foreach package,$(GOTOOL_PACKAGES),$(eval $(call PACKAGE_template,$(package))))
  868. # Pass -ffp-contract=off, or 386-specific options, when building the
  869. # math package. MATH_FLAG is defined in configure.ac.
  870. math_lo_GOCFLAGS = $(MATH_FLAG)
  871. math_check_GOCFLAGS = $(MATH_FLAG)
  872. # Add generated files to the runtime package.
  873. extra_go_files_runtime = \
  874. runtime_linknames.go runtime_sysinfo.go sigtab.go goroot.go
  875. runtime.lo.dep: $(extra_go_files_runtime)
  876. # Add generated files to the syscall package.
  877. extra_go_files_syscall = \
  878. libcalls.go \
  879. sysinfo.go \
  880. syscall_arch.go \
  881. syscall_linknames.go \
  882. $(syscall_epoll_file)
  883. syscall.lo.dep: $(extra_go_files_syscall)
  884. # Pass -fgo-compiling-runtime when compiling the runtime package.
  885. runtime_lo_GOCFLAGS = -fgo-c-header=runtime.inc.raw -fgo-compiling-runtime
  886. runtime_check_GOCFLAGS = -fgo-compiling-runtime
  887. runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
  888. runtime_internal_atomic_lo_check_GOCFLAGS = -fgo-compiling-runtime
  889. runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
  890. runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime
  891. # If libffi is supported (the normal case) use the ffi build tag for
  892. # the runtime package.
  893. if USE_LIBFFI
  894. matchargs_runtime = --tag=libffi
  895. else
  896. matchargs_runtime =
  897. endif
  898. # At least for now, we need -static-libgo for this test, because
  899. # otherwise we can't get the line numbers.
  900. # Also use -fno-inline to get better results from the memory profiler.
  901. runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
  902. if LIBGO_IS_AIX
  903. # reflect tests must be done with -static-libgo. Otherwize,
  904. # there will be a duplication of the canonicalization map.
  905. reflect_check_GOCFLAGS = -static-libgo -Wl,-bbigtoc
  906. endif
  907. if HAVE_STATIC_LINK
  908. # Use -static for the syscall tests if possible, because otherwise when
  909. # running as root the re-execs ignore LD_LIBRARY_PATH.
  910. syscall_check_GOCFLAGS = -static
  911. endif
  912. extra_go_files_runtime_internal_sys = version.go
  913. runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
  914. extra_go_files_internal_cpu = cpugen.go
  915. internal/cpu.lo.dep: $(extra_go_files_internal_cpu)
  916. extra_go_files_internal_goarch = zgoarch.go
  917. internal/goarch.lo.dep: $(extra_go_files_internal_goarch)
  918. extra_go_files_internal_goos = zgoos.go
  919. internal/goos.lo.dep: $(extra_go_files_internal_goos)
  920. extra_go_files_golang_org_x_sys_cpu = gcpugen.go
  921. golang.org/x/sys/cpu.lo.dep: $(extra_go_files_golang_org_x_sys_cpu)
  922. extra_go_files_internal_buildcfg = buildcfg.go
  923. cmd/internal/buildcfg.lo.dep: $(extra_go_files_internal_buildcfg)
  924. extra_go_files_internal_goroot = zstdpkglist.go
  925. internal/goroot.lo.dep: $(extra_go_files_internal_goroot)
  926. extra_go_files_go_types = gccgosizes.go
  927. go/types.lo.dep: $(extra_go_files_go_types)
  928. extra_go_files_cmd_internal_objabi = objabi.go
  929. cmd/internal/objabi.lo.dep: $(extra_go_files_cmd_internal_objabi)
  930. extra_go_files_cmd_go_internal_cfg = zdefaultcc.go
  931. cmd/go/internal/cfg.lo.dep: $(extra_go_files_cmd_go_internal_cfg)
  932. extra_go_files_os = os_linknames.go
  933. os.lo.dep: $(extra_go_files_os)
  934. extra_go_files_os_user = os_user_linknames.go
  935. os/user.lo.dep: $(extra_go_files_os_user)
  936. extra_check_libs_cmd_go_internal_cache = $(abs_builddir)/libgotool.a
  937. extra_check_libs_cmd_go_internal_fsys = $(abs_builddir)/libgotool.a
  938. extra_check_libs_cmd_go_internal_generate = $(abs_builddir)/libgotool.a
  939. extra_check_libs_cmd_go_internal_get = $(abs_builddir)/libgotool.a
  940. extra_check_libs_cmd_go_internal_load = $(abs_builddir)/libgotool.a
  941. extra_check_libs_cmd_go_internal_lockedfile = $(abs_builddir)/libgotool.a
  942. extra_check_libs_cmd_go_internal_imports = $(abs_builddir)/libgotool.a
  943. extra_check_libs_cmd_go_internal_modconv = $(abs_builddir)/libgotool.a
  944. extra_check_libs_cmd_go_internal_modfetch = $(abs_builddir)/libgotool.a
  945. extra_check_libs_cmd_go_internal_modfetch_codehost = $(abs_builddir)/libgotool.a
  946. extra_check_libs_cmd_go_internal_modfile = $(abs_builddir)/libgotool.a
  947. extra_check_libs_cmd_go_internal_modload = $(abs_builddir)/libgotool.a
  948. extra_check_libs_cmd_go_internal_module = $(abs_builddir)/libgotool.a
  949. extra_check_libs_cmd_go_internal_mvs = $(abs_builddir)/libgotool.a
  950. extra_check_libs_cmd_go_internal_search = $(abs_builddir)/libgotool.a
  951. extra_check_libs_cmd_go_internal_str = $(abs_builddir)/libgotool.a
  952. extra_check_libs_cmd_go_internal_test = $(abs_builddir)/libgotool.a
  953. extra_check_libs_cmd_go_internal_vcs = $(abs_builddir)/libgotool.a
  954. extra_check_libs_cmd_go_internal_web2 = $(abs_builddir)/libgotool.a
  955. extra_check_libs_cmd_go_internal_work = $(abs_builddir)/libgotool.a
  956. extra_check_libs_cmd_internal_buildid = $(abs_builddir)/libgotool.a
  957. extra_check_libs_cmd_vet_internal_cfg = $(abs_builddir)/libgotool.a
  958. # FIXME: The following C files may as well move to the runtime
  959. # directory and be treated like other C files.
  960. # Use C code to speed up internal/bytealg.IndexByte and friends.
  961. internal/bytealg/bytealg.lo: go/internal/bytealg/bytealg.c runtime.inc
  962. @$(MKDIR_P) internal/bytealg
  963. $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/bytealg/bytealg.c
  964. # Use a C function with a fixed number of arguments to call a C
  965. # varargs function.
  966. log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc
  967. @$(MKDIR_P) log/syslog
  968. $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c
  969. # The interface to libffi from the reflect package is written in C.
  970. reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
  971. @$(MKDIR_P) reflect
  972. $(LTCOMPILE) -c -o $@ $(srcdir)/go/reflect/makefunc_ffi_c.c
  973. # The atomic functions are written in C.
  974. runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc
  975. @$(MKDIR_P) runtime/internal
  976. $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/atomic/atomic.c
  977. sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc
  978. @$(MKDIR_P) sync
  979. $(LTCOMPILE) -c -o $@ $(srcdir)/go/sync/atomic/atomic.c
  980. # A few syscall functions are written in C.
  981. syscall/clone_linux.lo: go/syscall/clone_linux.c runtime.inc
  982. @$(MKDIR_P) syscall
  983. $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/clone_linux.c
  984. syscall/errno.lo: go/syscall/errno.c runtime.inc
  985. @$(MKDIR_P) syscall
  986. $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/errno.c
  987. syscall/signame.lo: go/syscall/signame.c runtime.inc
  988. @$(MKDIR_P) syscall
  989. $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/signame.c
  990. syscall/wait.lo: go/syscall/wait.c runtime.inc
  991. @$(MKDIR_P) syscall
  992. $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c
  993. # Some runtime/internal/syscall functions are written in C.
  994. runtime/internal/syscall/errno.lo: go/runtime/internal/syscall/errno.c runtime.inc
  995. @$(MKDIR_P) runtime/internal/syscall
  996. $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/syscall/errno.c
  997. # An os function is written in C.
  998. os/dir_gccgo_c.lo: go/os/dir_gccgo_c.c runtime.inc
  999. @$(MKDIR_P) os
  1000. $(LTCOMPILE) -c -o $@ $(srcdir)/go/os/dir_gccgo_c.c
  1001. # internal/cpu needs some C code.
  1002. internal/cpu/cpu_gccgo.lo: go/internal/cpu/cpu_gccgo.c runtime.inc
  1003. @$(MKDIR_P) internal/cpu
  1004. $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/cpu/cpu_gccgo.c
  1005. # Similarly, golang.org/x/sys/cpu needs some C code.
  1006. golang.org/x/sys/cpu_gccgo_x86.lo: go/golang.org/x/sys/cpu/cpu_gccgo_x86.c runtime.inc
  1007. @$(MKDIR_P) golang.org/x/sys
  1008. $(LTCOMPILE) -c -o $@ $(srcdir)/go/golang.org/x/sys/cpu/cpu_gccgo_x86.c
  1009. # Solaris 11.4 changed the type of fields in struct stat.
  1010. # Use a build tag, based on a configure check, to cope.
  1011. if LIBGO_IS_SOLARIS
  1012. if HAVE_STAT_TIMESPEC
  1013. matchargs_os = --tag=solaristag
  1014. else
  1015. matchargs_os =
  1016. endif
  1017. else
  1018. matchargs_os =
  1019. endif
  1020. if LIBGO_IS_BSD
  1021. # Build golang.org/x/net/route only on BSD systems.
  1022. $(eval $(call PACKAGE_template,golang.org/x/net/route))
  1023. golangorg_x_net_route_lo = \
  1024. golang.org/x/net/route.lo
  1025. endif
  1026. if LIBGO_IS_SOLARIS
  1027. # Build golang.org/x/net/lif only on Solaris systems.
  1028. $(eval $(call PACKAGE_template,golang.org/x/net/lif))
  1029. golangorg_x_net_lif_lo = \
  1030. golang.org/x/net/lif.lo
  1031. endif
  1032. TEST_PACKAGES = $(addsuffix /check,$(shell cat $(srcdir)/check-packages.txt))
  1033. check: check-tail
  1034. check-recursive: check-head
  1035. check-head:
  1036. @echo "Test Run By $${USER} on `date`" > libgo.head
  1037. @echo "Native configuration is $(host_triplet)" >> libgo.head
  1038. @echo >> libgo.head
  1039. @echo " === libgo tests ===" >> libgo.head
  1040. @echo >> libgo.head
  1041. check-tail: check-recursive check-multi
  1042. @if test "$(USE_DEJAGNU)" = "yes"; then \
  1043. exit 0; \
  1044. fi; \
  1045. lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
  1046. for dir in . $(MULTIDIRS); do \
  1047. mv ../$${dir}/$${lib}/libgo.sum ../$${dir}/$${lib}/libgo.sum.sep; \
  1048. mv ../$${dir}/$${lib}/libgo.log ../$${dir}/$${lib}/libgo.log.sep; \
  1049. done; \
  1050. mv libgo.head libgo.sum; \
  1051. cp libgo.sum libgo.log; \
  1052. echo "Schedule of variations:" >> libgo.sum; \
  1053. for dir in . $(MULTIDIRS); do \
  1054. multidir=../$${dir}/$${lib}; \
  1055. multivar=`cat $${multidir}/libgo.var`; \
  1056. echo " $${multivar}" >> libgo.sum; \
  1057. done; \
  1058. echo >> libgo.sum; \
  1059. pass=0; fail=0; untested=0; \
  1060. for dir in . $(MULTIDIRS); do \
  1061. multidir=../$${dir}/$${lib}; \
  1062. multivar=`cat $${multidir}/libgo.var`; \
  1063. echo "Running target $${multivar}" >> libgo.sum; \
  1064. echo "Running $(srcdir)/libgo.exp ..." >> libgo.sum; \
  1065. cat $${multidir}/libgo.sum.sep >> libgo.sum; \
  1066. cat $${multidir}/libgo.log.sep >> libgo.log; \
  1067. if test -n "${MULTIDIRS}"; then \
  1068. echo " === libgo Summary for $${multivar} ===" >> libgo.sum; \
  1069. echo >> libgo.sum; \
  1070. fi; \
  1071. p=`grep -c PASS $${multidir}/libgo.sum.sep`; \
  1072. pass=`expr $$pass + $$p`; \
  1073. if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
  1074. echo "# of expected passes $$p" >> libgo.sum; \
  1075. fi; \
  1076. p=`grep -c FAIL $${multidir}/libgo.sum.sep`; \
  1077. fail=`expr $$fail + $$p`; \
  1078. if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
  1079. echo "# of unexpected failures $$p" >> libgo.sum; \
  1080. fi; \
  1081. p=`grep -c UNTESTED $${multidir}/libgo.sum.sep`; \
  1082. untested=`expr $$untested + $$p`; \
  1083. if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
  1084. echo "# of untested testcases $$p" >> libgo.sum; \
  1085. fi; \
  1086. done; \
  1087. echo >> libgo.sum; \
  1088. echo " === libgo Summary ===" >> libgo.sum; \
  1089. echo >> libgo.sum; \
  1090. if test "$$pass" -ne "0"; then \
  1091. echo "# of expected passes $$pass" >> libgo.sum; \
  1092. fi; \
  1093. if test "$$fail" -ne "0"; then \
  1094. echo "# of unexpected failures $$fail" >> libgo.sum; \
  1095. fi; \
  1096. if test "$$untested" -ne "0"; then \
  1097. echo "# of untested testcases $$untested" >> libgo.sum; \
  1098. fi; \
  1099. echo `echo $(GOC) | sed -e 's/ .*//'` `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \
  1100. echo >> libgo.log; \
  1101. echo "runtest completed at `date`" >> libgo.log; \
  1102. if test "$$fail" -ne "0"; then \
  1103. status=1; \
  1104. else \
  1105. status=0; \
  1106. fi; \
  1107. exit $$status
  1108. check-am:
  1109. @rm -f libgo.sum libgo.log libgo.tail
  1110. @multivar="unix"; \
  1111. [ -z "$(MULTIFLAGS)" ] || multivar="$${multivar}/$(MULTIFLAGS)"; \
  1112. echo "$${multivar}" > libgo.var
  1113. @for f in $(TEST_PACKAGES); do \
  1114. rm -f $$f-testsum $$f-testlog; \
  1115. done
  1116. -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES)
  1117. @for f in $(TEST_PACKAGES); do \
  1118. if test -f $$f-testsum; then \
  1119. cat $$f-testsum >> libgo.sum; \
  1120. fi; \
  1121. if test -f $$f-testlog; then \
  1122. cat $$f-testlog >> libgo.log; \
  1123. fi; \
  1124. done
  1125. check-multi:
  1126. $(MULTIDO) $(AM_MAKEFLAGS) DO=check-am multi-do # $(MAKE)
  1127. bench:
  1128. -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES) GOBENCH=.
  1129. MOSTLYCLEANFILES = \
  1130. s-runtime_sysinfo s-sigtab s-runtime-inc s-zstdpkglist \
  1131. s-libcalls s-libcalls-list s-syscall_arch s-gen-sysinfo s-sysinfo \
  1132. s-errno s-epoll \
  1133. libgo.head libgo.sum.sep libgo.log.sep libgo.var \
  1134. libcalls-list \
  1135. runtime.inc runtime.inc.tmp2 runtime.inc.tmp3 runtime.inc.raw
  1136. mostlyclean-local:
  1137. find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f
  1138. find . -name '*.$(OBJEXT)' -print | xargs rm -f
  1139. find . -name '*-testsum' -print | xargs rm -f
  1140. find . -name '*-testlog' -print | xargs rm -f
  1141. CLEANFILES = *.go *.c s-* libgo.sum libgo.log runtime.inc
  1142. clean-local:
  1143. find . -name '*.la' -print | xargs $(LIBTOOL) --mode=clean rm -f
  1144. find . -name '*.a' -print | xargs rm -f
  1145. find . -name '*.gox' -print | xargs rm -f
  1146. find . -name '*.s-gox' -print | xargs rm -f
  1147. distclean-local:
  1148. find . -name '*.lo.dep' -print | xargs rm -f
  1149. include $(top_srcdir)/../multilib.am
  1150. if LIBGO_IS_AIX
  1151. ALL_LOCAL_DEPS = add-aix-fat-library
  1152. else
  1153. ALL_LOCAL_DEPS =
  1154. endif
  1155. all-local: $(ALL_LOCAL_DEPS)
  1156. MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
  1157. # If we want to use "AR -r" when creating AIX FAT archives,
  1158. # AR must be stripped of all its -X flags.
  1159. # Otherwize, if AR was defined with -X32_64, the replace option would
  1160. # erase the default .so when adding the extra one. There is no
  1161. # order priority within -X flags.
  1162. add-aix-fat-library: all-multi
  1163. @if test "$(MULTIBUILDTOP)" = ""; then \
  1164. arx=`echo $(AR) | sed -e 's/-X[^ ]*//g'`; \
  1165. $${arx} -X$(AIX_EXTRA_ARCH) rc .libs/$(PACKAGE).a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
  1166. $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
  1167. $${arx} -X$(AIX_EXTRA_ARCH) rc libgobegin.a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgobegin_a_OBJECTS); \
  1168. $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/libgobegin.a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgobegin_a_OBJECTS); \
  1169. $${arx} -X$(AIX_EXTRA_ARCH) rc libgolibbegin.a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgolibbegin_a_OBJECTS); \
  1170. $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/libgolibbegin.a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgolibbegin_a_OBJECTS); \
  1171. fi