File: configure.in

package info (click to toggle)
git 4.3.20-7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,368 kB
  • ctags: 3,563
  • sloc: ansic: 22,937; sh: 5,024; makefile: 221
file content (415 lines) | stat: -rw-r--r-- 11,045 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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
dnl

dnl ###########################################################################
dnl # 	          Autoconf input file for GNU Interactive Tools	              #
dnl #         Copyright (C) 1993-1999 Free Software Foundation, Inc.	      #
dnl ###########################################################################


dnl Initialize the autoconf & automake stuff.
AC_REVISION($Revision: 1.7 $)
AC_INIT(git,4.3.20)
PRODUCT="GNU Interactive Tools"
AM_INIT_AUTOMAKE
AC_GNU_SOURCE
AC_PROG_MAKE_SET
AM_SANITY_CHECK
AC_CONFIG_HEADERS(config.h)
dnl AC_CONFIG_AUX_DIR
AC_PREREQ(2.59)
AC_PROG_INSTALL
AC_CANONICAL_HOST
AC_PROG_CC
gl_EARLY	
AC_PROG_RANLIB
AC_REQUIRE_CPP
HOST=$host

dnl turn off makefile rules for regenerating autotools stuff
AM_MAINTAINER_MODE
	
dnl Check the command line arguments.
AC_ARG_WITH(terminfo,
	[  --with-terminfo         use terminfo instead of termcap],
	TERMINFO="$withval",
	TERMINFO=no)

dnl Check for SMP compilation.
AC_ARG_ENABLE(smp,
	[  --enable-smp            enable parallel compilation (Linux only)],
	SMP="$enableval",
	SMP=no)

dnl Check the system type.  We are especially looking for Linux.
MAKE="make"
if test "$host_os" = "linux-gnu"; then
    AC_DEFINE(HAVE_LINUX)

    if test "$SMP" = "yes"; then
	AC_MSG_CHECKING([for Linux SMP machine])
	AC_CACHE_VAL(ac_cv_processors,
		ac_cv_processors="1"
		if test -f /proc/cpuinfo; then
		    ac_cv_processors=`cat /proc/cpuinfo|grep processor|\
				wc -l|sed 's/ //g'`
		fi)
	if test "$ac_cv_processors" -ge 2; then
	    AC_MSG_RESULT($ac_cv_processors processors)
	    MAKE="make -j`expr $ac_cv_processors + 1`"
	else
	    AC_MSG_RESULT($ac_cv_processors processor)
	fi
    fi
fi

AC_ARG_ENABLE(gcc-warnings,
	[  --enable-gcc-warnings   more gcc warnings for debugging purposes],
	GCC_WARNINGS="$enableval",
	GCC_WARNINGS=no)

AC_ARG_ENABLE(efence,
	[  --enable-efence         link against the Electric Fence library],
	EFENCE="$enableval",
	EFENCE=no)

dnl Increase the warnings level if using GNU C.
if test "$CC" = "gcc"; then
    AC_DEFINE(HAVE_GCC)
    if test "$GCC_WARNINGS" = "yes"; then
	CFLAGS="$CFLAGS -W -Wall -ansi \
-Waggregate-return -Wbad-function-cast -fstrict-aliasing \
-Wtraditional -Winline -Wpointer-arith -Wcast-qual"
    else
	AC_DEFINE(NDEBUG)
    fi
else
    AC_DEFINE(NDEBUG)
fi

dnl Use the Electric Fence library for debugging purposes.
if test "$EFENCE" = "yes"; then
    LIBS="$LIBS -lefence"
fi

dnl Check for some UNIX variants.  These ones need special treatement
dnl due to exceptional oddities in their header files or libraries.
AC_AIX
AC_ISC_POSIX
AC_MINIX
AC_CHECK_LIB(sun, getpwnam)

