]> Zhao Yanbai Git Server - minix.git/commitdiff
Fix GCC image building
authorArun Thomas <arun@minix3.org>
Sat, 9 Jul 2011 13:04:42 +0000 (15:04 +0200)
committerArun Thomas <arun@minix3.org>
Sat, 9 Jul 2011 13:04:42 +0000 (15:04 +0200)
42 files changed:
drivers/Makefile.inc
drivers/acpi/Makefile
drivers/ahci/Makefile
drivers/amddev/Makefile
drivers/at_wini/Makefile
drivers/atl2/Makefile
drivers/bios_wini/Makefile
drivers/dec21140A/Makefile
drivers/dp8390/Makefile
drivers/dpeth/Makefile
drivers/e1000/Makefile
drivers/filter/Makefile
drivers/floppy/Makefile
drivers/fxp/Makefile
drivers/hello/Makefile
drivers/lance/Makefile
drivers/orinoco/Makefile
drivers/pci/Makefile
drivers/printer/Makefile
drivers/ramdisk/Makefile
drivers/random/Makefile
drivers/readclock/Makefile
drivers/rtl8139/Makefile
drivers/rtl8169/Makefile
drivers/ti1225/Makefile
kernel/Makefile
nbsd_include/stdlib.h
servers/Makefile.inc
servers/devman/Makefile
servers/ext2/Makefile
servers/hgfs/Makefile
servers/inet/Makefile
servers/init/Makefile
servers/ipc/Makefile
servers/is/Makefile
servers/iso9660fs/Makefile
servers/lwip/Makefile
servers/procfs/Makefile
share/mk/Makefile
share/mk/bsd.prog.mk
share/mk/minix.bootprog.mk
share/mk/minix.service.mk [new file with mode: 0644]

index 4d5669aca7d30042621e7fefb5b67db6ab162320..5862b1bcad82a5d28da936923a92fefecfbab9f0 100644 (file)
@@ -1,7 +1,7 @@
-.if (${NBSD_LIBC} != "no")
+.if ${COMPILER_TYPE} == "gnu"
 CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE
 LDADD+= -lminlib -lcompat_minix
-DEPEND+= ${LIBMINLIB} ${LIBCOMPAT_MINIX}
+DPADD+= ${LIBMINLIB} ${LIBCOMPAT_MINIX}
 .else
 CPPFLAGS+= -D_MINIX -D_POSIX_SOURCE
 .endif
index b0b4dbc41822f3729d92289b69b98d2cced4646c..c050374859b869c8547faf709a65aff1b64c0a95 100644 (file)
@@ -149,6 +149,6 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
 
 .endif
