File: configure.ac

package info (click to toggle)
adasockets 1.8.6-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,336 kB
  • ctags: 93
  • sloc: sh: 8,947; ada: 1,676; ansic: 357; makefile: 222
file content (120 lines) | stat: -rw-r--r-- 3,221 bytes parent folder | download
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
AC_INIT(src/sockets.ads)
AC_CONFIG_AUX_DIR(support)
AM_INIT_AUTOMAKE([adasockets],[1.8.6])
AM_CONFIG_HEADER(src/config.h)
#
# Package description
#
LIBVERSIONINFO=1:0:0
AC_SUBST(LIBVERSIONINFO)
AM_PROG_LIBTOOL
#
AC_CHECK_PROGS(AWK, [gnuawk gawk awk])
#
# Check for maintainer mode
#
AC_ARG_ENABLE(debug,
AS_HELP_STRING(--enable-debug,turn on debugging options),
[ADAFLAGS="-g -O2 -Wall -gnatag"],
[ADAFLAGS="-O2 -gnatpng"])
AC_SUBST(ADAFLAGS)
#
# Check for documentation build and installation
#
AC_ARG_ENABLE(doc,
AS_HELP_STRING(--disable-doc,do not build and install documentation),
[case "${enableval}" in
  yes) doc=true ;;
  no)  doc=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-doc) ;;
esac],[doc=true])
AM_CONDITIONAL(BUILD_DOC, test x$doc = xtrue)
#
# Check for examples build and installation
#
AC_ARG_ENABLE(examples,
AS_HELP_STRING(--disable-examples,do not build and install examples),
[case "${enableval}" in
  yes) examples=true ;;
  no)  examples=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-examples) ;;
esac],[examples=true])
AM_CONDITIONAL(BUILD_EXAMPLES, test x$examples = xtrue)
#
# Check for documentation software
#
AC_CHECK_PROG(GETDEFS, getdefs, getdefs)
AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo)
AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi)
AC_CHECK_PROG(DVIPS, dvips, dvips)
#
# Look for the C compiler
#
AC_PROG_CC
#
# Look for the Ada compiler
#
AC_CHECK_PROG([GNATMAKE], [gnatmake], [gnatmake])
if test -z "$GNATMAKE"; then
  AC_MSG_ERROR([unable to find gnatmake])
fi
#
# Libtool checks
#
AC_PROG_LIBTOOL
#
# Test for -lnsl, -lsocket and -lresolv
#
AC_CHECK_FUNC(gethostbyname,NSLNEEDED="--  ",
  AC_CHECK_LIB(nsl,gethostbyname,,NSLNEEDED="--  "))
AC_SUBST(NSLNEEDED)
AC_CHECK_FUNC(connect,SOCKETNEEDED="--  ",
  AC_CHECK_LIB(socket,connect,,SOCKETNEEDED="--  "))
AC_SUBST(SOCKETNEEDED)
AC_CHECK_FUNC(inet_aton,RESOLVNEEDED="--  ",
  AC_CHECK_LIB(resolv,inet_aton,,RESOLVNEEDED="--  "))
AC_SUBST(RESOLVNEEDED)
#
# Extra libraries
#
AC_ARG_WITH(extra-libs,
 [  --with-extra-libs=libs  Add extra libraries when building a program],
 [EXTRA_LIBS="${withval}"])
AC_SUBST(EXTRA_LIBS)
#
# Header files
#
AC_CHECK_HEADERS([stdio.h sys/types.h sys/socket.h errno.h netdb.h stdlib.h])
AC_CHECK_HEADERS([netinet/in.h signal.h fcntl.h termio.h termios.h sys/file.h])
AC_CHECK_HEADERS([sys/ioctl.h netinet/tcp.h sys/systeminfo.h poll.h stropts.h])
AC_CHECK_HEADERS([sys/conf.h sys/param.h time.h windows.h string.h])
AC_CHECK_HEADERS(windows.h, [usewin32=true useunix=false],
                            [usewin32=false useunix=true])
#
# sa_len field ?
#
AC_CHECK_MEMBER(struct sockaddr.sa_len,[SA_LEN="" NO_SA_LEN="--  "],[SA_LEN="--  " NO_SA_LEN=""],[#include <sys/types.h>
AC_SUBST(SA_LEN)
AC_SUBST(NO_SA_LEN)
#include <sys/socket.h>])
#
# Conditional import for Win32 and substitution
#
AM_CONDITIONAL(WIN32, $usewin32)
if $useunix; then
  WINNEEDED="--  "
fi
AC_SUBST(WINNEEDED)
#
# Output
#
AC_CONFIG_FILES([Makefile
           support/adacompiler
           src/Makefile
           src/sockets-link.ads
           src/adasockets-config
           src/sockets-types.ads
           man/Makefile
           examples/Makefile
           doc/Makefile])
AC_OUTPUT