1
0
mirror of https://github.com/opencryptoki/opencryptoki.git synced 2026-10-24 05:39:17 +03:00
Files
opencryptoki/tools/tools.mk
Akash Kulhalli a402a405fa aix: Add missing code that is AIX-specific
AIX does not have any of the BSD's warnx and friends functions, and neither
does it have getopt_long. Both of these are included, sourced from a pool of
permissive licenses, with their license notices intact.

In an effort to preserve nativity, this code is not used on other platforms,
instead preferring to use the native behaviours available on respective
platforms.

Additionally, this commit also includes some changes that _removes_
platform-specificity for the Linux platform, setting the _GNU_SOURCE macro
once in autoconf, instead of duplicating that in every source file.

Signed-off-by: Akash Kulhalli <akash.kulhalli@ibm.com>
2024-04-24 09:48:07 +02:00

34 lines
1.2 KiB
Makefile

noinst_PROGRAMS += tools/tableidxgen tools/policyexamplegen
TOOLS_CFLAGS = -I${srcdir}/usr/include -I${srcdir}/usr/lib/api \
-I${top_builddir}/usr/lib/api -I${srcdir}/usr/lib/common
tools_tableidxgen_SOURCES = tools/tableidxgen.c usr/lib/api/mechtable.inc
if AIX
tools_tableidxgen_SOURCES += usr/lib/common/aix/err.c \
usr/lib/common/aix/getopt_long.c
endif
tools_policyexamplegen_SOURCES = tools/policyexamplegen.c usr/lib/api/mechtable.c
if CROSS
tools_tableidxgen_LINK = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
$(tools_tableidxgen_OBJECTS): CC=$(CC_FOR_BUILD)
$(tools_tableidxgen_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(TOOLS_CFLAGS)
$(tools_tableidxgen_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD)
tools_policyexamplegen_LINK = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
$(tools_policyexamplegen_OBJECTS): CC=$(CC_FOR_BUILD)
$(tools_policyexamplegen_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(TOOLS_CFLAGS)
$(tools_policyexamplegen_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD)
else
tools_tableidxgen_LINK = $(LINK)
tools_tableidxgen_CFLAGS = $(TOOLS_CFLAGS)
tools_policyexamplegen_LINK = $(LINK)
tools_policyexamplegen_CFLAGS = $(TOOLS_CFLAGS)
endif