File: configure.in

package info (click to toggle)
opt 3.9-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 784 kB
  • ctags: 506
  • sloc: ansic: 3,205; sh: 440; tcl: 325; perl: 155; makefile: 92
file content (122 lines) | stat: -rw-r--r-- 3,232 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/ag.c)

dnl automake requires this
AM_INIT_AUTOMAKE(opt, 3.9)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB

dnl Checks for libraries.

dnl Checks for header files.  ..we don't actually use this, though
dnl AC_HEADER_STDC

dnl If system doesn't supply strdup, we'll supply our own
AC_CHECK_FUNCS(strdup)

testdir=test
AC_ARG_ENABLE(test,
	[  --disable-test          Quicker build],
        if test x$enableval = xno; then
           AC_MSG_RESULT([checking whether to build test routines ... no])
	   testdir="";
	else
	   testdir="test";
        fi;
)
AC_SUBST(testdir)

dnl Check for whether the menu can trap ^C
enablelongjmp=yes
AC_ARG_ENABLE(longjmp,
	[  --disable-longjmp       Prevent menu trapping],
        if test x$enableval = xno; then
           enablelongjmp=no;
           AC_MSG_RESULT([checking longjmp ... disabled])
           AC_DEFINE(HAVE_LONGJMP,0)
        fi;
)

if test x$enablelongjmp = xyes; then
           AC_CHECK_FUNCS(longjmp)
	   AC_CHECK_HEADER(signal.h,AC_DEFINE(HAVE_SIGNAL))
	   AC_TYPE_SIGNAL
fi;


dnl -----------------------------------------------
dnl Absurdly complicated check for readline library.
AC_ARG_WITH(readline,
	[  --with-readline         Compile in readline enhancements
  --with-readline=DIR     specifies where to find libreadline.a],
        if test x$with_readline = xno; then 
	   AC_MSG_RESULT([checking readline ... disabled])
           AC_DEFINE(HAVE_READLINE,0)
        else 
	liblist="/usr/local/lib /usr/lib /packages/lib $with_readline";
	xrlo=;
	AC_CHECK_LIB(readline,main,
		for d in $liblist; do f=$d/libreadline.a; \
		    if test -f $f; then readline_PATH=$f; fi; done;
		echo readline_PATH=$readline_PATH;
		if test -f $readline_PATH; then xrlo=`ar t $readline_PATH`; fi;
		for o in $xrlo; do if test $o != __.SYMDEF; then\
			xxrlo=`echo $xxrlo $o`; fi; done
		xrlo="$xxrlo"; echo "xrlo=$xrlo"
	)
	xtco=;
	AC_CHECK_LIB(termcap,main,
		for d in $liblist; do f=$d/libtermcap.a; \
		    if test -f $f; then termcap_PATH=$f; fi; done;
		echo termcap_PATH=$termcap_PATH;
		if test -f $termcap_PATH; then xtco=`ar t $termcap_PATH`; fi;
		for o in $xtco; do if test $o != __.SYMDEF; then\
			xxtco=`echo $xxtco $o`; fi; done
		xtco="$xxtco"; echo "xtco=$xtco"
	)
	dnl if either $xrlo or $xtco are empty, then both should be empty
	dnl if test -z "$xrlo" -o -z "$xtco"; then xrlo=; xtco=; fi
	AC_CHECK_HEADER(readline/readline.h,
	AC_CHECK_HEADER(readline/history.h,
		if test -n "$xrlo"; then
		AC_DEFINE(HAVE_READLINE)
		fi,
		xrlo=; xtco=;
	))
        fi;
)

AC_SUBST(xrlo)
AC_SUBST(readline_PATH)
AC_SUBST(xtco)
AC_SUBST(termcap_PATH)
dnl -----------------------------------------------

dnl permit user to specify flags as 0/1 instead of -/+
AC_ARG_ENABLE(flagonezero,
	[  --enable-flagonezero    Flags turned on/off with 1/0 rather than +/-],
        if test x$enableval = xyes; then 
	   AC_DEFINE(FLAG_ZERO_ONE)
        fi
)

CXX=g++
AC_SUBST(CXX)


dnl I would really rather use config.h, but this isn't working right!
dnl AM_CONFIG_HEADER(config.h)

AC_OUTPUT(test/Makefile src/Makefile ext/Makefile Makefile makeRPM opt-RPM.spec)