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
150
151
|
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([node], [0.3.0], [ryan@joyent.com])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/node.cc])
AC_CANONICAL_BUILD
AC_CANONICAL_TARGET
config_file=config.mak.autogen
config_append=config.mak.append
config_in=config.mak.in
echo "# ${config_append}. Generated by configure." > "${config_append}"
#dnl Search for pkg-config
#AC_PATH_PROG(PKG_CONFIG, pkg-config)
# TODO support options
# --efence Build with -lefence for debugging [Default: False]
# --without-snapshot Build without snapshotting V8 libraries. You might want to set this for cross-compiling.
# [Default: False]
# --without-ssl Build without SSL
# --shared-v8 Link to a shared V8 DLL instead of static linking
# --shared-v8-includes=SHARED_V8_INCLUDES
# Directory containing V8 header files
# --shared-v8-libpath=SHARED_V8_LIBPATH
# A directory to search for the shared V8 DLL
# --shared-v8-libname=SHARED_V8_LIBNAME
# Alternative lib name to link to (default: 'v8')
# --shared-cares Link to a shared C-Ares DLL instead of static linking
# --shared-cares-includes=SHARED_CARES_INCLUDES
# Directory containing C-Ares header files
# --shared-cares-libpath=SHARED_CARES_LIBPATH
# A directory to search for the shared C-Ares DLL
# --shared-libev Link to a shared libev DLL instead of static linking
# --shared-libev-includes=SHARED_LIBEV_INCLUDES
# Directory containing libev header files
# --shared-libev-libpath=SHARED_LIBEV_LIBPATH
# A directory to search for the shared libev DLL
# ------------------------------------------------------------------------------
# Checks
# $arch (only those we support, i.e. lowest common denominator)
# Customize by e.g: ./configure --target=i386-apple-darwin
AC_MSG_CHECKING([target architecture identifier])
case "$target_cpu" in
x64|x86_64|ia64) arch=x64 ;;
ia32|i386|i486|i586|i686) arch=ia32 ;;
arm|armeb) arch=arm ;;
*) AC_MSG_ERROR([Unsupported target architecture: $target_cpu]) ;;
esac
AC_SUBST(arch,[${arch}])
AC_MSG_RESULT([$arch])
# CFLAGS += -m{32,64}
if ( echo "$build_cpu" | egrep -q 'x64|x86_64|ia64' ); then
if test "$arch" = "ia32"; then CFLAGS="${CFLAGS} -m32"; fi
else
if test "$arch" = "x64"; then CFLAGS="${CFLAGS} -m64" ;fi
fi
# $platform (only those we support, i.e. [[ -d deps/c-ares/${platform}-* ]])
AC_MSG_CHECKING([target platform identifier])
if test "$target_os" = "none"; then target_os="$build_os"; fi
case "$target_os" in
#android*) platform=android ;;
cygwin*) platform=cygwin ;;
darwin*) platform=darwin ;;
freebsd*) platform=freebsd ;;
linux*) platform=linux ;;
openbsd*) platform=openbsd ;;
*solaris*|sunos*) platform=solaris ;;
#win32*) platform=win32 ;;
*) AC_MSG_ERROR([Unsupported target platform: $target_os]) ;;
esac
AC_SUBST(platform,[${platform}])
AC_MSG_RESULT([$platform])
# Darwin cross-compilation target -arch flag
if test "$platform" = "darwin"; then
CFLAGS="${CFLAGS} -arch ${target_cpu}";
LDFLAGS="${LDFLAGS} -arch ${target_cpu}"
fi
# Checks for programs.
AC_CHECK_PROGS(TAR, [gtar tar])
AC_CHECK_TOOLS(AR, [gar ar], :)
AC_PROG_MKDIR_P
AC_PROG_LN_S
AC_PROG_INSTALL
# Checks for header files
AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_CHAR_UNSIGNED
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_STAT
AC_SEARCH_LIBS([dlopen], [dl dld], [], [
AC_MSG_ERROR([Unable to find the dlopen() function])
])
# TODO FIXME: Check for OpenSSL -- expect it to exist for now
AC_SUBST([HAVE_OPENSSL],[1])
# check for -lsocket on solaris
AC_CHECK_LIB([c], [socket], [WANT_SOCKET=], [WANT_SOCKET=1])
AC_SUBST(WANT_SOCKET)
# ------------------------------------------------------------------------------
# Embedded dependencies
m4_include([deps/libev/libev.m4])
m4_include([deps/libeio/libeio.m4])
AC_CONFIG_HEADERS([build/deps/libev/config.h:deps/libev/config.h.in])
AC_CONFIG_HEADERS([build/deps/libeio/config.h:deps/libeio/config.h.in])
AC_CONFIG_FILES(["${config_file}":"${config_in}"])
mkdir -p build/debug/src build/release/src
mkdir -p build/debug/deps/libev build/release/deps/libev
mkdir -p build/debug/deps/libeio build/release/deps/libeio
mkdir -p build/debug/deps/c-ares build/release/deps/c-ares
mkdir -p build/debug/deps/http_parser build/release/deps/http_parser
mkdir -p build/debug/deps/v8 build/release/deps/v8
mkdir -p build/debug/lib/pkgconfig build/release/lib/pkgconfig
# ------------------------------------------------------------------------------
# Output files
AC_OUTPUT
# ------------------------------------------------------------------------------
# Cleanup
rm -f "${config_append}"
|