diff options
author | neel <neel@FreeBSD.org> | 2013-01-04 19:28:32 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2013-01-04 19:28:32 +0000 |
commit | 38ad3ee53626ccab6f22009b0723f2fb7903ecc1 (patch) | |
tree | 9981bd6a02de01af545d4aff19c0afbef003cfe5 /share/mk | |
parent | 736fc919674c3c284d5611e7e9b572385c4dbc0e (diff) | |
parent | 661fe3468922dc71771a1f31a3562d73f41c4374 (diff) | |
download | FreeBSD-src-38ad3ee53626ccab6f22009b0723f2fb7903ecc1.zip FreeBSD-src-38ad3ee53626ccab6f22009b0723f2fb7903ecc1.tar.gz |
IFC @ r244983.
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/bsd.cpu.mk | 74 | ||||
-rw-r--r-- | share/mk/bsd.lib.mk | 44 | ||||
-rw-r--r-- | share/mk/bsd.libnames.mk | 2 | ||||
-rw-r--r-- | share/mk/bsd.own.mk | 12 | ||||
-rw-r--r-- | share/mk/bsd.prog.mk | 16 | ||||
-rw-r--r-- | share/mk/sys.mk | 6 |
6 files changed, 92 insertions, 62 deletions
diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index af39561..21e70ad 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -27,9 +27,13 @@ MACHINE_CPU = mips # between e.g. i586 and pentium) . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "nocona" || ${CPUTYPE} == "core" || \ - ${CPUTYPE} == "core2" || ${CPUTYPE} == "corei7" || \ - ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" +. if ${CPUTYPE} == "barcelona" +CPUTYPE = amdfam10 +. elif ${CPUTYPE} == "k7" +CPUTYPE = athlon +. elif ${CPUTYPE} == "westmere" || ${CPUTYPE} == "nehalem" +CPUTYPE = corei7 +. elif ${CPUTYPE} == "core" CPUTYPE = prescott . elif ${CPUTYPE} == "p4" CPUTYPE = pentium4 @@ -49,18 +53,13 @@ CPUTYPE = pentiumpro CPUTYPE = pentium-mmx . elif ${CPUTYPE} == "i586" CPUTYPE = pentium -. elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || \ - ${CPUTYPE} == "k8-sse3" || ${CPUTYPE} == "amdfam10" || \ - ${CPUTYPE} == "btver1" || ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" -CPUTYPE = prescott -. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ - ${CPUTYPE} == "k8" -CPUTYPE = athlon-mp -. elif ${CPUTYPE} == "k7" -CPUTYPE = athlon . endif . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "prescott" +. if ${CPUTYPE} == "barcelona" +CPUTYPE = amdfam10 +. elif ${CPUTYPE} == "westmere" || ${CPUTYPE} == "nehalem" +CPUTYPE = corei7 +. elif ${CPUTYPE} == "prescott" CPUTYPE = nocona . endif . elif ${MACHINE_ARCH} == "sparc64" @@ -87,11 +86,11 @@ CPUTYPE = ultrasparc3 _CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0 . elif ${CPUTYPE} == "k5" _CPUCFLAGS = -march=pentium -. elif ${CPUTYPE} == "core2" -_CPUCFLAGS = -march=prescott +. elif ${CPUTYPE} == "c7" +_CPUCFLAGS = -march=c3-2 . else _CPUCFLAGS = -march=${CPUTYPE} -. endif # GCC on 'i386' +. endif . elif ${MACHINE_CPUARCH} == "amd64" _CPUCFLAGS = -march=${CPUTYPE} . elif ${MACHINE_CPUARCH} == "arm" @@ -143,7 +142,7 @@ _CPUCFLAGS = -mcpu=ultrasparc3 # presence of a CPU feature. . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" +. if ${CPUTYPE} == "bdver2" || ${CPUTYPE} == "bdver1" MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} == "btver1" MACHINE_CPU = ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 @@ -151,7 +150,8 @@ MACHINE_CPU = ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 MACHINE_CPU = athlon-xp athlon k7 3dnow sse4a sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" MACHINE_CPU = athlon-xp athlon k7 3dnow sse3 sse2 sse mmx k6 k5 i586 -. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" +. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ + ${CPUTYPE} == "athlon-fx" MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ ${CPUTYPE} == "athlon-4" @@ -164,19 +164,17 @@ MACHINE_CPU = 3dnow mmx k6 k5 i586 MACHINE_CPU = mmx k6 k5 i586 . elif ${CPUTYPE} == "k5" MACHINE_CPU = k5 i586 -. elif ${CPUTYPE} == "c3" -MACHINE_CPU = 3dnow mmx i586 -. elif ${CPUTYPE} == "c3-2" -MACHINE_CPU = sse mmx i586 -. elif ${CPUTYPE} == "c7" -MACHINE_CPU = sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" +. elif ${CPUTYPE} == "core-avx2" +MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 +. elif ${CPUTYPE} == "core-avx-i" || ${CPUTYPE} == "corei7-avx" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "corei7" MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "core2" +. elif ${CPUTYPE} == "penryn" +MACHINE_CPU = sse41 ssse3 sse3 sse2 sse i686 mmx i586 +. elif ${CPUTYPE} == "atom" || ${CPUTYPE} == "core2" MACHINE_CPU = ssse3 sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "prescott" +. elif ${CPUTYPE} == "yonah" || ${CPUTYPE} == "prescott" MACHINE_CPU = sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || \ ${CPUTYPE} == "pentium-m" @@ -191,10 +189,20 @@ MACHINE_CPU = i686 i586 MACHINE_CPU = mmx i586 . elif ${CPUTYPE} == "pentium" MACHINE_CPU = i586 +. elif ${CPUTYPE} == "c7" +MACHINE_CPU = sse3 sse2 sse i686 mmx i586 +. elif ${CPUTYPE} == "c3-2" +MACHINE_CPU = sse i686 mmx i586 +. elif ${CPUTYPE} == "c3" +MACHINE_CPU = 3dnow mmx i586 +. elif ${CPUTYPE} == "winchip2" +MACHINE_CPU = 3dnow mmx +. elif ${CPUTYPE} == "winchip-c6" +MACHINE_CPU = mmx . endif MACHINE_CPU += i486 . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" +. if ${CPUTYPE} == "bdver2" || ${CPUTYPE} == "bdver1" MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 . elif ${CPUTYPE} == "btver1" MACHINE_CPU = ssse3 sse4a sse3 @@ -204,13 +212,17 @@ MACHINE_CPU = k8 3dnow sse4a sse3 ${CPUTYPE} == "k8-sse3" MACHINE_CPU = k8 3dnow sse3 . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ - ${CPUTYPE} == "k8" + ${CPUTYPE} == "athlon-fx" || ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow -. elif ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" +. elif ${CPUTYPE} == "core-avx2" +MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 +. elif ${CPUTYPE} == "core-avx-i" || ${CPUTYPE} == "corei7-avx" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "corei7" MACHINE_CPU = sse42 sse41 ssse3 sse3 -. elif ${CPUTYPE} == "core2" +. elif ${CPUTYPE} == "penryn" +MACHINE_CPU = sse41 ssse3 sse3 +. elif ${CPUTYPE} == "atom" || ${CPUTYPE} == "core2" MACHINE_CPU = ssse3 sse3 . elif ${CPUTYPE} == "nocona" MACHINE_CPU = sse3 diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index efaf9dc..1335964 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -39,9 +39,7 @@ CFLAGS+= ${DEBUG_FLAGS} .if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" CTFFLAGS+= -g .endif -.endif - -.if !defined(DEBUG_FLAGS) +.else STRIP?= -s .endif @@ -135,9 +133,9 @@ lib${LIB}.a: ${OBJS} ${STATICOBJS} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} .if !defined(NM) - @${AR} cq ${.TARGET} `lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} + @${AR} ${ARFLAGS} ${.TARGET} `lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} .else - @${AR} cq ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} + @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} .endif ${RANLIB} ${.TARGET} .endif @@ -152,9 +150,9 @@ lib${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @rm -f ${.TARGET} .if !defined(NM) - @${AR} cq ${.TARGET} `lorder ${POBJS} | tsort -q` ${ARADD} + @${AR} ${ARFLAGS} ${.TARGET} `lorder ${POBJS} | tsort -q` ${ARADD} .else - @${AR} cq ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD} + @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD} .endif ${RANLIB} ${.TARGET} .endif @@ -167,20 +165,26 @@ SOBJS+= ${OBJS:.o=.So} .if defined(SHLIB_NAME) _LIBS+= ${SHLIB_NAME} +.if defined(DEBUG_FLAGS) +SHLIB_NAME_FULL=${SHLIB_NAME}.debug +.else +SHLIB_NAME_FULL=${SHLIB_NAME} +.endif + SOLINKOPTS= -shared -Wl,-x .if !defined(ALLOW_SHARED_TEXTREL) SOLINKOPTS+= -Wl,--fatal-warnings -Wl,--warn-shared-textrel .endif .if target(beforelinking) -${SHLIB_NAME}: ${SOBJS} beforelinking -.else -${SHLIB_NAME}: ${SOBJS} +beforelinking: ${SOBJS} +${SHLIB_NAME_FULL}: beforelinking .endif +${SHLIB_NAME_FULL}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} - @rm -f ${.TARGET} ${SHLIB_LINK} + @rm -f ${SHLIB_NAME} ${SHLIB_LINK} .if defined(SHLIB_LINK) - @ln -fs ${.TARGET} ${SHLIB_LINK} + @ln -fs ${SHLIB_NAME} ${SHLIB_LINK} .endif .if !defined(NM) @${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ @@ -194,6 +198,15 @@ ${SHLIB_NAME}: ${SOBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} .endif + +.if defined(DEBUG_FLAGS) +${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.symbols + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.symbols \ + ${SHLIB_NAME_FULL} ${.TARGET} + +${SHLIB_NAME}.symbols: ${SHLIB_NAME_FULL} + ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} +.endif .endif .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" @@ -202,7 +215,7 @@ _LIBS+= lib${LIB}_pic.a lib${LIB}_pic.a: ${SOBJS} @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} - @${AR} cq ${.TARGET} ${SOBJS} ${ARADD} + @${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} ${RANLIB} ${.TARGET} .endif @@ -270,6 +283,11 @@ _libinstall: ${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} +.if defined(DEBUG_FLAGS) + ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} \ + ${SHLIB_NAME}.symbols ${DESTDIR}${SHLIBDIR} +.endif .if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index d6a2628..95f9064 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -45,7 +45,6 @@ LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a LIBDIALOG?= ${DESTDIR}${LIBDIR}/libdialog.a -LIBDISK?= ${DESTDIR}${LIBDIR}/libdisk.a LIBDNS?= ${DESTDIR}${LIBDIR}/libdns.a LIBDTRACE?= ${DESTDIR}${LIBDIR}/libdtrace.a LIBDWARF?= ${DESTDIR}${LIBDIR}/libdwarf.a @@ -54,7 +53,6 @@ LIBELF?= ${DESTDIR}${LIBDIR}/libelf.a LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch.a LIBFL?= "don't use LIBFL, use LIBL" LIBFORM?= ${DESTDIR}${LIBDIR}/libform.a -LIBFTPIO?= ${DESTDIR}${LIBDIR}/libftpio.a LIBG2C?= ${DESTDIR}${LIBDIR}/libg2c.a LIBGCC?= ${DESTDIR}${LIBDIR}/libgcc.a LIBGCC_PIC?= ${DESTDIR}${LIBDIR}/libgcc_pic.a diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 669043f..78af8fb 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -322,9 +322,6 @@ __DEFAULT_YES_OPTIONS = \ BOOT \ BSD_CPIO \ BSNMP \ - SOURCELESS \ - SOURCELESS_HOST \ - SOURCELESS_UCODE \ BZIP2 \ CALENDAR \ CAPSICUM \ @@ -401,10 +398,13 @@ __DEFAULT_YES_OPTIONS = \ SENDMAIL \ SETUID_LOGIN \ SHAREDOCS \ + SOURCELESS \ + SOURCELESS_HOST \ + SOURCELESS_UCODE \ SSP \ - SYSINSTALL \ SYMVER \ SYSCONS \ + SYSINSTALL \ TCSH \ TELNET \ TEXTPROC \ @@ -417,14 +417,14 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ - BMAKE \ - BSD_GREP \ BIND_IDN \ BIND_LARGE_FILE \ BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ + BMAKE \ BSDCONFIG \ + BSD_GREP \ CLANG_EXTRAS \ CTF \ HESIOD \ diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 3c306eb..cfa07a3 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -46,10 +46,10 @@ PROG= ${PROG_CXX} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if target(beforelinking) -${PROG}: ${OBJS} beforelinking -.else -${PROG}: ${OBJS} +beforelinking: ${OBJS} +${PROG}: beforelinking .endif +${PROG}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -76,10 +76,10 @@ SRCS= ${PROG}.c OBJS= ${PROG}.o .if target(beforelinking) -${PROG}: ${OBJS} beforelinking -.else -${PROG}: ${OBJS} +beforelinking: ${OBJS} +${PROG}: beforelinking .endif +${PROG}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -90,7 +90,7 @@ ${PROG}: ${OBJS} .endif .endif -.endif +.endif # !defined(SRCS) .if ${MK_MAN} != "no" && !defined(MAN) && \ !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ @@ -100,7 +100,7 @@ ${PROG}: ${OBJS} MAN= ${PROG}.1 MAN1= ${MAN} .endif -.endif +.endif # defined(PROG) all: objwarn ${PROG} ${SCRIPTS} .if ${MK_MAN} != "no" diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 0e8dc95..2f67903 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -39,7 +39,7 @@ AR ?= ar .if defined(%POSIX) ARFLAGS ?= -rv .else -ARFLAGS ?= rl +ARFLAGS ?= cru .endif RANLIB ?= ranlib @@ -129,16 +129,18 @@ MAKE ?= make .if !defined(%POSIX) NM ?= nm -.endif OBJC ?= cc OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} -Wno-import +OBJCOPY ?= objcopy + PC ?= pc PFLAGS ?= RC ?= f77 RFLAGS ?= +.endif SHELL ?= sh |