index 2067d53f80698ae502ab051c6ba23bacf8de068f..cf9c84016d43764002b283ccd5fce4b09f92132e 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 43714052823087f810ce99e880c1a968db6501d1..731336a9bc2dbc939f2b3e81345a549862a3bf7e 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 88aa5540d185d79cd90f202dae4d549703954789..25aece4c62884409d149f2d2773519cfdc3d672f 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 46ce34a4085588eb9d403bb1446fa3898deda2d9..31d5a382da3b95724132badf6e321317f5bb3f2e 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 35f1b01deb2607d8ce7b8f92a3b614a69f16c45e..cb0f177ffa4b066465bb4b8b4a0d8e3d1cecceda 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 09bdba94c53e70e09a3a202f359ebc5305d052a7..42051f8adf0cd5f95c966f4f98b32cac811193f5 100644 (file)
@@ -14,4 +14,4 @@ BINDIR?= /usr/sbin
 debug=         0
 CPPFLAGS+=     -Ddebug=${debug} -w
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 2cbd1fedf46ec6451c8f9345bed41e29bcf55138..81be544ded6f45f2661c7fd93a82cded74160332 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index b82759d9ea85e99fa02d7b3259c8c4f5ada353ec..fe1c3127f6259feaefba9ef8a9bf336cb76143bc 100644 (file)
@@ -14,4 +14,4 @@ BINDIR?= /usr/sbin
 debug=         0
 CPPFLAGS+=     -Ddebug=$(debug)
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 4a035d10de13d12dcbc79631b6f75efb30981110..91c8b43a88ff4c59657efe9b0340b1f602659828 100644 (file)
@@ -11,4 +11,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index b9313be20b51edb3c128cf4baf2a86c53fbebe8c..119372f574403f31ac02834b44e5d2c596101b2d 100644 (file)
@@ -11,4 +11,4 @@ BINDIR?= /usr/sbin
 
 CPPFLAGS+= -DDEBUG=1 -DDEBUG2=0
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 06f2baa2761084638ce901b74323d5dd3c5971ff..62864941e1618c8094d374a12746e3ec06a7e1ec 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index c91f1c51b098d6ec6cb98dfb84b3862ceceeef10..baa7dca9f7fd5fa44684ec46423d6faf7b54e5be 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 52d4764fe308cf042039742bdea09bbcd5c429c9..c48a7c454ba9bcd69d3fe09390b543435c21014e 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index d09f8726c4c96c22a2f873f705b11a421355a1b9..edadb8d5efb40df54d3db409a6f2d4e391b68b8b 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 4393ea20d166b888d3baf2e8cce6e33646907a9d..db715102c1ed1a1000fa5a0d4dd4578322628b57 100644 (file)
@@ -11,4 +11,4 @@ BINDIR?= /usr/sbin
 
 CPPFLAGS.orinoco.c+=   -I${MINIXSRCDIR}
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index c2632070ceb3ed584906fe65d66ce82e913a1b61..2616cb20c03b645db0c64c9bb814fc58fd16b8b9 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 7b2c188c4efaf60fac10904bd5f72df3c5c9e996..762664a5dfb63999ec2a99918bbdab45776855ca 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 9f576cb368d27f661f675c1794732633c8c480f3..cab36c948f596e9d47e31eb544f694a2ede7438a 100644 (file)
@@ -159,4 +159,4 @@ elfstrip: $(PROGRAMS)
        strip $(PROGRAMS)
 .endif
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index d67b6d6c29b724997f2d76b68eb3c4b0a5b6a907..2e465979f6911e1fcaa75357923bba065911181c 100644 (file)
@@ -13,5 +13,5 @@ BINDIR?= /usr/sbin
 
 CPPFLAGS.random.c+=    -I${MINIXSRCDIR}
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
 
index 9a8c817f8fb159377d2675f3a4aecc3e17f31af3..a37a4fed2c7ce7b68ee7612cc867f1155b1d7be4 100644 (file)
@@ -11,4 +11,4 @@ BINDIR?= /sbin
 
 CPPFLAGS+= -D_SYSTEM=1
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 3a5a6a34d3d71eb5ec76ffbcbe1d70533cbb5766..51f54f33e1f92ab7271ece36736deeae321a7874 100644 (file)
@@ -11,4 +11,4 @@ BINDIR?= /usr/sbin
 
 CPPFLAGS+=     -I${MINIXSRCDIR}
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 25b01ff2567ad93a759e4568b524fa0a89551113..ab4516ff167bad3386eacc41802d66831a07b4e8 100644 (file)
@@ -11,4 +11,4 @@ BINDIR?= /usr/sbin
 
 CPPFLAGS+=     -I${MINIXSRCDIR}
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 55a57a621dd3a84a5bbfca04aea17e43a6d0500a..b2310f335b6b24fad8b9f05735dd21d42c2ca324 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index a431e663373b159992e09ac15cca593ef1daadea..9ad077a8889410c17f860e8da737505c1b239002 100644 (file)
@@ -22,26 +22,17 @@ CFLAGS += -D__kernel__
 LDFLAGS+= -.o
 .elif ${COMPILER_TYPE} == "gnu"
 CFLAGS+=-march=i386
-CPPFLAGS+= -ffreestanding -fno-stack-protector
+CPPFLAGS+= -ffreestanding -fno-stack-protector -D_NETBSD_SOURCE
 LDFLAGS+= -T ${.CURDIR}/arch/${ARCH}/kernel.lds
 LDFLAGS+= -nostdlib -L${LIBDIR}
