File: configure.in

package info (click to toggle)
xt-toolbuslib 0.5.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 516 kB
  • ctags: 831
  • sloc: ansic: 5,255; sh: 361; makefile: 89
file content (101 lines) | stat: -rw-r--r-- 3,091 bytes parent folder | download | duplicates (2)
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
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(toolbuslib, 0.5.1)
AC_PREREQ(2.13)

ACLOCAL="${ACLOCAL} -I ."

dnl Which compiler to use?
dnl AC_REQUIRE([AC_PROG_CC])
AC_PROG_CC

dnl Handle --with-cflags option
AC_ARG_WITH(cflags,
   [  --with-cflags=CFLAGS    standard options of c compiler],
   CFLAGS=${withval},
   if test "a${GCC}" = "ayes"; then
     CFLAGS="-Wall -g -O2"
   fi;
)
AC_SUBST(CFLAGS)

AC_PROG_RANLIB
AR=ar
AC_SUBST(AR)

AC_AIX

AC_SET_MAKE

dnl Require ATerm library
AC_PACKAGE_REQUIRE(aterm, baffle,
   [  --with-aterm=DIR        ATerm-library is in DIR])
AC_SUBST(ATERM)

dnl Which additional adapters to build?


AC_HEADER_CHECK(arpa/inet.h,:, AC_MSG_ERROR("*** no arpa/inet.h"))
AC_HEADER_CHECK(assert.h,:, AC_MSG_ERROR("*** no assert.h"))
AC_HEADER_CHECK(ctype.h,:, AC_MSG_ERROR("*** no ctype.h"))
AC_HEADER_CHECK(errno.h,:, AC_MSG_ERROR("*** no errno.h"))
AC_HEADER_CHECK(netdb.h,:, AC_MSG_ERROR("*** no netdb.h"))
AC_HEADER_CHECK(netinet/in.h,:, AC_MSG_ERROR("*** no netinet/in.h"))

dnl Due to  bug in IRIX6.5 you can't merely include netinet/tcp.h, but
dnl you need to include standards.h aswell.
AC_MSG_CHECKING("for netinet/tcp.h")
AC_TRY_CPP(
[#ifdef sgi
#include <standards.h>
#endif
#include <netinet/tcp.h>
],AC_MSG_RESULT("yes"), AC_MSG_ERROR("*** no netinet/tcp.h"))

AC_HEADER_CHECK(stdarg.h,:, AC_MSG_ERROR("*** no stdarg.h"))
AC_HEADER_CHECK(stdio.h,:, AC_MSG_ERROR("*** no stdio.h"))
AC_HEADER_CHECK(stdlib.h,:, AC_MSG_ERROR("*** no stdlib.h"))
AC_HEADER_CHECK(string.h,:, AC_MSG_ERROR("*** no string.h"))

AC_HEADER_CHECK(fcntl.h,:, AC_MSG_ERROR("*** no fcntl.h"))
AC_HEADER_CHECK(sys/ioctl.h,:, AC_MSG_ERROR("*** no sys/ioctl.h"))
AC_HEADER_CHECK(sys/param.h,:, AC_MSG_ERROR("*** no sys/param.h"))
AC_HEADER_CHECK(sys/socket.h,:, AC_MSG_ERROR("*** no sys/socket.h"))
AC_HEADER_CHECK(sys/stat.h,:, AC_MSG_ERROR("*** no sys/stat.h"))
AC_HEADER_CHECK(sys/time.h,:, AC_MSG_ERROR("*** no sys/time.h"))
AC_HEADER_CHECK(sys/types.h,:, AC_MSG_ERROR("*** no sys/types.h"))
AC_HEADER_CHECK(sys/un.h,:, AC_MSG_ERROR("*** no sys/un.h"))
AC_HEADER_CHECK(unistd.h,:, AC_MSG_ERROR("*** no unistd.h"))
AC_HEADER_CHECK(math.h,:, AC_MSG_ERROR("*** no math.h"))

AC_HAVE_FUNCS(strerror)
AC_HAVE_FUNCS(strdup)

dnl Find out which libraries we need

SOCKET_FOUND=no
AC_CHECK_LIB(sun,socket,[SOCKET_FOUND=yes;LIBS="$LIBS -lsun"])
if test ${SOCKET_FOUND} = no; then
   AC_CHECK_LIB(socket, socket,[SOCKET_FOUND=yes;LIBS="$LIBS -lsocket"])
   if test ${SOCKET_FOUND} = no; then
      AC_CHECK_LIB(bsd,
                   socket,
                   [SOCKET_FOUND=yes;LIBS="$LIBS -lbsd";DEFS="$DEFS -D_BSD=43"])
   fi
fi

GETHOSTNAME_FOUND=no
AC_CHECK_LIB(sun,gethostname,[GETHOSTNAME_FOUND=yes])
if test ${GETHOSTNAME_FOUND} = no; then
   AC_CHECK_LIB(nsl,gethostname,[GETHOSTNAME_FOUND=yes;LIBS="$LIBS -lnsl"])
fi

# Check for math lib (-lm), use arbitrary function (atof) from
# C library, since using, e.g., sin leads to compilation errors
AC_CHECK_LIB(m,atof,[LIBS="$LIBS -lm"])

dnl add outputfiles as argument below
AC_OUTPUT(
  Makefile
  libtb/Makefile
  aterm/Makefile
)