bootstrap: Fix old boostrapping issue once and for all.
authorzrj <rimvydas.jasinskas@gmail.com>
Wed, 21 Sep 2016 10:45:50 +0000 (13:45 +0300)
committerzrj <zrj@dragonflybsd.org>
Sat, 24 Sep 2016 06:45:08 +0000 (09:45 +0300)
This was fallout after iconv() removal of 'const' attribute to conform
with POSIX. All the later hacks are starting to accumulate and prevent
easy further base system upgrading. So given that main issue is c++
specific and only needed for bootstraping process deal with it straight
and remove all hacks(include shoehornings) that were caused by it.

To fix bootstrapping problems add WORLD_VERSION variable that indicates
current DragonFly base version and could be used to retrospectively
help bootstrapping from older releases. Makefile changes that depend on
WORLD_VERSION should *only* be used as a once switch and during native
compilations should *not* change default world makefiles logic.

gnu/usr.bin/cc50/Makefile.inc
gnu/usr.bin/cc50/cc_tools/libcpp/Makefile
gnu/usr.bin/cc50/support-libs/libcpp/Makefile
include/setjmp.h
include/unistd.h
share/mk/sys.mk

index 6b52ed9..30c3617 100644 (file)
@@ -37,7 +37,6 @@ FLAGS+=               -I${STOPDIR}/../gmp
 FLAGS+=                -I${STOPDIR}/../../../contrib/mpfr/src
 FLAGS+=                -I${STOPDIR}/../mpfr
 FLAGS+=                -I${STOPDIR}/../../../contrib/mpc/src
-FLAGS+=                -I${STOPDIR}/../../../include
 FLAGS+=                -I${GCCDIR}/gcc/config/i386
 FLAGS+=                -I${TOOLDIR}
 
index 5d6d6ab..aab7d42 100644 (file)
@@ -28,6 +28,11 @@ SRCS=                charset.c \
                symtab.c \
                traditional.c
 
+# Helper for bootstrapping over iconv() removal of 'const' (c++ issue)
+.if ${WORLD_VERSION} <= 400301
+CFLAGS+=       -fpermissive
+.endif
+
 localedir.h:
        touch $@
 
index 588a927..c4b97fd 100644 (file)
@@ -27,6 +27,11 @@ CXX_BUILD=   charset.c \
 
 OBJS=          ${CXX_BUILD:.c=.o}
 
+# Helper for bootstrapping over iconv() removal of 'const' (c++ issue)
+.if ${WORLD_VERSION} <= 400301
+CFLAGS+=       -fpermissive
+.endif
+
 # hack to force c++ compiler to compile *.c files to create library
 .for cfile in ${CXX_BUILD}
 ${cfile:.c=.o}: ${cfile} localedir.h
index 50bb584..4efda51 100644 (file)
 /* The size of the jmp_buf is machine dependent: */
 #include <machine/setjmp.h>
 
-#ifndef __returns_twice                        /* help with buildworld bootstrap */
-#define __returns_twice
-#endif
-
 __BEGIN_DECLS
 int    setjmp (jmp_buf) __returns_twice;
 void   longjmp (jmp_buf, int) __dead2;
index 6f01a82..042755d 100644 (file)
 #include <sys/unistd.h>
 #include <sys/_null.h>
 
-#ifndef __returns_twice                        /* help with buildworld bootstrap */
-#define __returns_twice
-#endif
-
 #ifndef _GID_T_DECLARED
 typedef        __uint32_t      gid_t;          /* XXX __gid_t */
 #define        _GID_T_DECLARED
index 5f81116..5cfc11c 100644 (file)
@@ -311,6 +311,17 @@ __MAKE_CONF?=/etc/make.conf
 .include "${__MAKE_CONF}"
 .endif
 
+# Helper for bootstrapping in makefiles.
+.if !defined(WORLD_VERSION)
+.if defined(.MAKE.DF.VERSION)
+WORLD_VERSION= ${.MAKE.DF.VERSION}
+.else
+.if exists(/usr/include/sys/param.h)
+WORLD_VERSION!=        ${AWK} '/^\#define[[:blank:]]__DragonFly_version/ {print $$3}' < /usr/include/sys/param.h
+.endif
+.endif
+.endif
+
 .include <bsd.cpu.mk>
 
 .if exists(/etc/make.conf.local)