source: zzuf/trunk/configure.ac @ 1701

Last change on this file since 1701 was 1701, checked in by Sam Hocevar, 13 years ago
  • Added DLL initialisation code for Win32.
File size: 2.5 KB
Line 
1# $Id: configure.ac 98 2006-09-22 16:27:37Z sam $
2
3AC_INIT(zzuf, 0.5)
4
5AC_PREREQ(2.50)
6AC_CONFIG_SRCDIR(src/zzuf.c)
7AC_CONFIG_AUX_DIR(autotools)
8AC_CANONICAL_SYSTEM
9
10AM_INIT_AUTOMAKE(zzuf, 0.5)
11AM_CONFIG_HEADER(config.h)
12
13AM_PROG_CC_C_O
14AC_PROG_CPP
15AC_PROG_LIBTOOL
16
17case "${host_os}" in
18  *mingw32*)
19    WIN32DLL_LDFLAGS="-Wl,-l,imagehlp"
20    ac_cv_func_recv=yes
21    ac_cv_func_recvfrom=yes
22    ac_cv_func_socket=yes
23    ac_cv_func_accept=yes
24    ;;
25esac
26AC_SUBST(WIN32DLL_LDFLAGS)
27
28AC_CHECK_HEADERS(windows.h winsock2.h inttypes.h stdint.h getopt.h libc.h malloc.h dlfcn.h regex.h sys/socket.h sys/uio.h aio.h sys/mman.h sys/wait.h sys/resource.h)
29
30AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 fseeko _IO_getc getline getdelim __getdelim fgetln __srefill map_fd memalign posix_memalign aio_read accept socket readv pread recv recvfrom recvmsg mmap valloc sigaction)
31
32AC_CHECK_TYPES(sighandler_t, [], [],
33  [#define _GNU_SOURCE
34   #include <signal.h>])
35AC_CHECK_TYPES(sig_t, [], [],
36  [#include <signal.h>])
37AC_CHECK_TYPES(socklen_t, [], [],
38  [#include <sys/types.h>
39   #include <sys/socket.h>])
40
41AC_MSG_CHECKING(for read() prototype)
42AC_TRY_COMPILE([#include <unistd.h>],
43 [ssize_t read(int fd, void *buf, size_t count);],
44 [AC_MSG_RESULT(ssize_t read(... size_t);)
45  AC_DEFINE(READ_USES_SSIZE_T, 1, [Define to 1 if read() uses ssize_t.])],
46 [AC_MSG_RESULT(int read(... unsigned int);)])
47
48AC_MSG_CHECKING(for recv() return value)
49ac_v_recv_t="int"
50AC_TRY_COMPILE([#include <sys/types.h>
51  #include <sys/socket.h>],
52 [ssize_t recv(int s, void *buf, size_t len, int flags);],
53 [ac_v_recv_t="ssize_t"])
54AC_MSG_RESULT($ac_v_recv_t)
55AC_DEFINE_UNQUOTED(RECV_T, $ac_v_recv_t, [Define to the recv() return type])
56
57AC_CHECK_FUNCS(getopt_long,
58 [AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)],
59 [AC_CHECK_LIB(gnugetopt, getopt_long,
60   [AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
61    GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
62AC_SUBST(GETOPT_LIBS)
63
64AC_CHECK_LIB(m, log, [MATH_LIBS="-lm"])
65AC_SUBST(MATH_LIBS)
66AC_CHECK_LIB(dl, dlopen, [DL_LIBS="-ldl"])
67AC_SUBST(DL_LIBS)
68
69# Optimizations
70CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
71# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
72CFLAGS="${CFLAGS} -Wall -W -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
73
74AC_OUTPUT([
75  Makefile
76  src/Makefile
77  doc/Makefile
78  test/Makefile
79])
80
Note: See TracBrowser for help on using the repository browser.