summaryrefslogtreecommitdiff
path: root/utils/rkisp1/rkisp1-capture.sh
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2022-07-27 09:55:23 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-07-27 18:12:18 +0300
commitd1c89a1824416a03da10ebd078869cba79b6015c (patch)
tree4152532504e20902e519027bea3f05ed24a92156 /utils/rkisp1/rkisp1-capture.sh
parent8757cc7c4291420e94047ea54a735cbaa1eb6adb (diff)
ipa: raspberrypi: Remove #define constants
Replace all #define constant values with equivalent constexpr definitions. As a drive-by, remove the CAMERA_MODE_NAME_LEN constant as it is unused. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'utils/rkisp1/rkisp1-capture.sh')
0 files changed, 0 insertions, 0 deletions
/a> 131 132 133 134 135 136 137 138 139
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2021, Google Inc.
 *
 * source_paths.cpp - Identify libcamera source and build paths
 */

#include "libcamera/internal/source_paths.h"

#include <dlfcn.h>
#include <elf.h>
#include <link.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>

#include <libcamera/base/utils.h>

/**
 * \file source_paths.h
 * \brief Identify the build and source path of a not-yet-installed library
 */

/* musl doesn't declare _DYNAMIC in link.h, declare it manually. */
extern ElfW(Dyn) _DYNAMIC[];

namespace libcamera {

namespace {

/**
 * \brief Check if libcamera is installed or not
 *
 * Utilise the build_rpath dynamic tag which is stripped out by meson at
 * install time to determine at runtime if the library currently executing
 * has been installed or not.
 *
 * \return True if libcamera is installed, false otherwise
 */
bool isLibcameraInstalled()
{
	/*
	 * DT_RUNPATH (DT_RPATH when the linker uses old dtags) is removed on
	 * install.
	 */
	for (const ElfW(Dyn) *dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn) {
		if (dyn->d_tag == DT_RUNPATH || dyn->d_tag == DT_RPATH)
			return false;
	}

	return true;
}

} /* namespace */

namespace utils {

/**
 * \brief Retrieve the path to the build directory
 *