comparison libgo/Makefile.am @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
9 # Go support. 9 # Go support.
10 SUFFIXES = .c .go .gox .o .obj .lo .a 10 SUFFIXES = .c .go .gox .o .obj .lo .a
11 11
12 if LIBGO_IS_RTEMS 12 if LIBGO_IS_RTEMS
13 subdirs = testsuite 13 subdirs = testsuite
14 endif
15
16 if LIBGO_IS_DARWIN
17 GO_EXPORT_SECTION_NAME = __GNU_GO.__go_export
18 else
19 GO_EXPORT_SECTION_NAME = .go_export
14 endif 20 endif
15 21
16 SUBDIRS = ${subdirs} 22 SUBDIRS = ${subdirs}
17 23
18 gcc_version := $(shell $(GOC) -dumpversion) 24 gcc_version := $(shell $(GOC) -dumpversion)
179 crypto/aes.gox \ 185 crypto/aes.gox \
180 crypto/cipher.gox \ 186 crypto/cipher.gox \
181 crypto/des.gox \ 187 crypto/des.gox \
182 crypto/dsa.gox \ 188 crypto/dsa.gox \
183 crypto/ecdsa.gox \ 189 crypto/ecdsa.gox \
190 crypto/ed25519.gox \
184 crypto/elliptic.gox \ 191 crypto/elliptic.gox \
185 crypto/hmac.gox \ 192 crypto/hmac.gox \
186 crypto/md5.gox \ 193 crypto/md5.gox \
187 crypto/rand.gox \ 194 crypto/rand.gox \
188 crypto/rc4.gox \ 195 crypto/rc4.gox \
215 debug/dwarf.gox \ 222 debug/dwarf.gox \
216 debug/elf.gox \ 223 debug/elf.gox \
217 debug/gosym.gox \ 224 debug/gosym.gox \
218 debug/macho.gox \ 225 debug/macho.gox \
219 debug/pe.gox \ 226 debug/pe.gox \
220 debug/plan9obj.gox \ 227 debug/plan9obj.gox
221 debug/xcoff.gox
222 228
223 toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding 229 toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding
224 230
225 toolexeclibgoencoding_DATA = \ 231 toolexeclibgoencoding_DATA = \
226 encoding/ascii85.gox \ 232 encoding/ascii85.gox \
254 260
255 toolexeclibgohash_DATA = \ 261 toolexeclibgohash_DATA = \
256 hash/adler32.gox \ 262 hash/adler32.gox \
257 hash/crc32.gox \ 263 hash/crc32.gox \
258 hash/crc64.gox \ 264 hash/crc64.gox \
259 hash/fnv.gox 265 hash/fnv.gox \
266 hash/maphash.gox
260 267
261 toolexeclibgohtmldir = $(toolexeclibgodir)/html 268 toolexeclibgohtmldir = $(toolexeclibgodir)/html
262 269
263 toolexeclibgohtml_DATA = \ 270 toolexeclibgohtml_DATA = \
264 html/template.gox 271 html/template.gox
392 399
393 # Some packages are only needed for tests, so unlike the other 400 # Some packages are only needed for tests, so unlike the other
394 # internal packages nothing will explicitly depend on them. 401 # internal packages nothing will explicitly depend on them.
395 # Force them to be built. 402 # Force them to be built.
396 noinst_DATA = \ 403 noinst_DATA = \
397 golang_org/x/net/internal/nettest.gox \ 404 golang.org/x/net/nettest.gox \
398 golang_org/x/net/nettest.gox \ 405 internal/cfg.gox \
406 internal/obscuretestdata.gox \
399 internal/testenv.gox \ 407 internal/testenv.gox \
400 internal/trace.gox \ 408 internal/trace.gox \
401 net/internal/socktest.gox \ 409 net/internal/socktest.gox \
402 os/signal/internal/pty.gox \ 410 os/signal/internal/pty.gox \
403 runtime/pprof/internal/profile.gox 411 runtime/pprof/internal/profile.gox
406 rtems_task_variable_add_file = runtime/rtems-task-variable-add.c 414 rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
407 else 415 else
408 rtems_task_variable_add_file = 416 rtems_task_variable_add_file =
409 endif 417 endif
410 418
419 runtime_context_asm_file =
420 if LIBGO_IS_X86
411 if LIBGO_IS_LINUX 421 if LIBGO_IS_LINUX
412 runtime_getncpu_file = runtime/getncpu-linux.c 422 runtime_context_asm_file += runtime/go-context.S
413 else
414 if LIBGO_IS_DARWIN
415 runtime_getncpu_file = runtime/getncpu-bsd.c
416 else
417 if LIBGO_IS_IRIX
418 runtime_getncpu_file = runtime/getncpu-irix.c
419 else
420 if LIBGO_IS_SOLARIS
421 runtime_getncpu_file = runtime/getncpu-solaris.c
422 else
423 if LIBGO_IS_FREEBSD
424 runtime_getncpu_file = runtime/getncpu-bsd.c
425 else
426 if LIBGO_IS_NETBSD
427 runtime_getncpu_file = runtime/getncpu-bsd.c
428 else
429 if LIBGO_IS_AIX
430 runtime_getncpu_file = runtime/getncpu-aix.c
431 else
432 runtime_getncpu_file = runtime/getncpu-none.c
433 endif
434 endif
435 endif
436 endif
437 endif
438 endif 423 endif
439 endif 424 endif
440 425
441 runtime_files = \ 426 runtime_files = \
442 runtime/aeshash.c \ 427 runtime/aeshash.c \
448 runtime/go-construct-map.c \ 433 runtime/go-construct-map.c \
449 runtime/go-ffi.c \ 434 runtime/go-ffi.c \
450 runtime/go-fieldtrack.c \ 435 runtime/go-fieldtrack.c \
451 runtime/go-matherr.c \ 436 runtime/go-matherr.c \
452 runtime/go-memclr.c \ 437 runtime/go-memclr.c \
453 runtime/go-memcmp.c \
454 runtime/go-memequal.c \ 438 runtime/go-memequal.c \
455 runtime/go-memmove.c \
456 runtime/go-nanotime.c \ 439 runtime/go-nanotime.c \
457 runtime/go-now.c \ 440 runtime/go-now.c \
458 runtime/go-nosys.c \ 441 runtime/go-nosys.c \
459 runtime/go-reflect-call.c \ 442 runtime/go-reflect-call.c \
460 runtime/go-runtime-error.c \
461 runtime/go-setenv.c \ 443 runtime/go-setenv.c \
462 runtime/go-signal.c \ 444 runtime/go-signal.c \
463 runtime/go-strslice.c \
464 runtime/go-typedesc-equal.c \
465 runtime/go-unsafe-pointer.c \ 445 runtime/go-unsafe-pointer.c \
466 runtime/go-unsetenv.c \ 446 runtime/go-unsetenv.c \
467 runtime/go-unwind.c \ 447 runtime/go-unwind.c \
468 runtime/go-varargs.c \ 448 runtime/go-varargs.c \
469 runtime/env_posix.c \ 449 runtime/env_posix.c \
470 runtime/panic.c \ 450 runtime/panic.c \
471 runtime/print.c \ 451 runtime/print.c \
472 runtime/proc.c \ 452 runtime/proc.c \
473 runtime/runtime_c.c \ 453 runtime/runtime_c.c \
474 runtime/stack.c \ 454 runtime/stack.c \
475 runtime/thread.c \
476 runtime/yield.c \ 455 runtime/yield.c \
477 $(rtems_task_variable_add_file) \ 456 $(runtime_context_asm_file) \
478 $(runtime_getncpu_file) 457 $(rtems_task_variable_add_file)
479 458
480 version.go: s-version; @true 459 version.go: s-version; @true
481 s-version: Makefile 460 s-version: Makefile
482 rm -f version.go.tmp 461 rm -f version.go.tmp
483 echo "package sys" > version.go.tmp 462 echo "package sys" > version.go.tmp
510 echo "const (" >> version.go.tmp 489 echo "const (" >> version.go.tmp
511 echo " ArchFamily = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) family`" >> version.go.tmp 490 echo " ArchFamily = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) family`" >> version.go.tmp
512 echo " BigEndian = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) bigendian`" >> version.go.tmp 491 echo " BigEndian = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) bigendian`" >> version.go.tmp
513 echo " CacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> version.go.tmp 492 echo " CacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> version.go.tmp
514 echo " DefaultPhysPageSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) defaultphyspagesize`" >> version.go.tmp 493 echo " DefaultPhysPageSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) defaultphyspagesize`" >> version.go.tmp
515 echo " HugePageSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) hugepagesize`" >> version.go.tmp
516 echo " Int64Align = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) int64align`" >> version.go.tmp 494 echo " Int64Align = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) int64align`" >> version.go.tmp
517 echo " MinFrameSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) minframesize`" >> version.go.tmp 495 echo " MinFrameSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) minframesize`" >> version.go.tmp
518 echo " PCQuantum = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) pcquantum`" >> version.go.tmp 496 echo " PCQuantum = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) pcquantum`" >> version.go.tmp
519 echo ")" >> version.go.tmp 497 echo ")" >> version.go.tmp
520 echo >> version.go.tmp 498 echo >> version.go.tmp
534 512
535 cpugen.go: s-cpu; @true 513 cpugen.go: s-cpu; @true
536 s-cpu: Makefile 514 s-cpu: Makefile
537 rm -f cpugen.go.tmp 515 rm -f cpugen.go.tmp
538 echo "package cpu" > cpugen.go.tmp 516 echo "package cpu" > cpugen.go.tmp
539 echo "const CacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> cpugen.go.tmp 517 echo "const CacheLinePadSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> cpugen.go.tmp
518 echo "const FunctionDescriptors = $(FUNCTION_DESCRIPTORS)" >> cpugen.go.tmp
540 $(SHELL) $(srcdir)/mvifdiff.sh cpugen.go.tmp cpugen.go 519 $(SHELL) $(srcdir)/mvifdiff.sh cpugen.go.tmp cpugen.go
520 $(STAMP) $@
521
522 gcpugen.go: s-gcpu; @true
523 s-gcpu: Makefile
524 rm -f gcpugen.go.tmp
525 echo "package cpu" > gcpugen.go.tmp
526 echo "const cacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> gcpugen.go.tmp
527 $(SHELL) $(srcdir)/mvifdiff.sh gcpugen.go.tmp gcpugen.go
541 $(STAMP) $@ 528 $(STAMP) $@
542 529
543 objabi.go: s-objabi; @true 530 objabi.go: s-objabi; @true
544 s-objabi: Makefile 531 s-objabi: Makefile
545 rm -f objabi.go.tmp 532 rm -f objabi.go.tmp
546 echo "package objabi" > objabi.go.tmp 533 echo "package objabi" > objabi.go.tmp
547 echo "import \"runtime\"" >> objabi.go.tmp 534 echo "import \"runtime\"" >> objabi.go.tmp
548 echo 'func init() { defaultGOROOT = `$(prefix)` }' >> objabi.go.tmp 535 echo 'func defaultGOROOTValue() string { return `$(prefix)` }' >> objabi.go.tmp
549 echo 'const defaultGO386 = `sse2`' >> objabi.go.tmp 536 echo 'const defaultGO386 = `sse2`' >> objabi.go.tmp
550 echo 'const defaultGOARM = `5`' >> objabi.go.tmp 537 echo 'const defaultGOARM = `5`' >> objabi.go.tmp
551 echo 'const defaultGOMIPS = `hardfloat`' >> objabi.go.tmp 538 echo 'const defaultGOMIPS = `hardfloat`' >> objabi.go.tmp
552 echo 'const defaultGOMIPS64 = `hardfloat`' >> objabi.go.tmp 539 echo 'const defaultGOMIPS64 = `hardfloat`' >> objabi.go.tmp
540 echo 'const defaultGOPPC64 = `power8`' >> objabi.go.tmp
553 echo 'const defaultGOOS = runtime.GOOS' >> objabi.go.tmp 541 echo 'const defaultGOOS = runtime.GOOS' >> objabi.go.tmp
554 echo 'const defaultGOARCH = runtime.GOARCH' >> objabi.go.tmp 542 echo 'const defaultGOARCH = runtime.GOARCH' >> objabi.go.tmp
555 echo 'const defaultGO_EXTLINK_ENABLED = ``' >> objabi.go.tmp 543 echo 'const defaultGO_EXTLINK_ENABLED = ``' >> objabi.go.tmp
544 echo 'const defaultGO_LDSO = ``' >> objabi.go.tmp
556 echo 'const version = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> objabi.go.tmp 545 echo 'const version = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> objabi.go.tmp
557 echo 'const stackGuardMultiplier = 1' >> objabi.go.tmp 546 echo 'const stackGuardMultiplierDefault = 1' >> objabi.go.tmp
558 echo 'const goexperiment = ``' >> objabi.go.tmp 547 echo 'const goexperiment = ``' >> objabi.go.tmp
559 $(SHELL) $(srcdir)/mvifdiff.sh objabi.go.tmp objabi.go 548 $(SHELL) $(srcdir)/mvifdiff.sh objabi.go.tmp objabi.go
560 $(STAMP) $@ 549 $(STAMP) $@
561 550
562 gccgosizes.go: s-gccgosizes; @true 551 gccgosizes.go: s-gccgosizes; @true
604 593
605 # Post-process runtime.inc.raw (raw output of -fgo-c-header option when 594 # Post-process runtime.inc.raw (raw output of -fgo-c-header option when
606 # compiling runtime) to prune out certain types that should not be 595 # compiling runtime) to prune out certain types that should not be
607 # exported back to C. See comments in mkruntimeinc.sh for more details. 596 # exported back to C. See comments in mkruntimeinc.sh for more details.
608 runtime.inc: s-runtime-inc; @true 597 runtime.inc: s-runtime-inc; @true
609 s-runtime-inc: runtime.lo Makefile 598 s-runtime-inc: runtime.lo mkruntimeinc.sh Makefile
610 $(SHELL) $(srcdir)/mkruntimeinc.sh 599 $(SHELL) $(srcdir)/mkruntimeinc.sh
611 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime.inc runtime.inc 600 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime.inc runtime.inc
612 $(STAMP) $@ 601 $(STAMP) $@
613 602
614 noinst_DATA += zdefaultcc.go 603 noinst_DATA += zdefaultcc.go
618 s-zstdpkglist: Makefile 607 s-zstdpkglist: Makefile
619 rm -f zstdpkglist.go.tmp 608 rm -f zstdpkglist.go.tmp
620 echo 'package goroot' > zstdpkglist.go.tmp 609 echo 'package goroot' > zstdpkglist.go.tmp
621 echo "" >> zstdpkglist.go.tmp 610 echo "" >> zstdpkglist.go.tmp
622 echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp 611 echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
623 echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's|[a-z0-9_/]*_c\.lo||g' | sed 's|\([a-z0-9_/]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp 612 echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's|[a-z0-9_./]*_c\.lo||g' | sed 's|\([a-z0-9_./]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp
624 echo '}' >> zstdpkglist.go.tmp 613 echo '}' >> zstdpkglist.go.tmp
625 $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go 614 $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
626 $(STAMP) $@ 615 $(STAMP) $@
627 616
628 if LIBGO_IS_LINUX 617 if LIBGO_IS_LINUX
709 syscall_lib_clone_lo = syscall/clone_linux.lo 698 syscall_lib_clone_lo = syscall/clone_linux.lo
710 else 699 else
711 syscall_lib_clone_lo = 700 syscall_lib_clone_lo =
712 endif 701 endif
713 702
703 if LIBGO_IS_X86
704 golangorg_x_sys_cpu_gccgo_lo = golang.org/x/sys/cpu_gccgo.lo
705 else
706 golangorg_x_sys_cpu_gccgo_lo =
707 endif
708
714 PACKAGES = $(shell cat $(srcdir)/libgo-packages.txt) 709 PACKAGES = $(shell cat $(srcdir)/libgo-packages.txt)
715 710
716 libgo_go_objs = \ 711 libgo_go_objs = \
717 $(addsuffix .lo,$(PACKAGES)) \ 712 $(addsuffix .lo,$(PACKAGES)) \
718 bytes/index.lo \
719 internal/bytealg/bytealg.lo \ 713 internal/bytealg/bytealg.lo \
720 reflect/makefunc_ffi_c.lo \ 714 reflect/makefunc_ffi_c.lo \
721 strings/index.lo \
722 $(syscall_lib_clone_lo) \ 715 $(syscall_lib_clone_lo) \
723 syscall/errno.lo \ 716 syscall/errno.lo \
724 syscall/signame.lo \ 717 syscall/signame.lo \
725 syscall/wait.lo \ 718 syscall/wait.lo \
726 $(golang_org_x_net_lif_lo) \ 719 $(golangorg_x_net_lif_lo) \
727 $(golang_org_x_net_route_lo) \ 720 $(golangorg_x_net_route_lo) \
728 log/syslog/syslog_c.lo \ 721 log/syslog/syslog_c.lo \
729 $(os_lib_inotify_lo) \ 722 $(os_lib_inotify_lo) \
730 runtime/internal/atomic_c.lo \ 723 runtime/internal/atomic_c.lo \
731 sync/atomic_c.lo \ 724 sync/atomic_c.lo \
732 internal/cpu/cpu_gccgo.lo 725 internal/cpu/cpu_gccgo.lo \
726 $(golangorg_x_sys_cpu_gccgo_lo)
733 727
734 libgo_ldflags = \ 728 libgo_ldflags = \
735 -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS) 729 -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
736 730
737 libgo_libadd = \ 731 libgo_libadd = \
794 788
795 # Build the dependencies for a Go package. 789 # Build the dependencies for a Go package.
796 BUILDDEPS = \ 790 BUILDDEPS = \
797 $(MKDIR_P) $(@D); \ 791 $(MKDIR_P) $(@D); \
798 dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \ 792 dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \
799 files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$$dir --extrafiles="$(extra_go_files_$(subst /,_,$(subst .lo.dep,,$@)))" $(matchargs_$(subst /,_,$(subst .lo.dep,,$@)))`; \ 793 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,,$@)))`; \
800 $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \ 794 $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \
801 if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \ 795 if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \
802 rm -f `echo $@ | sed -e 's/\.dep$$//'`; \ 796 rm -f `echo $@ | sed -e 's/\.dep$$//'`; \
803 fi; \ 797 fi; \
804 mv -f $@.tmp $@ 798 mv -f $@.tmp $@
805 799
806 # Build the .go files for a package, generating a .lo file. 800 # Build the .go files for a package, generating a .lo file.
807 BUILDPACKAGE = \ 801 BUILDPACKAGE = \
808 $(MKDIR_P) $(@D); \ 802 $(MKDIR_P) $(@D); \
809 files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \ 803 files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
810 $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//' -e 's|golang_org|vendor/golang_org|'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files 804 $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
811 805
812 # How to build a .gox file from a .lo file. 806 # How to build a .gox file from a .lo file.
813 # Matching .o file can either be in the same directory as the .lo (non-PIC 807 # Matching .o file can either be in the same directory as the .lo (non-PIC
814 # object) or in the .libs directory (PIC object). 808 # object) or in the .libs directory (PIC object).
815 BUILDGOX = \ 809 BUILDGOX = \
816 f="$(basename $<).o"; \ 810 f="$(basename $<).o"; \
817 if test ! -f $$f; then \ 811 if test ! -f $$f; then \
818 f="$(basename $(<D)/.libs/$(<F)).o"; \ 812 f="$(basename $(<D)/.libs/$(<F)).o"; \
819 fi; \ 813 fi; \
820 $(OBJCOPY) -j .go_export $$f $@.tmp; \ 814 $(OBJCOPY) -j $(GO_EXPORT_SECTION_NAME) $$f $@.tmp; \
821 $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'` 815 $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
822 816
823 GOTESTFLAGS = 817 GOTESTFLAGS =
824 GOBENCH = 818 GOBENCH =
825 819
826 # Check a package. 820 # Check a package.
827 CHECK = \ 821 CHECK = \
828 GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \ 822 GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
829 export GC; \ 823 export GC; \
830 GOLIBS="$(extra_check_libs_$(subst /,_,$(@D))) $(MATH_LIBS) $(NET_LIBS) $(LIBS)"; \ 824 GOLIBS="$(extra_check_libs_$(subst .,_,$(subst /,_,$(@D)))) $(MATH_LIBS) $(NET_LIBS) $(LIBS)"; \
831 export GOLIBS; \ 825 export GOLIBS; \
832 RUNTESTFLAGS="$(RUNTESTFLAGS)"; \ 826 RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
833 export RUNTESTFLAGS; \ 827 export RUNTESTFLAGS; \
834 MAKE="$(MAKE)"; \ 828 MAKE="$(MAKE)"; \
835 export MAKE; \ 829 export MAKE; \
839 LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \ 833 LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \
840 LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \ 834 LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
841 export LD_LIBRARY_PATH; \ 835 export LD_LIBRARY_PATH; \
842 $(MKDIR_P) $(@D); \ 836 $(MKDIR_P) $(@D); \
843 rm -f $@-testsum $@-testlog; \ 837 rm -f $@-testsum $@-testlog; \
844 files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst /,_,$(@D)))" $(matchargs_$(subst /,_,$(@D)))`; \ 838 files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst .,_,$(subst /,_,$(@D))))" $(matchargs_$(subst /,_,$(@D)))`; \
845 if test "$(USE_DEJAGNU)" = "yes"; then \ 839 if test "$(USE_DEJAGNU)" = "yes"; then \
846 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \ 840 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
847 elif test "$(GOBENCH)" != ""; then \ 841 elif test "$(GOBENCH)" != ""; then \
848 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \ 842 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
849 else \ 843 else \
972 runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys) 966 runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
973 967
974 extra_go_files_internal_cpu = cpugen.go 968 extra_go_files_internal_cpu = cpugen.go
975 internal/cpu.lo.dep: $(extra_go_files_internal_cpu) 969 internal/cpu.lo.dep: $(extra_go_files_internal_cpu)
976 970
971 extra_go_files_golang_org_x_sys_cpu = gcpugen.go
972 golang.org/x/sys/cpu.lo.dep: $(extra_go_files_golang_org_x_sys_cpu)
973
977 extra_go_files_internal_goroot = zstdpkglist.go 974 extra_go_files_internal_goroot = zstdpkglist.go
978 internal/goroot.lo.dep: $(extra_go_files_internal_goroot) 975 internal/goroot.lo.dep: $(extra_go_files_internal_goroot)
979 976
980 extra_go_files_go_types = gccgosizes.go 977 extra_go_files_go_types = gccgosizes.go
981 go/types.lo.dep: $(extra_go_files_go_types) 978 go/types.lo.dep: $(extra_go_files_go_types)
988 985
989 extra_check_libs_cmd_go_internal_cache = $(abs_builddir)/libgotool.a 986 extra_check_libs_cmd_go_internal_cache = $(abs_builddir)/libgotool.a
990 extra_check_libs_cmd_go_internal_generate = $(abs_builddir)/libgotool.a 987 extra_check_libs_cmd_go_internal_generate = $(abs_builddir)/libgotool.a
991 extra_check_libs_cmd_go_internal_get = $(abs_builddir)/libgotool.a 988 extra_check_libs_cmd_go_internal_get = $(abs_builddir)/libgotool.a
992 extra_check_libs_cmd_go_internal_load = $(abs_builddir)/libgotool.a 989 extra_check_libs_cmd_go_internal_load = $(abs_builddir)/libgotool.a
990 extra_check_libs_cmd_go_internal_lockedfile = $(abs_builddir)/libgotool.a
993 extra_check_libs_cmd_go_internal_imports = $(abs_builddir)/libgotool.a 991 extra_check_libs_cmd_go_internal_imports = $(abs_builddir)/libgotool.a
994 extra_check_libs_cmd_go_internal_modconv = $(abs_builddir)/libgotool.a 992 extra_check_libs_cmd_go_internal_modconv = $(abs_builddir)/libgotool.a
995 extra_check_libs_cmd_go_internal_modfetch = $(abs_builddir)/libgotool.a 993 extra_check_libs_cmd_go_internal_modfetch = $(abs_builddir)/libgotool.a
996 extra_check_libs_cmd_go_internal_modfetch_codehost = $(abs_builddir)/libgotool.a 994 extra_check_libs_cmd_go_internal_modfetch_codehost = $(abs_builddir)/libgotool.a
997 extra_check_libs_cmd_go_internal_modfile = $(abs_builddir)/libgotool.a 995 extra_check_libs_cmd_go_internal_modfile = $(abs_builddir)/libgotool.a
1005 extra_check_libs_cmd_vet_internal_cfg = $(abs_builddir)/libgotool.a 1003 extra_check_libs_cmd_vet_internal_cfg = $(abs_builddir)/libgotool.a
1006 1004
1007 # FIXME: The following C files may as well move to the runtime 1005 # FIXME: The following C files may as well move to the runtime
1008 # directory and be treated like other C files. 1006 # directory and be treated like other C files.
1009 1007
1010 # Use C code to speed up {bytes,strings}.IndexByte and friends. 1008 # Use C code to speed up internal/bytealg.IndexByte and friends.
1011 bytes/index.lo: go/bytes/indexbyte.c runtime.inc
1012 @$(MKDIR_P) bytes
1013 $(LTCOMPILE) -c -o $@ $(srcdir)/go/bytes/indexbyte.c
1014 strings/index.lo: go/strings/indexbyte.c runtime.inc
1015 @$(MKDIR_P) strings
1016 $(LTCOMPILE) -c -o $@ $(srcdir)/go/strings/indexbyte.c
1017 internal/bytealg/bytealg.lo: go/internal/bytealg/bytealg.c runtime.inc 1009 internal/bytealg/bytealg.lo: go/internal/bytealg/bytealg.c runtime.inc
1018 @$(MKDIR_P) internal/bytealg 1010 @$(MKDIR_P) internal/bytealg
1019 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/bytealg/bytealg.c 1011 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/bytealg/bytealg.c
1020 1012
1021 # Use a C function with a fixed number of arguments to call a C 1013 # Use a C function with a fixed number of arguments to call a C
1054 # internal/cpu needs some C code. 1046 # internal/cpu needs some C code.
1055 internal/cpu/cpu_gccgo.lo: go/internal/cpu/cpu_gccgo.c runtime.inc 1047 internal/cpu/cpu_gccgo.lo: go/internal/cpu/cpu_gccgo.c runtime.inc
1056 @$(MKDIR_P) internal/cpu 1048 @$(MKDIR_P) internal/cpu
1057 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/cpu/cpu_gccgo.c 1049 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/cpu/cpu_gccgo.c
1058 1050
1051 # Similarly, golang.org/x/sys/cpu needs some C code.
1052 golang.org/x/sys/cpu_gccgo.lo: go/golang.org/x/sys/cpu/cpu_gccgo.c runtime.inc
1053 @$(MKDIR_P) golang.org/x/sys
1054 $(LTCOMPILE) -c -o $@ $(srcdir)/go/golang.org/x/sys/cpu/cpu_gccgo.c
1055
1059 # Solaris 11.4 changed the type of fields in struct stat. 1056 # Solaris 11.4 changed the type of fields in struct stat.
1060 # Use a build tag, based on a configure check, to cope. 1057 # Use a build tag, based on a configure check, to cope.
1061 if LIBGO_IS_SOLARIS 1058 if LIBGO_IS_SOLARIS
1062 if HAVE_STAT_TIMESPEC 1059 if HAVE_STAT_TIMESPEC
1063 matchargs_os = --tag=solaristag 1060 matchargs_os = --tag=solaristag
1068 matchargs_os = 1065 matchargs_os =
1069 endif 1066 endif
1070 1067
1071 if LIBGO_IS_BSD 1068 if LIBGO_IS_BSD
1072 1069
1073 # Build golang_org/x/net/route only on BSD systems. 1070 # Build golang.org/x/net/route only on BSD systems.
1074 1071
1075 $(eval $(call PACKAGE_template,golang_org/x/net/route)) 1072 $(eval $(call PACKAGE_template,golang.org/x/net/route))
1076 1073
1077 golang_org_x_net_route_lo = \ 1074 golangorg_x_net_route_lo = \
1078 golang_org/x/net/route.lo 1075 golang.org/net/route.lo
1079 golang_org_x_net_route_check = \
1080 golang_org/x/net/route/check
1081 1076
1082 endif 1077 endif
1083 1078
1084 if LIBGO_IS_SOLARIS 1079 if LIBGO_IS_SOLARIS
1085 1080
1086 # Build golang_org/x/net/lif only on Solaris systems. 1081 # Build golang.org/x/net/lif only on Solaris systems.
1087 1082
1088 $(eval $(call PACKAGE_template,golang_org/x/net/lif)) 1083 $(eval $(call PACKAGE_template,golang.org/x/net/lif))
1089 1084
1090 golang_org_x_net_lif_lo = \ 1085 golangorg_x_net_lif_lo = \
1091 golang_org/x/net/lif.lo 1086 golang.org/x/net/lif.lo
1092 golang_org_x_net_lif_check = \ 1087
1093 golang_org/x/net/lif/check 1088 endif
1094 1089
1095 endif 1090 TEST_PACKAGES = $(addsuffix /check,$(shell cat $(srcdir)/check-packages.txt))
1096
1097 TPACKAGES = $(shell cat $(srcdir)/check-packages.txt)
1098 TEST_PACKAGES = $(addsuffix /check,$(TPACKAGES)) \
1099 $(golang_org_x_net_lif_check) \
1100 $(golang_org_x_net_route_check)
1101 1091
1102 check: check-tail 1092 check: check-tail
1103 check-recursive: check-head 1093 check-recursive: check-head
1104 1094
1105 check-head: 1095 check-head:
1204 MOSTLYCLEANFILES = \ 1194 MOSTLYCLEANFILES = \
1205 s-runtime_sysinfo s-sigtab s-runtime-inc s-zstdpkglist \ 1195 s-runtime_sysinfo s-sigtab s-runtime-inc s-zstdpkglist \
1206 s-libcalls s-libcalls-list s-syscall_arch s-gen-sysinfo s-sysinfo \ 1196 s-libcalls s-libcalls-list s-syscall_arch s-gen-sysinfo s-sysinfo \
1207 s-errno s-epoll \ 1197 s-errno s-epoll \
1208 libgo.head libgo.sum.sep libgo.log.sep libgo.var \ 1198 libgo.head libgo.sum.sep libgo.log.sep libgo.var \
1209 libcalls-list runtime.inc runtime.inc.tmp2 runtime.inc.tmp3 1199 libcalls-list \
1200 runtime.inc runtime.inc.tmp2 runtime.inc.tmp3 runtime.inc.raw
1210 1201
1211 mostlyclean-local: 1202 mostlyclean-local:
1212 find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f 1203 find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f
1213 find . -name '*.$(OBJEXT)' -print | xargs rm -f 1204 find . -name '*.$(OBJEXT)' -print | xargs rm -f
1214 find . -name '*-testsum' -print | xargs rm -f 1205 find . -name '*-testsum' -print | xargs rm -f
1222 find . -name '*.gox' -print | xargs rm -f 1213 find . -name '*.gox' -print | xargs rm -f
1223 find . -name '*.s-gox' -print | xargs rm -f 1214 find . -name '*.s-gox' -print | xargs rm -f
1224 1215
1225 distclean-local: 1216 distclean-local:
1226 find . -name '*.lo.dep' -print | xargs rm -f 1217 find . -name '*.lo.dep' -print | xargs rm -f
1218
1219 include $(top_srcdir)/../multilib.am