This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfigure.ac
147 lines (147 loc) · 4.29 KB
/
configure.ac
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
AC_INIT([adasockets],[1.13])
AC_CONFIG_SRCDIR([src/sockets.ads])
AC_CONFIG_AUX_DIR([support])
AC_CONFIG_MACRO_DIR([support])
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE
#
# Package description
#
AC_ARG_WITH([libversioninfo],
[AS_HELP_STRING([--with-libversion=VSN],
[Shared Object version for relocatable library [1:0:0]])],
[LIBVERSIONINFO=$withval],
[LIBVERSIONINFO=1:0:0])
AC_SUBST(LIBVERSIONINFO)
#
AC_ARG_WITH([adasrcinstalldir],
[AS_HELP_STRING([--with-adasrcinstalldir=DIR],
[Ada sources go under DIR/adasockets [LIBDIR]])],
[ada_src_install_dir=$withval],
[ada_src_install_dir='${libdir}'])
AC_SUBST(ada_src_install_dir)
#
AC_ARG_WITH([aliinstalldir],
[AS_HELP_STRING([--with-aliinstalldir=DIR],
[Ada Lib Info go under DIR/adasockets [LIBDIR]])],
[ali_install_dir=$withval],
[ali_install_dir='${libdir}'])
AC_SUBST(ali_install_dir)
#
AC_ARG_WITH([gprinstalldir],
[AS_HELP_STRING([--with-gprinstalldir=DIR],
[GPRBuild project goes under DIR [DATADIR/gpr]])],
[gpr_install_dir=$withval],
[gpr_install_dir='${datadir}/gpr'])
AC_SUBST(gpr_install_dir)
#
LT_INIT
#
AC_CHECK_PROGS(AWK, [gnuawk gawk awk])
#
# Check for maintainer mode
#
AC_ARG_VAR(ADAFLAGS,[Ada compiler flags])
AC_ARG_ENABLE(maintainer-mode,
AS_HELP_STRING(--enable-maintainer-mode,turn on debugging options),
[ADAFLAGS="-g -O2 -Wall -Werror -gnatag -gnatwa -gnatwe -gnatg $ADAFLAGS"],
[ADAFLAGS="-O2 -gnatpng $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)
#
# 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
#
LT_INIT
#
# 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 linux/sockios.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
src/Makefile
src/sockets-link.ads
src/sockets-types.ads
src/adasockets.pc
man/Makefile
examples/Makefile
doc/Makefile
tests/Makefile])
AC_OUTPUT