stmp-int-hdrs: $(STMP_FIXINC) $(T_GLIMITS_H) $(T_STDINT_GCC_H) $(USER_H) fixinc_list
# Copy in the headers provided with gcc.
#
-# The sed command gets just the last file name component;
-# this is necessary because VPATH could add a dirname.
-# Using basename would be simpler, but some systems don't have it.
+# If the sequence /././ appears somewhere after srcdir in a USER_H
+# name, install the header with the name after the marker, even if
+# that name involves subdirectories. Otherwise, install it as the
+# basename (but some systems don't have the basename program).
#
# The touch command is here to workaround an AIX/Linux NFS bug.
#
-if [ -d include-fixed ] ; then true; else mkdir include-fixed; chmod a+rx include-fixed; fi
for file in .. $(USER_H); do \
if [ X$$file != X.. ]; then \
- realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
+ case $$file in \
+ "$(srcdir)"*/././*) \
+ realfile=`echo $$file | sed -e 's|^.*/\./\./||'`; \
+ case $$realfile in \
+ */*) \
+ realdir=`echo $$realfile | sed -e 's|/[^/]*$$||'`; \
+ $(install_sh) -d include/$$realdir;; \
+ esac;; \
+ *) \
+ realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`;; \
+ esac; \
$(STAMP) include/$$realfile; \
rm -f include/$$realfile; \
- cp $$file include; \
+ cp $$file include/$$realfile; \
chmod a+r include/$$realfile; \
fi; \
done
extra_headers="${extra_headers} ../vxworks/math.h ../vxworks/complex.h"
extra_headers="${extra_headers} ../vxworks/inttypes.h ../vxworks/setjmp.h"
+ # The /././ sequence marks the beginning of the install name.
+ extra_headers="${extra_headers} ../vxworks/././base/b_NULL.h"
+
# We provide (a tailored version of) stdint.h
tm_file="${tm_file} vxworks-stdint.h"
use_gcc_stdint=provide
--- /dev/null
+/* This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* This header wrapper addresses the issue that some versions of VxWorks have
+ started defining NULL in a way that doesn't work with C++ < 11, so we override
+ it with GCC's own stddef's NULL. Include the VxWorks version of this header
+ nevertheless, as it might do other things than defining NULL, and beware that
+ it usually defines NULL unconditionally without undefining it first, unlike
+ what stddef.h does. */
+
+#undef NULL
+#include_next <base/b_NULL.h>
+#define __need_NULL
+#include <stddef.h>
headers to work with GCC, some other headers may also be installed in
@file{@var{libsubdir}/include}. @file{config.gcc} may set
@code{extra_headers}; this specifies additional headers under
-@file{config} to be installed on some systems.
+@file{config} to be installed on some systems. They're installed at the
+top of the @file{include} tree, unless the optional @samp{/././}
+sequence appears in the name, marking the beginning of the name under
+which the header should be installed.
GCC installs its own version of @code{<float.h>}, from @file{ginclude/float.h}.
This is done to cope with command-line options that change the