source: zzuf/trunk/configure.ac @ 2330

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