forked from netcwmp/netcwmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
executable file
·149 lines (121 loc) · 3.92 KB
/
configure.in
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
145
146
147
148
149
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(library, 1.0, support@itibia.com)
AC_CONFIG_AUX_DIR([build])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([])
AC_CONFIG_HEADER([config.h])
#AC_PREFIX_DEFAULT([])
# Checks for programs.
AC_PROG_CXX(g++)
AC_PROG_CC(gcc g++)
AC_PROG_MAKE_SET
AC_PROG_CPP
AC_PROG_LIBTOOL
AC_PROG_RANLIB
# Checks for libraries.
#AC_CHECK_LIB([rt], [mq_open])
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h malloc.h netdb.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/socket.h sys/time.h syslog.h unistd.h ])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_CHOWN
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
#comment it to prevent autoconf #define HAVE_MALLOC to 0 and #define malloc to rpl_malloc
#AC_FUNC_MALLOC
#AC_FUNC_MKTIME
#AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRFTIME
#check machine endian
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(int,[])
AC_CHECK_SIZEOF(short,[])
AC_CHECK_SIZEOF(long,[])
AC_CHECK_SIZEOF(float,[])
AC_CHECK_SIZEOF(double,[])
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_FUNCS([alarm bzero endgrent endpwent getcwd gethostbyname inet_ntoa isascii localtime_r memmove memset mkdir regcomp select socket strcasecmp strchr strcspn strdup strerror strncasecmp strrchr strspn strstr])
AC_CONFIG_FILES([Makefile
libpool/src/Makefile libxmlet/src/Makefile libcwmp/src/Makefile
cwmpd/src/Makefile tests/src/Makefile
])
#save user-provided flags
save_CXXFLAGS="$CXXFLAGS"
save_CFLAGS="-Wall -g"
save_LDFALGS="$LDFLAGS"
save_CPPFLAGS="-Wall -g"
#restore user-provided flags
CXXFLAGS="$save_CXXFLAGS"
CFLAGS="$save_CFLAGS "
#Note that sysconfdir is expaned in Makefile other than here, check generated configure script, u can see
#sysconfdir is surrounded by single quotas to prevent expansion.
CPPFLAGS="-D_GNU_SOURCE $save_CPPFLAGS"
LDFLAGS="$save_LDFALGS"
#CPPFLAGS="$CPPFLAGS -DUSE_CWMP_OPENSSL"
OPENSSL_DIR=no
AC_ARG_WITH(openssl, --with-openssl=<path> sets path to temp directory, OPENSSL_DIR=$withval, OPENSSL_DIR=no)
if test x"$OPENSSL_DIR" != "xno"; then
CPPFLAGS="$CPPFLAGS -DUSE_CWMP_OPENSSL -I$OPENSSL_DIR/include"
LDFLAGS="$LDFLAGS -L$OPENSSL_DIR/lib -lssl"
fi
AC_SUBST(OPENSSL_DIR)
#LIBS will be appended to gcc command, so it must be cleared to prevent unnecessary linking
#LIBS=""
#AC_CANONICAL_BUILD
#AC_CANONICAL_HOST
AH_TEMPLATE([BUILD_CPU], [cpu type used in building environment])
if test "x$build_cpu" != "x"; then
BUILD_CPU="$build_cpu"
AC_SUBST([BUILD_CPU])
AC_DEFINE_UNQUOTED([BUILD_CPU], [$build_cpu], [])
fi
AH_TEMPLATE([BUILD_VENDOR], [cpu vendor in building environment])
if test "x$build_vendor" != "x"; then
BUILD_VENDOR="$build_vendor"
AC_SUBST([BUILD_VENDOR])
AC_DEFINE_UNQUOTED([BUILD_VENDOR], [$build_vendor], [])
fi
AH_TEMPLATE([BUILD_OS], [os of building environment])
if test "x$build_os" != "x"; then
BUILD_OS="$build_os"
AC_SUBST([BUILD_OS])
AC_DEFINE_UNQUOTED([BUILD_OS], [$build_os], [])
fi
AH_TEMPLATE([HOST_CPU], [cpu type of host environment])
if test "x$host_cpu" != "x"; then
HOST_CPU="$host_cpu"
AC_SUBST([HOST_CPU])
AC_DEFINE_UNQUOTED([HOST_CPU], [$host_cpu], [])
fi
AH_TEMPLATE([HOST_VENDOR], [cpu vendor of host environment])
if test "x$host_vendor" != "x"; then
HOST_VENDOR="$host_vendor"
AC_SUBST([HOST_VENDOR])
AC_DEFINE_UNQUOTED([HOST_VENDOR], [$host_vendor], [])
fi
AH_TEMPLATE([HOST_OS], [os of host environment])
if test "x$host_os" != "x"; then
HOST_OS="$host_os"
AC_SUBST([HOST_OS])
AC_DEFINE_UNQUOTED([HOST_OS], [$host_os], [])
fi
AM_CONDITIONAL([COMPILE_FOR_MIPS], [ test "$target" = "mips64-octeon-linux-gnu" ])
AC_OUTPUT