# gnulib stuff
gl_INIT
AC_FUNC_ALLOCA
gl_FSUSAGE
gl_GETOPT
gl_FUNC_FNMATCH_GNU
gl_FUNC_ALLOCA
gl_EXITFAIL
dnl AM_GNU_GETTEXT([external])
gl_QUOTE
gl_QUOTEARG
gl_SAFE_READ
gl_SAFE_WRITE
gl_XALLOC
gl_XSTRTOUMAX

dnl Check for standard C header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h stdlib.h string.h memory.h values.h)

dnl Check for system dependent header files.
AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/vfs.h sys/filsys.h fcntl.h)
AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h sys/sioctl.h stddef.h)

dnl Unisys has a broken sys/filsys.h.  We don't want to include it,
dnl considering the fact that other methods are available.
AC_MSG_CHECKING([for broken sys/filsys.h])
AC_CACHE_VAL(ac_cv_broken_sys_filsys_h,
    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#ifdef HAVE_SYS_FILSYS_H
#include <sys/filsys.h>
#endif]], [[{}]])],[ac_cv_broken_sys_filsys_h=no],[ac_cv_broken_sys_filsys_h=yes])])
AC_MSG_RESULT($ac_cv_broken_sys_filsys_h)
if test $ac_cv_broken_sys_filsys_h = yes; then
   AC_DEFINE(BROKEN_SYS_FILSYS_H)
fi	

	
dnl Check for system specific directory functions declarations.
AC_HEADER_DIRENT

dnl Check whether the C compiler do support the 'const' keyword.
AC_C_CONST

dnl Check for predefined C types.  Fix them if necessary...
AC_TYPE_SIGNAL
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UID_T

dnl Check how to include time.h and sys/time.h.
AC_CHECK_HEADERS(sys/time.h)
AC_HEADER_TIME

dnl Check whether the system supports long file names.  GIT will issue
dnl a warning at run time if long file names are not supported.  Really!?
AC_SYS_LONG_FILE_NAMES

dnl Check the sys/stat.h macros.
AC_HEADER_STAT

dnl Check for a POSIX.1 compatible sys/wait.h.
AC_HEADER_SYS_WAIT

dnl Check for the existence of various functions.
AC_CHECK_FUNCS(lstat sigaction strerror strcasecmp strncasecmp strstr\
	       memmove putenv setenv getcwd rename readlink)


dnl If the GNU readline library is installed on the system, we will use
dnl its tilde_expand() and history functions.  Otherwise, we have to use
dnl the versions of tilde.c and history.c included in the package.  These
dnl files belong to the GNU readline library version 2.0.1.

AC_CHECK_LIB(readline, tilde_expand)
AC_CHECK_FUNC(tilde_expand,,[AC_LIBOBJ(tilde)])
AC_CHECK_FUNC(using_history,,[AC_LIBOBJ(history)])

dnl Check for compilers that do not support constructs combinations
dnl of ANSI C like prototypes & K&R definitions.  B.O.S. systems.
AC_MSG_CHECKING([for dumb C compiler])

AC_CACHE_VAL(git_cv_dumb_cc,
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[void tst(char);
	 void tst(i)
	     char i;
	 {}]], [[{
	    tst('A');
	}]])],[git_cv_dumb_cc=no],[git_cv_dumb_cc=yes])
)

if test "$git_cv_dumb_cc" = "yes"; then
    AC_DEFINE(HAVE_DUMB_CC)
fi

AC_MSG_RESULT([$git_cv_dumb_cc])

dnl Check if struct utsname is available.
AC_MSG_CHECKING([for struct utsname])

AC_CACHE_VAL(git_cv_struct_utsname,
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/utsname.h>]], [[{
	    char *ptr;
	    struct utsname u;

	    uname(&u);
	    ptr = u.nodename;
	    ptr = u.sysname;
	    ptr = u.machine;
	}]])],[git_cv_struct_utsname=yes],[git_cv_struct_utsname=no])
)