-.endif
-
-.if (${NBSD_LIBC} != "no")
 LDADD+= -lminlib
 DPADD+= ${LIBMINLIB}
-CPPFLAGS+= -D_NETBSD_SOURCE
-.else
-
 .if ${CC} == "gcc"
-DPADD+=        ${LIBC}
-LDADD+=        -lgcc -lc -lgcc
+LDADD+=        -lgcc -lsys -lgcc
 .elif ${CC} == "clang"
+LDADD+= -L/usr/pkg/lib -lCompilerRT-Generic -lsys -lCompilerRT-Generic
 DPADD+=        ${LIBC}
-LDADD+= -L/usr/pkg/lib
-LDADD+= -lCompilerRT-Generic -lc -lCompilerRT-Generic
 .endif
-
 .endif
 
 CPPFLAGS+=     -I${.CURDIR} -I${.CURDIR}/arch/${ARCH}/include -I${MINIXSRCDIR}
index b52d3741b96d9adf1b619149413b5c4d68c4af0b..63d334719da74e358450b70ab28ac546d42e15ce 100644 (file)
@@ -244,6 +244,8 @@ int  posix_memalign(void **, size_t, size_t);
 void   *alloca(int);     /* built-in for gcc */
 #elif defined(__PCC__) && !defined(__GNUC__)
 #define alloca(size) __builtin_alloca(size)
+#elif (__GNUC__ >= 2)
+#define alloca(size) __builtin_alloca(size)
 #else
 void   *alloca(size_t);
 #endif /* __GNUC__ */
index 2e67ce5b0a9ee1f596cc75780e8208c56054d6f7..5862b1bcad82a5d28da936923a92fefecfbab9f0 100644 (file)
@@ -1,4 +1,4 @@
-.if (${NBSD_LIBC} != "no")
+.if ${COMPILER_TYPE} == "gnu"
 CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE
 LDADD+= -lminlib -lcompat_minix
 DPADD+= ${LIBMINLIB} ${LIBCOMPAT_MINIX}
index a839f535fe107b8479673c068d37f8c5f1129018..c854b1e917b997f9b2aa648e7027b74806bfd10c 100644 (file)
@@ -9,4 +9,4 @@ BINDIR?= /sbin
 INSTALLFLAGS+= -S 128k
 
 MAN=
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index b5af34d2ab388437fdee9a472153a3e28ac53fd3..02e4aa8c4b087712602b1fc528d9b6e65e983f20 100644 (file)
@@ -16,4 +16,4 @@ INSTALLFLAGS+= -S 128k
 DEFAULT_NR_BUFS= 1024
 CPPFLAGS+= -DDEFAULT_NR_BUFS=${DEFAULT_NR_BUFS}
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 11036e7f8c7054a4d3057c5b17e201f94b0f627a..eadf787c970151a00880aacfd01df98bb8cd3343 100644 (file)
@@ -11,4 +11,4 @@ MAN=
 
 BINDIR?= /sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 441d768e7849ae9e6420601a7e70aee7f41fc15b..85bf0495607797aade65a1cd121c17d5955054fb 100644 (file)
@@ -21,4 +21,4 @@ BINDIR?= /usr/sbin
 
 CPPFLAGS+=  -I${.CURDIR} -D_MINIX
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index f48e32e3abadd178302fe6d9fea538ace84ad814..4feb4c52b68275e6ac856ed4d1b83a66a455a244 100644 (file)
@@ -1,4 +1,6 @@
 # Makefile for the init program (INIT)
+.include <bsd.own.mk>
+
 PROG=  init
 SRCS=  init.c
 
@@ -7,4 +9,8 @@ MAN=
 BINDIR?= /usr/sbin
 INSTALLFLAGS+= -S 64k
 
-.include <minix.bootprog.mk>
+.if ${OBJECT_FMT} == "ELF"
+LDFLAGS+= -Wl,--section-start=.init=0x0
+.endif
+
+.include <bsd.prog.mk>
index 5d470e8975b6cca019a3f068a872d0dca577cae8..89225c7d26c7fefd5d794ad064c4134bc1368f90 100644 (file)
@@ -9,4 +9,4 @@ MAN=
 
 BINDIR?= /usr/sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index c7fffb4d35e18bb3e3e0cdacf9dc1702bea6ab73..81106830401f2152407af052a04b93f90639ff8a 100644 (file)
