-
Notifications
You must be signed in to change notification settings - Fork 31
/
configure.ac
129 lines (109 loc) · 3.48 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
# version details - use utils/bump-version to update it
m4_define([adflib_version],[0.8.0])
m4_define([adflib_lt_version],[1:0:0])
m4_define([adflib_date],[2023-06-26])
AC_INIT([adflib],[adflib_version])
AC_CONFIG_SRCDIR([src/adf_env.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes])
AC_ARG_ENABLE([examples],
[ --enable-examples Build exmples],
[case "${enableval}" in
yes) examples=true ;;
no) examples=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-examples]) ;;
esac],
[examples=true])
AM_CONDITIONAL([EXAMPLES], [test x$examples = xtrue])
AC_ARG_ENABLE([regtests],
[ --enable-regtests Build regression tests],
[case "${enableval}" in
yes) regtests=true ;;
no) regtests=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-regtests]) ;;
esac],
[regtests=true])
AM_CONDITIONAL([REGTESTS], [test x$regtests = xtrue])
#
# native
#
AC_CANONICAL_HOST
# detect first
echo "Host OS: ${host_os}"
case "${host_os}" in
linux*)
NATIVE_DIR=linux
;;
win32*)
NATIVE_DIR=win32
;;
cygwin*)
NATIVE_DIR=win32
;;
darwin*)
NATIVE_DIR=generic
;;
*)
NATIVE_DIR=generic
;;
esac
# ... then check if enforced
AC_ARG_ENABLE([native_generic],
[ --enable-native-generic Enable generic native devices],
[case "${enableval}" in
yes) NATIVE_DIR=generic ;;
no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-native-generic]) ;;
esac],
[])
AC_ARG_ENABLE([native_linux],
[ --enable-native-linux Enable Linux native devices],
[case "${enableval}" in
yes) NATIVE_DIR=linux ;;
no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-native-linux]) ;;
esac],
[])
AC_ARG_ENABLE([native_win32],
[ --enable-native-win32 Enable Win32 native devices],
[case "${enableval}" in
yes) NATIVE_DIR=win32 ;;
no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-native-win32]) ;;
esac],
[])
echo "Native device: ${NATIVE_DIR}"
AM_CONDITIONAL([NATIVE_GENERIC], [test x${NATIVE_DIR} = xgeneric])
AM_CONDITIONAL([NATIVE_LINUX], [test x${NATIVE_DIR} = xlinux])
AM_CONDITIONAL([NATIVE_WIN32], [test x${NATIVE_DIR} = xwin32])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_AR
LT_INIT
# Checks for libraries.
PKG_CHECK_MODULES([CHECK], [check >= 0.11.0], [tests=yes], [tests=no])
AM_CONDITIONAL([TESTS], [test x${tests} = xyes])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT32_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Version
AC_SUBST([ADFLIB_VERSION], [adflib_version])
AC_SUBST([ADFLIB_LT_VERSION], [adflib_lt_version])
AC_SUBST([ADFLIB_DATE], [adflib_date])
AC_CONFIG_FILES([Makefile
src/Makefile
doc/Makefile
examples/Makefile
regtests/Test/Makefile
tests/Makefile
adflib.pc])
AC_OUTPUT