if test "$git_cv_struct_utsname" = "yes"; then
    AC_DEFINE(HAVE_UTSNAME)
fi

AC_MSG_RESULT([$git_cv_struct_utsname])

dnl Check for POSIX compatible terminal interface.
AC_MSG_CHECKING([for POSIX compatible terminal interface])

AC_CACHE_VAL(git_cv_sys_posix_tty,
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <termios.h>]], [[{
	    struct termios term;

	    tcgetattr(0, &term);
	}]])],[git_cv_sys_posix_tty=yes],[git_cv_sys_posix_tty=no])
)

if test "$git_cv_sys_posix_tty" = "yes"; then
    AC_DEFINE(HAVE_POSIX_TTY)
fi

AC_MSG_RESULT([$git_cv_sys_posix_tty])

dnl Check for System V compatible terminal interface.
AC_MSG_CHECKING([for System V compatible terminal interface])

AC_CACHE_VAL(git_cv_sys_systemv_tty,
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <termio.h>]], [[{
	    struct termio term;

	    ioctl(0, TCGETA, &term);
	}]])],[git_cv_sys_systemv_tty=yes],[git_cv_sys_systemv_tty=no])
)

if test "$git_cv_sys_systemv_tty" = "yes"; then
    AC_DEFINE(HAVE_SYSTEMV_TTY)
fi

AC_MSG_RESULT([$git_cv_sys_systemv_tty])

dnl Check for BSD compatible terminal interface.
AC_MSG_CHECKING([for BSD compatible terminal interface])

AC_CACHE_VAL(git_cv_sys_bsd_tty,
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sgtty.h>]], [[{
	    struct sgttyb arg;
	    struct tchars targ;
	    struct ltchars ltarg;

	    ioctl(0, TIOCGETP,&arg);
	    ioctl(0, TIOCGETC,&targ);
	    ioctl(0, TIOCGLTC,&ltarg);
	}]])],[git_cv_sys_bsd_tty=yes],[git_cv_sys_bsd_tty=no
    ])
)

if test "$git_cv_sys_bsd_tty" = "yes"; then
    AC_DEFINE(HAVE_BSD_TTY)
fi

AC_MSG_RESULT([$git_cv_sys_bsd_tty])

dnl Check if ioctl(1, TIOCGWINSZ, &winsz) works.
AC_MSG_CHECKING([for struct winsz])

AC_CACHE_VAL(git_cv_struct_winsz,
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/ioctl.h>
#ifdef HAVE_POSIX_TTY
#include <termios.h>
#else
#ifdef HAVE_SYSTEMV_TTY
#include <termio.h>
#else
#include <sgtty.h>
#endif /* HAVE_SYSTEMV_TTY */
#endif /* HAVE_POSIX_TTY */
#if defined TIOCGSIZE && !defined TIOCGWINSZ
#define TIOCGWINSZ TIOCGSIZE
#endif]], [[{
	    struct winsize winsz;
	    ioctl(1, TIOCGWINSZ, &winsz);
	    winsz.ws_col = winsz.ws_row;
	}]])],[git_cv_struct_winsz=yes],[git_cv_struct_winsz=no])
)

if test "$git_cv_struct_winsz" = "yes"; then
    AC_DEFINE(HAVE_WINSZ)
fi

AC_MSG_RESULT([$git_cv_struct_winsz])

