1 |
ab11 |
1.1 |
dnl Use autoconf on this directory to produce configure script |
2 |
|
|
dnl Use autoheader on this file to produce config.h.in |
3 |
|
|
dnl Then use configure script to generate makefile from Makefile.in |
4 |
|
|
|
5 |
|
|
AC_INIT(sockstream.h) dnl a distinct socket++ file |
6 |
|
|
AC_CONFIG_HEADER(config.h) |
7 |
|
|
|
8 |
|
|
dnl check for programs |
9 |
|
|
AC_PROG_MAKE_SET |
10 |
|
|
AC_PROG_CC |
11 |
|
|
AC_PROG_CXX |
12 |
|
|
AC_PROG_RANLIB |
13 |
|
|
AC_CHECK_PROG(MAKEDEPEND, makedepend, makedepend, :) dnl not a smiley :( |
14 |
|
|
AC_PROG_CPP dnl later macros will use it |
15 |
|
|
AC_PROG_CXXCPP dnl later macros will use it |
16 |
|
|
AC_AIX |
17 |
|
|
|
18 |
|
|
dnl check for libraries |
19 |
|
|
AC_CHECK_LIB(nsl, t_accept, NETWORK_LIBS="$NETWORK_LIBS -lnsl") |
20 |
|
|
AC_CHECK_LIB(socket, socket, NETWORK_LIBS="$NETWORK_LIBS -lsocket") |
21 |
|
|
AC_SUBST(NETWORK_LIBS) |
22 |
|
|
|
23 |
|
|
dnl check for header files |
24 |
|
|
AC_LANG_SAVE |
25 |
|
|
AC_LANG_CPLUSPLUS |
26 |
|
|
AC_CHECK_HEADERS(builtin.h string.h memory.h) |
27 |
|
|
AC_CHECK_HEADER(_G_config.h, AC_DEFINE(_S_LIBGXX)) |
28 |
|
|
AC_LANG_RESTORE |
29 |
|
|
AC_HEADER_SYS_WAIT |
30 |
|
|
|
31 |
|
|
dnl check for typedefs |
32 |
|
|
AC_PID_T |
33 |
|
|
|
34 |
|
|
dnl check for structures |
35 |
|
|
|
36 |
|
|
dnl check for compiler characteristics |
37 |
|
|
AC_SUBST(CFLAGS) |
38 |
|
|
AC_SUBST(CXXFLAGS) |
39 |
|
|
AC_SUBST(LDFLAGS) |
40 |
|
|
|
41 |
|
|
dnl check for library functions and global variables |
42 |
|
|
AC_RETSIGTYPE |
43 |
|
|
AC_FUNC_VFORK |
44 |
|
|
AC_HAVE_FUNCS(select) |
45 |
|
|
|
46 |
|
|
AC_MSG_CHECKING(for sys_siglist) |
47 |
|
|
AC_CACHE_VAL(socketxx_cv_siglist, [ |
48 |
|
|
AC_TRY_LINK([ |
49 |
|
|
# include <unistd.h> |
50 |
|
|
# include <sys/signal.h> |
51 |
|
|
], [ |
52 |
|
|
#ifndef _sys_siglist |
53 |
|
|
extern char* _sys_siglist[]; |
54 |
|
|
#endif |
55 |
|
|
puts(*_sys_siglist); |
56 |
|
|
], |
57 |
|
|
socketxx_cv_siglist=_sys_siglist, |
58 |
|
|
socketxx_cv_siglist=sys_siglist) ]) |
59 |
|
|
|
60 |
|
|
AC_DEFINE_UNQUOTED(SYS_SIGLIST, $socketxx_cv_siglist) |
61 |
|
|
AC_MSG_RESULT($socketxx_cv_siglist) |
62 |
|
|
|
63 |
|
|
dnl the following check was provided by |
64 |
|
|
dnl Blair Zajac <blair@olympia.gps.caltech.edu> |
65 |
|
|
AC_MSG_CHECKING(if extern \"C\" wrappers are needed) |
66 |
|
|
AC_CACHE_VAL(bz_cv_cplusplus_needexternCwrapper, [ |
67 |
|
|
AC_LANG_SAVE |
68 |
|
|
AC_LANG_CPLUSPLUS |
69 |
|
|
AC_TRY_LINK([ |
70 |
|
|
# include <string.h> |
71 |
|
|
# include <stdio.h> |
72 |
|
|
], [ |
73 |
|
|
char buf[100]; |
74 |
|
|
strcpy(buf, "Hello world\n"); |
75 |
|
|
], |
76 |
|
|
bz_cv_cplusplus_needexternCwrapper=no, |
77 |
|
|
bz_cv_cplusplus_needexternCwrapper=yes) |
78 |
|
|
]) |
79 |
|
|
AC_LANG_RESTORE |
80 |
|
|
|
81 |
|
|
if test $bz_cv_cplusplus_needexternCwrapper = no; then |
82 |
|
|
AC_DEFINE(EXTERN_C_BEGIN,) |
83 |
|
|
AC_DEFINE(EXTERN_C_END,) |
84 |
|
|
else |
85 |
|
|
AC_DEFINE(EXTERN_C_BEGIN, extern "C" {) |
86 |
|
|
AC_DEFINE(EXTERN_C_END, }) |
87 |
|
|
fi |
88 |
|
|
AC_MSG_RESULT($bz_cv_cplusplus_needexternCwrapper) |
89 |
|
|
|
90 |
|
|
dnl check for system |
91 |
|
|
|
92 |
|
|
dnl generate output files |
93 |
|
|
AC_OUTPUT(Makefile test/Makefile) |