@@ -13,4 +13,4 @@ CPPFLAGS.dmp_kernel.c+=       -I${MINIXSRCDIR}
 CPPFLAGS.dmp_rs.c+=    -I${MINIXSRCDIR}
 CPPFLAGS.dmp_vm.c+=    -I${MINIXSRCDIR}
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 9be9225ea1a29e9b3677338fc897d887552c5e77..3e79a43eb3eaa6d8ea11f4df4e468799d454cace 100644 (file)
@@ -13,4 +13,4 @@ BINDIR?= /sbin
 NR_BUFS= 100
 CPPFLAGS+= -DNR_BUFS=${NR_BUFS}
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 728984673540c902bd30de664325df72091f79f4..4191d7fc7e9bcd8d830eded5e5f8abd83c46826d 100644 (file)
@@ -23,4 +23,4 @@ CPPFLAGS+= -I${.CURDIR}/../../lib/liblwip/include
 
 CFLAGS += -Wextra -std=c99
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index a479da817ca6fd212c289929a54c9339c6c5123c..04356f9d17766f072013b1b65733604c91640df4 100644 (file)
@@ -11,4 +11,4 @@ MAN=
 
 BINDIR?= /sbin
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
index 5bb2943dba2c9ff1b7c21cb1ae0c879b6b4441d3..8b0668b59fa94d733fdb5621438f5b1682411036 100644 (file)
@@ -11,7 +11,7 @@ FILES=        bsd.ack.mk bsd.dep.mk bsd.files.mk \
        pkgsrchooks.mk sys.mk
 
 # MINIX-specific files
-FILES+= minix.bootprog.mk
+FILES+= minix.bootprog.mk minix.service.mk
 
 FILESDIR=/usr/share/mk
 .endif
index 3e0de997a4ac167da81907a6453317a3f58e7fd6..721e2b8493011bbb793e5f03aa53e613feaa6856 100644 (file)
@@ -187,12 +187,6 @@ _LDADD.${_P}=              ${LDADD}    ${LDADD.${_P}}
 _LDFLAGS.${_P}=                ${LDFLAGS}  ${LDFLAGS.${_P}}
 _LDSTATIC.${_P}=       ${LDSTATIC} ${LDSTATIC.${_P}}
 
-.if defined(NBSD_LIBC) && (${NBSD_LIBC} == "yes") && \
-    !empty(_LDADD.${_P}:M-lsys)
-#    defined(USE_LIBSYS) && (${USE_LIBSYS} == "yes")
-_LDADD.${_P}+=         -nodefaultlibs -lgcc -lsys -lgcc
-.endif
-
 ##### Build and install rules
 .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
 SRCS+=         ${SRCS.${_P}} # For bsd.dep.mk
index 01a8001ff3ca94d06ca0eb8de91835696f91a07e..4df1a8733d6eb021fb442f50ec9c5c4f564ad1fe 100644 (file)
@@ -5,4 +5,4 @@
 LDFLAGS+= -Wl,--section-start=.init=0x0
 .endif
 
-.include <bsd.prog.mk>
+.include <minix.service.mk>
diff --git a/share/mk/minix.service.mk b/share/mk/minix.service.mk
new file mode 100644 (file)
index 0000000..52e4748
--- /dev/null
@@ -0,0 +1,14 @@
+# MINIX-specific servers/drivers options
+.include <bsd.own.mk>
+
+.if ${COMPILER_TYPE} == "gnu"
+
+.if ${CC} == "gcc"
+LDADD+= -nodefaultlibs -lgcc -lsys -lgcc
+.elif ${CC} == "clang"
+LDADD+= -nodefaultlibs -L/usr/pkg/lib -lCompilerRT-Generic -lsys -lCompilerRT-Generic
+.endif
+
+.endif
+
+.include <bsd.prog.mk>