-
Notifications
You must be signed in to change notification settings - Fork 22
/
configure.ac
144 lines (118 loc) · 3.55 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.66])
AC_INIT([tox-prpl], [0.5.1], [jin@mediatomb.cc],[], [http://tox.dhs.org/])
AC_CONFIG_SRCDIR([src/toxprpl.c])
AC_CONFIG_HEADERS([autoconfig.h])
AM_INIT_AUTOMAKE([1.10 -Wall subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_MACRO_DIR([m4])
if test "x${prefix}" = "xNONE"; then
prefix="${ac_default_prefix}"
fi
DEPSEARCH=
AC_ARG_WITH(dependency-search,
AC_HELP_STRING([--with-dependency-search=DIR],
[search for dependencies in DIR, i.e. look for libraries in
DIR/lib and for headers in DIR/include]),
[
DEPSEARCH="$withval"
]
)
if test -n "$DEPSEARCH"; then
CFLAGS="$CFLAGS -I$DEPSEARCH/include"
CPPFLAGS="$CPPFLAGS -I$DEPSEARCH/include"
LDFLAGS="$LDFLAGS -L$DEPSEARCH/lib"
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$DEPSEARCH/lib/pkgconfig
fi
AC_ARG_WITH(libtoxcore-headers,
AC_HELP_STRING([--with-libtoxcore-headers=DIR],
[search for libtoxcore header files in DIR]),
[
LIBTOXCORE_SEARCH_HEADERS="$withval"
AC_MSG_NOTICE([Will search for libtoxcore header files in $withval])
]
)
AC_ARG_WITH(libtoxcore-libs,
AC_HELP_STRING([--with-libtoxcore-libs=DIR],
[search for libtoxcore libraries in DIR]),
[
LIBTOXCORE_SEARCH_LIBS="$withval"
AC_MSG_NOTICE([Will search for libtoxcore libraries in $withval])
]
)
# Checks for programs.
AC_PROG_CC
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_INSTALL
AC_PROG_LIBTOOL
# Checks for libraries.
AC_STRUCT_TM
AC_CHECK_SIZEOF(time_t, [],[
#include <stdio.h>
#include <time.h>])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
# pkg-config checks
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES(PURPLE, [purple >= 2.7.0])
PKG_CHECK_MODULES(GLIB, [glib-2.0])
PKG_CHECK_MODULES(LIBTOXCORE, [libtoxcore])
EXTRA_LT_LDFLAGS="-avoid-version"
OS_PATH_SEPARATOR="/"
DEPS_PATH="$prefix"
WIN32="no"
AC_CANONICAL_HOST
case $host_os in
*mingw*)
WIN32="yes"
EXTRA_LT_LDFLAGS="$EXTRA_LT_LDFLAGS -module -no-undefined"
OS_PATH_SEPARATOR="\\"
;;
*darwin* | *rhapsody* | *macosx*)
;;
*)
EXTRA_LT_LDFLAGS="$EXTRA_LT_LDFLAGS -module"
;;
esac
if test "x$WIN32" = "xyes"; then
here=`pwd`
$(MKDIR_P) $prefix
cd $prefix
DEPS_PATH=`pwd -W | $SED 's/\//\\\/g'`
cd $here
fi
AC_SUBST(DEPS_PATH)
AC_SUBST(OS_PATH_SEPARATOR)
AC_SUBST(EXTRA_LT_LDFLAGS)
if test "x$WIN32" = "xyes"; then
AC_CHECK_LIB(ws2_32, main,
[
WINSOCK2_LIBS="-lws2_32"
AC_SUBST(WINSOCK2_LIBS)
],
[
AC_MSG_ERROR([required library was not found on the system, please c
heck your MinGW installation])
])
AC_CHECK_HEADERS([winsock2.h ws2tcpip.h],
[],
[
AC_MSG_ERROR([required header was not found on the system, please check your MinGW installation])
])
AC_DEFINE([_WIN32_WINNT], [0x501],
[enable getaddrinfo/freeaddrinfo for XP and higher])
fi
AC_PATH_PROG([MAKENSIS], [makensis${EXEEXT}], [no])
AM_CONDITIONAL(HAVE_NSIS, test "x$MAKENSIS" != "xno")
AC_CONFIG_FILES([Makefile
build/Makefile
pixmaps/Makefile
nsis/tox-prpl.nsi
])
AC_OUTPUT