-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
49 lines (39 loc) · 1.15 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
# -*- Autoconf -*-
AC_PREREQ([2.59])
AC_INIT([smtpc], [1.0.0], [ikeda@conversion.co.jp])
AM_INIT_AUTOMAKE([foreign -Wall -Werror 1.9 tar-pax])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS([config.h])
# Check options
# If you bundle me in other package, use --disable-smtpc not to build me.
AC_ARG_ENABLE(
smtpc, [],
[case "$enableval" in
yes) smtpc=true;;
no) smtpc=false;;
*) smtpc=true;;
esac],
[smtpc=true]
)
# Checks for programs.
AC_PROG_CC
if test x$smtpc = xtrue; then
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h netdb.h stdlib.h string.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_CHECK_SIZEOF([unsigned int])
AC_CHECK_SIZEOF([unsigned long])
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset select socket strdup strerror])
AC_FUNC_SNPRINTF
AC_CHECK_FUNC([getaddrinfo], [],
[AC_CHECK_LIB([socket], [getaddrinfo], [LIBS="-lsocket -lnsl $LIBS"], [],
[-lnsl])])
fi
AC_CONFIG_FILES([Makefile])
AC_OUTPUT