forked from kspalaiologos/xpar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
63 lines (52 loc) · 2.27 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
m4_define([xpar_version_major], [0])
m4_define([xpar_version_minor], [2])
m4_define([xpar_version], [xpar_version_major.xpar_version_minor])
AC_PREREQ([2.69])
AC_INIT([xpar],[xpar_version],[https://github.com/kspalaiologos/xpar])
AC_CONFIG_HEADERS([config.h])
AC_COPYRIGHT([Copyright (C) 2022-2024 Kamila Szewczyk])
AC_LANG([C])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall color-tests])
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_CC
AM_PROG_AS
AC_CHECK_HEADERS([getopt.h io.h])
AC_CHECK_FUNCS([getopt_long asprintf strndup stat _commit _setmode isatty fsync mmap CreateFileMappingA])
AC_DEFINE([XPAR_MINOR], [xpar_version_minor], [Minor version number of xpar])
AC_DEFINE([XPAR_MAJOR], [xpar_version_major], [Major version number of xpar])
AX_C_RESTRICT
AC_CHECK_SIZEOF([size_t])
AC_ARG_ENABLE([x86_64], [AS_HELP_STRING([--enable-x86_64], [Enable x86_64 platform specific code.])], [enable_x86_64=$enableval], [enable_x86_64=no])
if test "x$enable_x86_64" = "xyes"; then
AC_DEFINE([XPAR_X86_64], [1], [Enable x86_64 platform specific code.])
AM_CONDITIONAL([XPAR_X86_64], [true])
AX_PROG_NASM
AX_GCC_FUNC_ATTRIBUTE([sysv_abi])
else
AM_CONDITIONAL([XPAR_X86_64], [false])
fi
AC_ARG_ENABLE([aarch64], [AS_HELP_STRING([--enable-aarch64], [Enable aarch64 platform specific code.])], [enable_aarch64=$enableval], [enable_aarch64=no])
if test "x$enable_aarch64" = "xyes"; then
AC_DEFINE([XPAR_AARCH64], [1], [Enable aarch64 platform specific code.])
AM_CONDITIONAL([XPAR_AARCH64], [true])
else
AM_CONDITIONAL([XPAR_AARCH64], [false])
fi
AC_ARG_ENABLE([native], [AS_HELP_STRING([--enable-native], [Enable native platform optimisations.])], [enable_native=$enableval], [enable_native=no])
if test "x$enable_native" = "xyes"; then
AX_APPEND_COMPILE_FLAGS([-march=native -mtune=native])
fi
AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static], [Enable static linking.])], [enable_static=$enableval], [enable_static=no])
if test "x$enable_static" = "xyes"; then
AX_APPEND_LINK_FLAGS([-static])
fi
AC_ARG_ENABLE([lto], [AS_HELP_STRING([--enable-lto], [Enable link-time optimisation.])], [enable_lto=$enableval], [enable_lto=no])
if test "x$enable_lto" = "xyes"; then
AX_APPEND_COMPILE_FLAGS([-flto])
AX_APPEND_LINK_FLAGS([-flto])
fi
AC_CONFIG_FILES([Makefile])
AC_OUTPUT