From 2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Sat, 23 Dec 2017 18:18:56 +1100 Subject: Remove make preinstall A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254. --- cpukit/libmisc/untar/untar.h | 260 ------------------------------------------- 1 file changed, 260 deletions(-) delete mode 100644 cpukit/libmisc/untar/untar.h (limited to 'cpukit/libmisc/untar/untar.h') diff --git a/cpukit/libmisc/untar/untar.h b/cpukit/libmisc/untar/untar.h deleted file mode 100644 index bc0a97c103..0000000000 --- a/cpukit/libmisc/untar/untar.h +++ /dev/null @@ -1,260 +0,0 @@ -/** - * @file - * - * @brief Untar an Image - * - * This file defines the interface to methods which can untar an image. - */ - -/* - * Written by: Jake Janovetz - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#ifndef _RTEMS_UNTAR_H -#define _RTEMS_UNTAR_H - -#include -#include -#include -#include -#include - -#include - -/** - * @defgroup libmisc_untar_img Untar Image - * - * @ingroup libmisc - */ -/**@{*/ -#ifdef __cplusplus -extern "C" { -#endif - -#define UNTAR_SUCCESSFUL 0 -#define UNTAR_FAIL 1 -#define UNTAR_INVALID_CHECKSUM 2 -#define UNTAR_INVALID_HEADER 3 - -#define UNTAR_GZ_INFLATE_FAILED 4 -#define UNTAR_GZ_INFLATE_END_FAILED 5 - -int Untar_FromMemory(void *tar_buf, size_t size); -int Untar_FromMemory_Print(void *tar_buf, size_t size, const rtems_printer* printer); -int Untar_FromFile(const char *tar_name); -int Untar_FromFile_Print(const char *tar_name, const rtems_printer* printer); - -typedef struct { - /** - * @brief Current context state. - */ - enum { - UNTAR_CHUNK_HEADER, - UNTAR_CHUNK_SKIP, - UNTAR_CHUNK_WRITE, - UNTAR_CHUNK_ERROR - } state; - - /** - * @brief Header buffer. - */ - char header[512]; - - /** - * @brief Name buffer. - */ - char fname[100]; - - /** - * @brief Number of bytes of overall length are already processed. - */ - size_t done_bytes; - - /** - * @brief Mode of the file. - */ - unsigned long mode; - - /** - * @brief Overall amount of bytes to be processed. - */ - unsigned long todo_bytes; - - /** - * @brief Overall amount of blocks to be processed. - */ - unsigned long todo_blocks; - - /** - * @brief File descriptor of output file. - */ - int out_fd; -} Untar_ChunkContext; - -typedef struct { - /** - * @brief Instance of Chunk Context needed for tar decompression. - */ - Untar_ChunkContext base; - - /** - * @brief Current zlib context. - */ - z_stream strm; - - /** - * @brief Buffer that contains the inflated data. - */ - void *inflateBuffer; - - /** - * @brief Size of buffer that contains the inflated data. - */ - size_t inflateBufferSize; - -} Untar_GzChunkContext; - -typedef struct { - /** - * @brief Instance of Chunk Context needed for tar decompression. - */ - Untar_ChunkContext base; - - /** - * @brief Xz context. - */ - struct xz_dec* strm; - - /** - * @brief Xz buffer. - */ - struct xz_buf buf; - - /** - * @brief Buffer that contains the inflated data. - */ - void *inflateBuffer; - - /** - * @brief Size of buffer that contains the inflated data. - */ - size_t inflateBufferSize; - -} Untar_XzChunkContext; - -/** - * @brief Initializes the Untar_ChunkContext files out of a part of a block of - * memory. - * - * @param Untar_ChunkContext *context [in] Pointer to a context structure. - */ -void Untar_ChunkContext_Init(Untar_ChunkContext *context); - -/* - * @brief Rips links, directories and files out of a part of a block of memory. - * - * @param Untar_ChunkContext *context [in] Pointer to a context structure. - * @param void *chunk [in] Pointer to a chunk of a TAR buffer. - * @param size_t chunk_size [in] Length of the chunk of a TAR buffer. - * - * @retval UNTAR_SUCCESSFUL (0) on successful completion. - * @retval UNTAR_FAIL for a faulty step within the process. - * @retval UNTAR_INVALID_CHECKSUM for an invalid header checksum. - * @retval UNTAR_INVALID_HEADER for an invalid header. - */ - -int Untar_FromChunk_Print( - Untar_ChunkContext *context, - void *chunk, - size_t chunk_size, - const rtems_printer* printer -); - -/** - * @brief Initializes the Untar_ChunkGzContext. - * - * @param Untar_ChunkGzContext *context [in] Pointer to a context structure. - * @param void *inflateBuffer [in] Pointer to a context structure. - * @param size_t inflateBufferSize [in] Size of inflateBuffer. - */ -int Untar_GzChunkContext_Init( - Untar_GzChunkContext *ctx, - void *inflateBuffer, - size_t inflateBufferSize -); - -/* - * @brief Untars a GZ compressed POSIX TAR file. - * - * This is a subroutine used to rip links, directories, and - * files out of a tar.gz/tgz file. - * - * @param Untar_ChunkContext *context [in] Pointer to a context structure. - * @param ssize buflen [in] Size of valid bytes in input buffer. - * @param z_stream *strm [in] Pointer to the current zlib context. - */ -int Untar_FromGzChunk_Print( - Untar_GzChunkContext *ctx, - void *chunk, - size_t chunk_size, - const rtems_printer* printer -); - -/** - * @brief Initializes the Untar_ChunkXzContext. - * - * @param Untar_ChunkXzContext *context [in] Pointer to a context structure. - * @param enum xz_mode mode [in] Dictionary mode. - * @param uint32_t dict_max [in] Maximum size of dictionary. - * @param void *inflateBuffer [in] Pointer to a context structure. - * @param size_t inflateBufferSize [in] Size of inflateBuffer. - */ -int Untar_XzChunkContext_Init( - Untar_XzChunkContext *ctx, - enum xz_mode mode, - uint32_t dict_max, - void *inflateBuffer, - size_t inflateBufferSize -); - -/* - * @brief Untars a XZ compressed POSIX TAR file. - * - * This is a subroutine used to rip links, directories, and - * files out of a tar.gz/tgz file. - * - * @param Untar_ChunkContext *context [in] Pointer to a context structure. - * @param ssize buflen [in] Size of valid bytes in input buffer. - * @param z_stream *strm [in] Pointer to the current zlib context. - */ -int Untar_FromXzChunk_Print( - Untar_XzChunkContext *ctx, - const void *chunk, - size_t chunk_size, - const rtems_printer* printer -); - -/************************************************************************** - * This converts octal ASCII number representations into an - * unsigned long. Only support 32-bit numbers for now. - *************************************************************************/ -extern unsigned long -_rtems_octal2ulong(const char *octascii, size_t len); - -/************************************************************************ - * Compute the TAR checksum and check with the value in - * the archive. The checksum is computed over the entire - * header, but the checksum field is substituted with blanks. - ************************************************************************/ -extern int -_rtems_tar_header_checksum(const char *bufr); - -#ifdef __cplusplus -} -#endif -/**@}*/ -#endif /* _RTEMS_UNTAR_H */ -- cgit v1.2.3