dnl Check the terminal capabilities library to use.
define(git_TERMINFO_LIBRARY,
[    AC_CHECK_LIB(ncurses, tgetent, AC_DEFINE(HAVE_LIBTERMINFO)
				 LIBS="$LIBS -lncurses"
				 TERMLIB_FOUND=yes,
	AC_CHECK_LIB(termlib, tgetent, AC_DEFINE(HAVE_LIBTERMINFO)
				    LIBS="$LIBS -ltermlib"
				    TERMLIB_FOUND=yes,
	    AC_CHECK_LIB(curses, tgetent, AC_DEFINE(HAVE_LIBTERMINFO)
				       LIBS="$LIBS -lcurses"
				       TERMLIB_FOUND=yes,
		AC_CHECK_LIB(tinfo, tgetent, AC_DEFINE(HAVE_LIBTERMINFO)
					  LIBS="$LIBS -ltinfo"
					  TERMLIB_FOUND=yes,
		    AC_CHECK_LIB(terminfo, tgetent, AC_DEFINE(HAVE_LIBTERMINFO)
						 LIBS="$LIBS -lterminfo"
						 TERMLIB_FOUND=yes,
			TERMLIB_FOUND=no
		    )
		)
	    )
	)
    )
]
)dnl

if test "$TERMINFO" = "yes"; then
    git_TERMINFO_LIBRARY
    if test "$TERMLIB_FOUND" = "no"; then
	AC_CHECK_LIB(termcap, tgetent,
		     AC_DEFINE(HAVE_LIBTERMCAP)
		     LIBS="$LIBS -ltermcap"
		     TERMLIB_FOUND="yes")
    fi
else
    AC_CHECK_LIB(termcap, tgetent,
		 AC_DEFINE(HAVE_LIBTERMCAP)
		 LIBS="$LIBS -ltermcap"
		 TERMLIB_FOUND="yes",
		 git_TERMINFO_LIBRARY)
fi

if test "$TERMLIB_FOUND" = "no"; then
    AC_MSG_ERROR([no library for handling terminal capabilities])
fi

dnl Check for the presence of the makeinfo utility.  If we can't find
dnl it, we can't build the info documentation.
AC_CHECK_PROG([MAKEINFO],[makeinfo],[makeinfo],[false])
if test "$MAKEINFO" = "false"; then
    AC_MSG_WARN(***** makeinfo utility not found *****)
fi

dnl Check for the presence of the texi2dvi utility.  If we can't find
dnl it, we can't build the dvi documentation.
AC_CHECK_PROG([TEXI2DVI],[texi2dvi],[texi2dvi],[false])
if test "$TEXI2DVI" = "false"; then
    AC_MSG_WARN(***** texi2dvi utility not found *****)
fi

dnl Check for the presence of the texi2html utility.  If we can't find
dnl it, we can't build the html documentation.
AC_CHECK_PROG([TEXI2HTML],[texi2html],[texi2html],[false])
if test "$TEXI2HTML" = "false"; then
    AC_MSG_WARN(***** texi2html utility not found *****)
fi

dnl According to Joachim Baumann, for Solaris 2.3 & Solaris 2.4 (at least)
dnl -lucb should be included after -ltermcap.  This hasn't been tested!
if test "$TERMINFO" = "no"; then
    if test "$host_os" = "solaris2.3" || test "$host_os" = "solaris2.4"; then
	AC_CHECK_LIB(ucb, tgetent, , , $LIBS)
    fi
fi

CLEANFILES="core tutu gogu *.out t tt mwatch.log mtrace.log"

dnl Make final variable substitutions.
AC_SUBST(PRODUCT)dnl
AC_SUBST(HOST)dnl
AC_SUBST(MAKE)dnl
AC_SUBST(INSTALL)dnl
AC_SUBST(INSTALL_PROGRAM)dnl
AC_SUBST(INSTALL_DATA)dnl
AC_SUBST(CFLAGS)dnl
AC_SUBST(CPP)dnl
AC_SUBST(DEFS)dnl
AC_SUBST(LIBS)dnl
AC_SUBST(LDFLAGS)dnl
dnl AC_SUBST(INCLUDES)dnl
AC_SUBST(CLEANFILES)dnl

dnl Generate the Makefiles.
AC_CONFIG_FILES([version.h
	  Makefile
	  src/Makefile
	  term/Makefile
	  term/.gitrc.common
	  doc/Makefile
	  lib/Makefile
	  git.spec
	  LSM])
AC_OUTPUT