File: configure.in

package info (click to toggle)
freesweep 0.88-4.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 404 kB
  • ctags: 267
  • sloc: ansic: 3,813; sh: 2,460; makefile: 112
file content (135 lines) | stat: -rw-r--r-- 4,320 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
dnl
dnl $Id: configure.in,v 1.41 2000/10/31 02:51:17 hartmann Exp $
dnl

dnl Process this file with autoconf to produce a configure script.
AC_INIT(sweep.h.in)dnl
AC_CONFIG_HEADER(config.h)dnl

dnl Find out where we're building
AC_CANONICAL_HOST

dnl Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PATH_PROG(TAR, tar)dnl
AC_PATH_PROG(GZIP, gzip)dnl
AC_PATH_PROG(RM, rm)dnl

dnl Set the prefsdir to something
AC_ARG_WITH(prefsdir, [  --with-prefsdir=DIR    put the shared best time file in DIR [/usr/local/share]], PREFSDIR=$with_prefsdir, PREFSDIR='/usr/local/share')dnl
AC_SUBST(PREFSDIR)dnl

dnl Set the scoresdir to something
dnl AC_ARG_WITH(scoresdir, [  --with-scoresdir=DIR    put the shared best time file in DIR [/usr/local/share]], SCORESDIR=$with_scoresdir, SCORESDIR='/usr/local/share')dnl
AC_ARG_WITH(scoresdir, [  --with-scoresdir=DIR    put the shared best time file in DIR [/usr/local/share]], SCORESDIR=$with_scoresdir)dnl
AC_SUBST(SCORESDIR)dnl
if test X$SCORESDIR != X ; then
	AC_DEFINE_UNQUOTED(SCORESDIR, $SCORESDIR)dnl
fi

dnl Look for ncurses in a variable.
AC_ARG_WITH(ncurses, [  --with-ncurses[=DIR]    ncurses package root in DIR [/usr/local]], NCURSES_HINT=$with_ncurses, NCURSES_HINT='default')dnl
AC_SUBST(NCURSES_HINT)dnl

dnl Check for debugging file
AC_ARG_ENABLE(debug-log,
[  --enable-debug-log      Enables debugging file, debug.log.], DEBUG_LOG=$with_debug)
if test "$DEBUG_LOG" = 'yes' ; then
	AC_DEFINE(DEBUG_LOG)dnl
fi

dnl Checks for libraries.
dnl look for ncurses in the suggested location, if given.
if test "$NCURSES_HINT" = 'no' ; then
	AC_CHECK_LIB(curses,main)dnl
	if test "$ac_cv_lib_curses_main" = 'no' ; then
		AC_MSG_ERROR([No curses library was found. Consider installing
ncurses, from ftp://ftp.gnu.org/pub/ncurses/])dnl
	fi
else
	if test "$NCURSES_HINT" = 'yes' || test "$NCURSES_HINT" = 'default' ; then

		dnl Linux uses ncurses, but not in /usr/local
		if test "$host_os" = 'linux' || test "$host_os" = 'linux-gnu' || test "$host_os" = 'gnu0.2'; then
			NCURSES_HINT='/usr'
		else
			dnl Set NCURSES_HINT to /usr/local, which is it's default.
			NCURSES_HINT='/usr/local'
		fi
	fi

	CFLAGS="-I$NCURSES_HINT/include $CFLAGS"
	AC_SUBST(NCURSES_HINT)dnl

	dnl Look in $NCURSES_HINT/lib for libraries
	LIBS="-L$NCURSES_HINT/lib $LIBS"

	dnl Replace `main' with a function in -lncurses:
	AC_CHECK_LIB(ncurses,main)dnl

	if test "$ac_cv_lib_ncurses_main" = 'no' ; then
		AC_CHECK_LIB(curses,main)dnl
		if test "$ac_cv_lib_curses_main" = 'no' ; then
			AC_MSG_ERROR([No curses library was found. Consider installing
ncurses, from ftp://ftp.gnu.org/pub/ncurses])dnl
		fi
	fi
fi

dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m,main)dnl

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h string.h unistd.h sys/file.h getopt.h errno.h sys/types.h)dnl

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

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(strdup memset memmove fileno lockf flock get_current_dir_name)dnl

# Look for lesser but similar functions.
AC_DEFUN([AC_FUNC_SNPRINTF],
[AC_CACHE_CHECK(for working snprintf, ac_cv_func_snprintf,
[AC_TRY_RUN([#include <stdio.h>
int main () { exit (!(3 <= snprintf(NULL,0,"%d",100))); }
], ac_cv_func_snprintf=yes, ac_cv_func_snprintf=no,
ac_cv_func_snprintf=no)])
if test $ac_cv_func_snprintf = yes; then
  AC_DEFINE(HAVE_SNPRINTF)
  fi
  ])

AC_CHECK_FUNCS(snprintf)dnl
if test "${ac_cv_func_snprintf}" = 'no' ; then
	AC_MSG_WARN([Consider getting a system with snprintf.])
	AC_CHECK_FUNCS(sprintf)dnl
fi

AC_CHECK_FUNCS(vsnprintf)dnl
if test "${ac_cv_func_vsnprintf}" = 'no' ; then
	AC_MSG_WARN([Consider getting a system with vsnprintf.])
	AC_CHECK_FUNCS(vsprintf)dnl
fi

AC_CHECK_FUNCS(getopt_long)dnl
if test "${ac_cv_func_getopt_long}" = 'no' ; then
	AC_MSG_WARN([Consider getting a system with getopt_long.])
	AC_CHECK_FUNCS(getopt)dnl
fi

dnl If neither locking mechanism is there, disable group scores.
if test "${with_scoresdir}" != '' ; then
	if test "${ac_cv_func_flock}" = 'no' && test "${ac_cv_func_lockf}" = 'no' ; then
		AC_MSG_WARN([Neither lockf nor flock was found. Best times files will be risky.])dnl
	else
		AC_DEFINE(USE_GROUP_BEST_FILE)dnl
	fi
fi

AC_OUTPUT(Makefile sweep.h freesweep.6)dnl