File: configure.in

package info (click to toggle)
links 0.84-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,184 kB
  • ctags: 2,048
  • sloc: ansic: 16,116; sh: 395; makefile: 49; awk: 33
file content (87 lines) | stat: -rw-r--r-- 2,397 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(main.c)

AM_INIT_AUTOMAKE(links, 0.84)
AM_CONFIG_HEADER(config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_AWK

AC_MSG_CHECKING([for EMX])
AC_TRY_COMPILE(, [#ifndef __EMX__
kill me!
#endif ], have_emx=yes, have_emx=no)
AC_MSG_RESULT($have_emx)
test $have_emx = yes && LDFLAGS=`echo "$LDFLAGS" | sed "s/-Zexe//g"`

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h)
AC_CHECK_HEADERS(netinet/in_systm.h)
AC_CHECK_HEADERS(netinet/in_system.h)
AC_CHECK_HEADERS(netinet/ip.h)
AC_CHECK_HEADERS(sys/select.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM

dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_HAVE_FUNCS(gettimeofday mkdir select strcspn strerror strstr strtol strtoul alarm)

dnl Checks for libraries.
dnl Replace `main' with a function in -lgpm:
AC_CHECK_LIB(gpm, Gpm_Open)
dnl Replace `main' with a function in -lsocket:
AC_CHECK_FUNC(socket, cf_result=yes, cf_result=no)
if test $cf_result = no; then
	AC_CHECK_LIB(socket, socket)
fi

#AC_MSG_CHECKING([for gethostbyname])
#AC_TRY_LINK([#include <netdb.h>], [gethostbyname("")], cf_result=yes, cf_result=no)
#AC_MSG_RESULT($cf_result)
AC_CHECK_FUNC(gethostbyname, cf_result=yes, cf_result=no)
if test $cf_result = no; then
	AC_CHECK_LIB(socket, gethostbyname, cf_result=yes, cf_result=no)
	if test $cf_result = no; then
		AC_CHECK_LIB(nsl, gethostbyname)
	else
		test -z "`echo $LIBS | grep -- -lsocket`" && LIBS=$LIBS -lsocket
	fi
fi

AC_CHECK_FUNC(herror, AC_DEFINE(HAVE_HERROR))
AC_CHECK_FUNC(cfmakeraw, AC_DEFINE(HAVE_CFMAKERAW))

AC_MSG_CHECKING([for OS/2 threads])
CFLAGS_X=$CFLAGS
CFLAGS="$CFLAGS -Zmt"
AC_TRY_LINK([#include <stdlib.h>], [_beginthread(NULL, NULL, 0, NULL)], cf_result=yes, cf_result=no)
AC_MSG_RESULT($cf_result)
if test $cf_result = yes; then
	AC_DEFINE(HAVE_BEGINTHREAD)
	AC_CHECK_FUNC(MouOpen, AC_DEFINE(HAVE_MOUOPEN))
	AC_CHECK_FUNC(_read_kbd, AC_DEFINE(HAVE_READ_KBD))
else
	CFLAGS=$CFLAGS_X
fi

test $have_emx = yes && LDFLAGS="$LDFLAGS -Zexe"

AC_OUTPUT(Makefile)

#if test -z "$AWK"; then
#	AC_WARN([awk not found. You won't be able to rebuild code page table.]);
#fi