Redfoxmoon / cross / slibtool

Forked from cross/slibtool 10 months ago
Clone

Blame src/output/slbt_output_features.c

23b101
/*******************************************************************/
23b101
/*  slibtool: a skinny libtool implementation, written in C        */
23b101
/*  Copyright (C) 2016--2017  Z. Gilboa                            */
23b101
/*  Released under the Standard MIT License; see COPYING.SLIBTOOL. */
23b101
/*******************************************************************/
23b101
23b101
#include <stdio.h>
23b101
#include <string.h>
23b101
#include <stdbool.h>
23b101
23b101
#include <slibtool/slibtool.h>
23b101
#include "slibtool_errinfo_impl.h"
23b101
23b101
static const char enable[]  = "enable";
23b101
static const char disable[] = "disable";
23b101
23b101
int slbt_output_features(const struct slbt_driver_ctx * dctx)
23b101
{
23b101
	const char * shared_option;
23b101
	const char * static_option;
23b101
23b101
	shared_option = (dctx->cctx->drvflags & SLBT_DRIVER_DISABLE_SHARED)
23b101
		? disable : enable;
23b101
23b101
	static_option = (dctx->cctx->drvflags & SLBT_DRIVER_DISABLE_STATIC)
23b101
		? disable : enable;
23b101
23b101
	if (fprintf(stdout,"host: %s\n",dctx->cctx->host.host) < 0)
23b101
		return SLBT_SYSTEM_ERROR(dctx);
23b101
23b101
	if (fprintf(stdout,"%s shared libraries\n",shared_option) < 0)
23b101
		return SLBT_SYSTEM_ERROR(dctx);
23b101
23b101
	if (fprintf(stdout,"%s static libraries\n",static_option) < 0)
23b101
		return SLBT_SYSTEM_ERROR(dctx);
23b101
23b101
	return fflush(stdout)
23b101
		? SLBT_SYSTEM_ERROR(dctx)
23b101
		: 0;
23b101
}