File: configure.ac

package info (click to toggle)
cdck 0.7.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 320 kB
  • sloc: cpp: 901; ansic: 71; makefile: 39; sh: 5
file content (119 lines) | stat: -rw-r--r-- 2,505 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
dnl $RCSfile: configure.ac,v $
dnl $Author: swaj $
dnl $Revision: 1.9 $  

AC_INIT
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(cdck, 0.7.0)

S_CFLAGS=${CFLAGS}

AM_SANITY_CHECK
AC_PROG_INSTALL
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX

AC_SYS_LARGEFILE

AC_DISABLE_SHARED
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)

LT_RELEASE=$VERSION
LT_CURRENT=1
LT_REVISION=1
LT_AGE=1

AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

dnl Check how echo works in this /bin/sh
case `echo -n` in
-n)     _echo_n=   _echo_c='\c';;
*)      _echo_n=-n _echo_c=;;
esac

echo $_echo_n "checking perl version ... $_echo_c"
(perl -version 2> /dev/null | grep 'perl' > /dev/null 2>&1) || {
	echo "not found"
	echo "*** You must have perl version 5 or higher to compile $PACKAGE."
   	echo "*** (available at ftp://ftp.perl.org/pub/CPAN/src/stable.tar.gz)"
   	exit 1	
}
echo "ok"

test "$prefix" = "NONE" && prefix='/usr/local'

echo $_echo_n "checking version of ${CC} ... $_echo_c"
exec 15> ./.gcc.test
cat >&15 <<EOF
${CC} -v 2>&1 | perl -e '\$/=undef;\$_=<STDIN>;s/.*ver.+?([[0-9\.]]+).*//s;\$_=\$1;print; s/\.//sg;s/^.*?(\d{0,4}).*\$/\$1/; exit 0 if (\$_ >= 300); exit -1'
EOF
sh ./.gcc.test 2>/dev/null
if test $? -ne 0 ; then
echo " - old version, at least 3.0.0 required!" ; exit 1
AC_DEFINE(OLD_GNUC, 1, "gcc version")
else
echo " - ok, good enough"
fi
rm -f ./.gcc.test

AC_STDC_HEADERS

AM_CONFIG_HEADER(src/config.h)
AC_PREFIX_DEFAULT(/usr/local)


AC_ARG_WITH(debug,
[  --with-debug            Compile with '-g -O0' and enable global DEBUG ],
[  with_debug=$withval; ],
[  with_debug=no;       ])
if test x$with_debug = xyes; then
   AC_DEFINE(DEBUG, 1, "debugging")
   ARG_CFLAGS="-g -O0 -Wall"
else
   ARG_CFLAGS="-O2 -Wall"
fi

AC_ARG_WITH(debug-libcdck,
[  --with-debug-libcdck    Compile with DEBUG_LIBCDCK ],
[  with_debug_libscdck=$withval; ],
[  with_debug_libscdck=no;       ])
if test x$with_debug_libcdck = xyes; then
   AC_DEFINE(DEBUG_LIBCDCK, 1, "libcdck debugging")
fi

test "x${S_CFLAGS}" = "x" && CFLAGS=${ARG_CFLAGS}

if test x$GCC = xyes; then
   CFLAGS="$CFLAGS -Wall"
fi

if test x$GXX = xyes; then
   CXXFLAGS="$CXXFLAGS -Wall -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti -export-dynamic "
fi

SUPCXX=`$CC -print-file-name=libsupc++.a`

LIBS="$SUPCXX $LIBS"

AC_ISC_POSIX
AC_HEADER_STDC

AC_CHECK_HEADERS(stdio.h)

AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(CFLAGS)

AC_CONFIG_FILES([ Makefile src/Makefile man/Makefile ])
AC_OUTPUT



dnl
dnl __END__
dnl