/*-1* Copyright (c) 2011-2012 Baptiste Daroussin <[email protected]>2* Copyright (c) 2012-2013 Matthew Seaman <[email protected]>3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer10* in this position and unchanged.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR16* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES17* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.18* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,19* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT20* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,21* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY22* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF24* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.25*/2627#ifdef HAVE_CONFIG_H28#include "pkg_config.h"29#endif3031#include <bsd_compat.h>3233#include "pkg.h"34#include "private/pkg.h"35#include "private/event.h"3637int38suggest_arch(struct pkg *pkg, bool isdefault)39{40bool iswildcard;4142iswildcard = (strchr(pkg->abi, '*') != NULL);4344if (iswildcard && isdefault)45pkg_emit_developer_mode("Configuration error: arch \"%s\" "46"cannot use wildcards as default", pkg->abi);4748if (pkg->flags & (PKG_CONTAINS_ELF_OBJECTS|PKG_CONTAINS_STATIC_LIBS)) {49if (iswildcard) {50/* Definitely has to be arch specific */51pkg_emit_developer_mode("Error: arch \"%s\" -- package "52"installs architecture specific files", pkg->abi);53}54} else {55if (pkg->flags & PKG_CONTAINS_LA) {56if (iswildcard) {57/* Could well be arch specific */58pkg_emit_developer_mode("Warning: arch \"%s\" "59"-- package installs libtool files which "60" are often architecture specific",61pkg->abi);62}63} else {64/* Might be arch independent */65if (!iswildcard)66pkg_emit_developer_mode("Notice: arch \"%s\" -- "67"no architecture specific files found:\n"68"**** could this package use a wildcard "69"architecture?", pkg->abi);70}71}72return (EPKG_OK);73}747576