cvs commit: src/lib/libc/citrus citrus_ctype_local.h citrus_iconv_local.h citrus_mapper_local.h citrus_module.c citrus_module.h citrus_none.c citrus_stdenc_local.h

Joerg Sonnenberger joerg at britannica.bec.de
Mon Jul 4 01:41:28 PDT 2005


On Mon, Jul 04, 2005 at 01:02:43AM -0700, Joerg Sonnenberger wrote:
>   Log:
>   Allow inclusion of Citrus modules in statically linked binaries.
>   
>   To achieve this, ensure that _citrus_module_$MOD is referenced
>   from the binary and link with -L/usr/lib/i18n -l$MOD for all
>   modules you are interested in.

You can try it with the attached Makefile fragment.

Joerg
CITRUS_MODS=	BIG5 EUC EUCTW GBK2K ISO2022 MSKanji UTF1632 UTF7 UTF8
CITRUS_MODS+=iconv_none iconv_std
CITRUS_MODS+=mapper_646 mapper_none mapper_serial mapper_std
CITRUS_MODS+=mapper_zone

. ifdef CITRUS_MODS
. for module in ${CITRUS_MODS}
LDADD+=	-L/usr/lib/i18n -l${module}
. endfor

SRCS+=	citrus.c

citrus.c:
	rm -f ${.TARGET}
	mods="${CITRUS_MODS}"; \
	for mod in $$mods; \
	do \
	    echo "extern const char *_citrus_module_$$mod;" >> ${.TARGET}; \
	    echo "const char **extern_$$mod = &_citrus_module_$$mod;" >> ${.TARGET}; \
	done

CLEANFILES+=	citrus.c
. endif




More information about the Commits mailing list