Fix CFLAGS/LDFLAGS syntax
[platform/upstream/lrzsz.git] / acinclude.m4
1 dnl AC_REPLACE_GNU_GETOPT
2 AC_DEFUN(AC_REPLACE_GNU_GETOPT,
3 [AC_CHECK_FUNC(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"])
4 AC_SUBST(LIBOBJS)dnl
5 ])
6
7 dnl
8 dnl taken from taylor uucp
9 AC_DEFUN(LRZSZ_ERRNO_DECL,[
10 AC_MSG_CHECKING(for errno declaration)
11 AC_CACHE_VAL(lrzsz_cv_decl_errno,
12 [AC_TRY_COMPILE([#include <errno.h>], [int i = errno; errno = 1;],
13 lrzsz_cv_decl_errno=yes, lrzsz_cv_decl_errno=no)])
14 AC_MSG_RESULT($lrzsz_cv_decl_errno)
15 if test $lrzsz_cv_decl_errno = yes; then
16   AC_DEFINE([HAVE_ERRNO_DECLARATION])
17 fi
18 ])
19
20 dnl for ease of use
21 AC_DEFUN([LRZSZ_HEADERS_TERM_IO],[
22 AC_CHECK_HEADERS(termios.h sys/termios.h termio.h sys/termio.h sgtty.h)dnl
23 ])
24
25 dnl LRZSZ_TYPE_SPEED_T
26 AC_DEFUN(LRZSZ_TYPE_SPEED_T,[
27 AC_REQUIRE([AC_HEADER_STDC])dnl
28 AC_REQUIRE([LRZSZ_HEADERS_TERM_IO])dnl
29 AC_MSG_CHECKING(for speed_t)
30 AC_CACHE_VAL(ac_cv_type_speed_t,
31 [AC_EGREP_CPP(speed_t, [#include <sys/types.h>
32 #if STDC_HEADERS
33 #include <stdlib.h>
34 #include <stddef.h>
35 #endif
36 #ifdef HAVE_TERMIOS_H
37 #include <termios.h>
38 #else
39 #if defined(HAVE_SYS_TERMIOS_H)
40 #include <sys/termios.h>
41 #else
42 #if defined(HAVE_TERMIO_H)
43 #include <termio.h>
44 #else
45 #if defined(HAVE_SYS_TERMIO_H)
46 #include <sys/termio.h>
47 #else
48 #if defined(HAVE_SGTTY_H)
49 #include <sgtty.h>
50 #else
51 #error neither termio.h nor sgtty.h found. Cannot continue. */
52 #endif
53 #endif
54 #endif
55 #endif
56 #endif
57 ], ac_cv_type_speed_t=yes, ac_cv_type_speed_t=no)])dnl
58 AC_MSG_RESULT($ac_cv_type_speed_t)
59 if test $ac_cv_type_speed_t = no; then
60   AC_DEFINE([speed_t],long)
61 fi
62 ])
63
64 AC_DEFUN(lrzsz_HEADER_SYS_SELECT,
65 [AC_CACHE_CHECK([whether sys/time.h and sys/select.h may both be included],
66   lrzsz_cv_header_sys_select,
67 [AC_TRY_COMPILE([#include <sys/types.h>
68 #include <sys/time.h>
69 #include <sys/select.h>],
70 [struct tm *tp;], lrzsz_cv_header_sys_select=yes, lrzsz_cv_header_sys_select=no)])
71 if test $lrzsz_cv_header_sys_select = no; then
72   AC_DEFINE(SYS_TIME_WITHOUT_SYS_SELECT)
73 fi
74 ])
75