summaryrefslogtreecommitdiff
path: root/support/word2x/configure.in
blob: f1d2493930d6b3314991ecf05bbdd55c8c2bb230 (plain)
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
AC_REVISION($Id: configure.in,v 1.15 1997/04/17 15:59:03 dps Exp $)dnl
AC_INIT(word2x.cc)
AC_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL

dnl check for built in getopt_long, alloca and strftime
AC_FUNC_CHECK(getopt_long, getopt="", getopt=gopt.o)
AC_SUBST(getopt)
AC_FUNC_ALLOCA
AC_HEADER_TIME
AC_STRUCT_TM

dnl locate some symbols I want (why does SUN have to do this to me?)
dnl At least these is some hack value in this stuff.
AC_DEFUN(ac_FIND_HDR,
[AC_MSG_CHECKING([header file for $1])
AC_CACHE_VAL(ac_cv_hdrfile_$1,
[ac_cv_hdrfile_$1=""
for xhdr in $2; do
if test -z "${ac_cv_hdrfile_$1}"; then
AC_TRY_COMPILE([#include <stdio.h>
#include<${xhdr}>],[ if ($1==$1) printf("ok");],
[ac_cv_hdrfile_$1=${xhdr}])
fi
done
if test -z "${ac_cv_hdrfile_$1}"; then
AC_MSG_RESULT("not found")
AC_ERROR([Could not locate $1])
fi])
AC_MSG_RESULT(<${ac_cv_hdrfile_$1}>)
$3="${ac_cv_hdrfile_$1}"])dnl

dnl Quite why Sun OS puts SEEK_SET in unistd.h (and not in stdio.h)
dnl is a mystery!!
ac_FIND_HDR(SEEK_SET, stdio.h unistd.h, seek_hdr)

if test "${seek_hdr}" = "stdio.h"; then
	seek_set_hdr=""
else
	seek_set_hdr="--include /usr/include/${seek_hdr}"
fi
AC_SUBST(seek_set_hdr)
AC_STDC_HEADERS
AC_CHECK_HEADERS(ctype.h string.h strings.h time.h sys/time.h sys/stat.h unistd.h alloca.h)
AC_CHECK_FUNCS(strncasecmp strcasecmp strdup localtime fstat)
AC_CHECK_LIB(sun)

dnl on some systems ld and g++ are not compatible, so we have to kludge it
dnl using the sunos_link shell script instead
AC_CHECKING([if I know ld and ${ac_cv_prog_CXX} might not work together])
AC_CANONICAL_SYSTEM
case "$target" in
*-*-hpux*) ld=ld
	AC_MSG_RESULT(
[Using ld, as on ${target} I know ld and ${ac_cv_prog_CXX} mix])
	;;
*-*-linux*) ld=ld
	AC_MSG_RESULT(
[Using ld, as on ${target} I know ld and ${ac_cv_prog_CXX} mix])
	;;

*SPARC*-*-SUN*)	ld=./fake_link
	AC_MSG_RESULT(
[Using my ar and ranlib shell script since ${ac_cv_prog_CXX} and ld do not mix])
	;;

*)          ld=./fake_link
	AC_MSG_RESULT(
[Using my ar and ranlib shell script lest ${ac_cv_prog_CXX} and ld do not mix])
	;;
esac
AC_SUBST(ld)

AC_OUTPUT(Makefile)