forked from JimiHFord/unnks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
130 lines (106 loc) · 2.71 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
130
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([unnks],[0.2.5],[[email protected]])
AC_CONFIG_SRCDIR([src/unnks.c])
AC_CONFIG_HEADER([src/config.h])
AM_INIT_AUTOMAKE([foreign])
# M4 defines __unix__ to be the empty string on UNIX-like systems. This
# causes AC_DEFINE to fail if it is used to define __unix__. This seems to
# fix the problem.
ifdef([__unix__], define([__unix__], [[__unix__]]))
AC_CANONICAL_HOST
# Checks for programs.
AC_PROG_CC
PKG_PROG_PKG_CONFIG
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
# Debian architecture check
AC_MSG_CHECKING([the Debian architecture of this system])
case "$host_cpu" in
i?86)
AC_MSG_RESULT([i386])
DEBIAN_ARCH=i386
;;
x86_64)
AC_MSG_RESULT([amd64])
DEBIAN_ARCH=amd64
;;
arm*)
AC_MSG_RESULT([arm])
DEBIAN_ARCH=arm
;;
*)
DEBIAN_ARCH="$ARCH"
AC_MSG_RESULT([unknown])
AC_MSG_WARN([Unknown Debian architecture: If you are building packages, please check the debian/control file])
;;
esac
AC_SUBST([DEBIAN_ARCH])
AC_MSG_CHECKING([host operating system])
case "$host_os" in
mingw32*)
os="windows"
;;
darwin*)
os="darwin"
;;
*)
os="$host_os"
;;
esac
AM_CONDITIONAL([OS_WINDOWS], [test "$os" = "windows"])
AM_CONDITIONAL([OS_DARWIN], [test "$os" = "darwin"])
AC_MSG_RESULT([$os])
AC_MSG_CHECKING([whether to build nks-ls-libs])
case "$host_os" in
darwin*|mingw32*)
build_nks_ls_libs=yes
;;
*)
build_nks_ls_libs=no
;;
esac
AM_CONDITIONAL([BUILD_NKS_LS_LIBS], [test "x$build_nks_ls_libs" = "xyes"])
AC_MSG_RESULT([$build_nks_ls_libs])
AC_MSG_CHECKING([[if we need a __unix__ define]])
AC_COMPILE_IFELSE([
#ifndef __unix__
# if defined __APPLE__ /* add other known platforms here */
# error should have __unix__ but don't
# endif
#endif
], [AC_MSG_RESULT([no])],
[
AC_MSG_RESULT([yes])
AC_DEFINE([__unix__], 1,
[Define to 1 if running on a UNIX-like system where __unix__ is missing])
])
# Checks for libraries.
BACKUP_LIBS=$LIBS
AC_CHECK_LIB([gcrypt],[gcry_check_version],,[
AC_ERROR([libgcrypt not found])
])
LIBS=$BACKUP_LIBS
GCRYPT_LIBS=-lgcrypt
AC_SUBST([GCRYPT_LIBS])
PKG_CHECK_MODULES([GLIB], [glib-2.0], ,[
AC_ERROR([glib-2.0 not found])
])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([inttypes.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_OFF_T
AC_SYS_LARGEFILE
# Checks for library functions.
AC_CHECK_FUNCS([posix_fallocate])
AC_CONFIG_FILES([debian/control Makefile src/Makefile])
AC_OUTPUT