File: configure.in

package info (click to toggle)
exuberant-ctags 1%3A1.7.5-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 388 kB
  • ctags: 494
  • sloc: ansic: 3,704; makefile: 132; sh: 33
file content (157 lines) | stat: -rw-r--r-- 3,977 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
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
148
149
150
151
152
153
154
155
156
157
dnl $Id: configure.in,v 4.1 1997/10/14 04:46:33 darren Exp $

dnl	Copyright (c) 1996-1997, Darren Hiebert
dnl
dnl	This source code is released for free distribution under the terms
dnl	of the GNU General Public License.

dnl	Process this file with autoconf to produce a configure script.

AC_INIT(ctags.h)
AC_CONFIG_HEADER(config.h)


dnl Define convenience macros
dnl -------------------------
dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
AC_DEFUN(CHECK_HEADER_DEFINE,
[
	AC_MSG_CHECKING("if $1 is defined in $2")
	AC_EGREP_CPP(yes,
[#include <$2>
#ifdef $1
  yes
#endif
], [
	AC_MSG_RESULT(yes)
	$3
], [
	AC_MSG_RESULT(no)
	$4
]) ])

dnl Checks for configuration options
dnl --------------------------------

AC_ARG_ENABLE(etags,
[  --disable-etags         disable the installation of links for etags],
    opt_etags=$enableval, opt_etags=yes)
if test "$opt_etags" = yes ;then
	install_targets="install-ctags install-etags"
	AC_MSG_RESULT("links for etags will be installed")
else
	install_targets="install-ctags"
	AC_MSG_RESULT("do not install links for etags")
fi
AC_SUBST(install_targets)

AC_ARG_ENABLE(internal-sort,
[  --enable-internal-sort  use interal sort algorithm instead of system sort],
    opt_internal_sort=$enableval, opt_internal_sort=no)


dnl Checks for programs
dnl -------------------

if test $opt_internal_sort = yes; then
	AC_MSG_RESULT("using internal sort")
else
    AC_CHECK_PROG(SORT, sort, found, [not found, using internal sort])
    if test "$SORT" = found; then
		AC_MSG_CHECKING(whether sort accepts our command line)
		touch /tmp/sort.test
		sort -u -o /tmp/sort.test /tmp/sort.test 1>/dev/null 2>&1
		if test $? -ne 0; then
			AC_MSG_RESULT([no, using internal sort])
		else
			AC_MSG_RESULT(yes)
			AC_PROG_AWK
			if test -z "$AWK"; then
				AC_MSG_RESULT([no awk found, using internal sort])
			else
				AC_DEFINE_UNQUOTED(AWK,"$AWK")
				AC_DEFINE(EXTERNAL_SORT)
				AC_MSG_RESULT(using external sort)
			fi
		fi
		rm -f /tmp/sort.test
    fi
fi

AC_PROG_CC
AC_PROG_LN_S


dnl Checks for typedefs, structures, and compiler characteristics
dnl -------------------------------------------------------------

AC_C_CONST
AC_TYPE_SIZE_T

AC_MSG_CHECKING("for clock_t")
AC_EGREP_HEADER(clock_t, time.h, AC_MSG_RESULT(yes),
[
	AC_MSG_RESULT(no)
	AC_DEFINE(clock_t, long)
])


dnl Checks for header files
dnl -----------------------

AC_CHECK_HEADERS(dirent.h stdlib.h time.h unistd.h)
AC_CHECK_HEADERS(sys/stat.h sys/times.h sys/types.h)


dnl Checks for header file macros
dnl -----------------------------

CHECK_HEADER_DEFINE(L_tmpnam, stdio.h,, AC_DEFINE(L_tmpnam, 20))
CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,, AC_DEFINE(SEEK_SET, 0))
CHECK_HEADER_DEFINE(SEEK_END, stdio.h,, AC_DEFINE(SEEK_END, 2))

CHECK_HEADER_DEFINE(INT_MAX, limits.h,,
	CHECK_HEADER_DEFINE(MAXINT, limits.h,
		AC_DEFINE(INT_MAX, MAXINT), AC_DEFINE(INT_MAX, 32767)))

dnl This check is for informational purposes only. It doesn't set anything.
CHECK_HEADER_DEFINE(PATH_MAX, limits.h,,
	CHECK_HEADER_DEFINE(MAXNAMLEN, dirent.h))


dnl Checks for library functions
dnl ----------------------------

AC_REPLACE_FUNCS(strstr)

AC_CHECK_FUNCS(strerror)
AC_CHECK_FUNCS(remove, have_remove=yes,
	CHECK_HEADER_DEFINE(remove, unistd.h,, AC_DEFINE(remove, unlink)))

AC_CHECK_FUNCS(truncate ftruncate chsize, break)
AC_CHECK_FUNCS(clock times, break)


dnl Checks for missing prototypes
dnl -----------------------------
AC_CHECKING("for missing prototypes")

AC_DEFUN(CHECK_PROTO, [AC_EGREP_HEADER([[ 	*]$1[ 	]*\(], $2,, AC_DEFINE(patsubst([NEED_PROTO_NAME], [NAME], translit($1, [a-z], [A-Z]))) AC_MSG_RESULT(adding prototype for $1))])

if test "$have_remove" = yes; then
	CHECK_PROTO(remove, stdio.h)
else
	CHECK_PROTO(unlink,	unistd.h)
fi
CHECK_PROTO(malloc,	stdlib.h)
CHECK_PROTO(getenv,	stdlib.h)
CHECK_PROTO(strstr,	string.h)
CHECK_PROTO(stat,	sys/stat.h)


dnl Output files
dnl ------------

AC_OUTPUT(Makefile)

dnl vim:ts=4:sw=4: