clean-up extra " in d/copyright
[debian/cdck.git] / configure.ac
1 dnl $RCSfile: configure.ac,v $
2 dnl $Author: swaj $
3 dnl $Revision: 1.9 $  
4
5 AC_INIT
6 AC_CANONICAL_SYSTEM
7 AM_INIT_AUTOMAKE(cdck, 0.7.0)
8
9 S_CFLAGS=${CFLAGS}
10
11 AM_SANITY_CHECK
12 AC_PROG_INSTALL
13 AC_ISC_POSIX
14 AC_PROG_CC
15 AC_PROG_CXX
16
17 AC_SYS_LARGEFILE
18
19 AC_DISABLE_SHARED
20 AM_PROG_LIBTOOL
21 AC_SUBST(LIBTOOL_DEPS)
22
23 LT_RELEASE=$VERSION
24 LT_CURRENT=1
25 LT_REVISION=1
26 LT_AGE=1
27
28 AC_SUBST(LT_RELEASE)
29 AC_SUBST(LT_CURRENT)
30 AC_SUBST(LT_REVISION)
31 AC_SUBST(LT_AGE)
32
33 dnl Check how echo works in this /bin/sh
34 case `echo -n` in
35 -n)     _echo_n=   _echo_c='\c';;
36 *)      _echo_n=-n _echo_c=;;
37 esac
38
39 echo $_echo_n "checking perl version ... $_echo_c"
40 (perl -version 2> /dev/null | grep 'perl' > /dev/null 2>&1) || {
41         echo "not found"
42         echo "*** You must have perl version 5 or higher to compile $PACKAGE."
43         echo "*** (available at ftp://ftp.perl.org/pub/CPAN/src/stable.tar.gz)"
44         exit 1  
45 }
46 echo "ok"
47
48 test "$prefix" = "NONE" && prefix='/usr/local'
49
50 echo $_echo_n "checking version of ${CC} ... $_echo_c"
51 exec 15> ./.gcc.test
52 cat >&15 <<EOF
53 ${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 (\$_ gt 300); exit -1'
54 EOF
55 sh ./.gcc.test 2>/dev/null
56 if test $? -ne 0 ; then
57 echo " - old version, at least 3.0.0 required!" ; exit 1
58 AC_DEFINE(OLD_GNUC, 1, "gcc version")
59 else
60 echo " - ok, good enough"
61 fi
62 rm -f ./.gcc.test
63
64 AC_STDC_HEADERS
65
66 AM_CONFIG_HEADER(src/config.h)
67 AC_PREFIX_DEFAULT(/usr/local)
68
69
70 AC_ARG_WITH(debug,
71 [  --with-debug            Compile with '-g -O0' and enable global DEBUG ],
72 [  with_debug=$withval; ],
73 [  with_debug=no;       ])
74 if test x$with_debug = xyes; then
75    AC_DEFINE(DEBUG, 1, "debugging")
76    ARG_CFLAGS="-g -O0 -Wall"
77 else
78    ARG_CFLAGS="-O2 -Wall"
79 fi
80
81 AC_ARG_WITH(debug-libcdck,
82 [  --with-debug-libcdck    Compile with DEBUG_LIBCDCK ],
83 [  with_debug_libscdck=$withval; ],
84 [  with_debug_libscdck=no;       ])
85 if test x$with_debug_libcdck = xyes; then
86    AC_DEFINE(DEBUG_LIBCDCK, 1, "libcdck debugging")
87 fi
88
89 test "x${S_CFLAGS}" = "x" && CFLAGS=${ARG_CFLAGS}
90
91 if test x$GCC = xyes; then
92    CFLAGS="$CFLAGS -Wall"
93 fi
94
95 if test x$GXX = xyes; then
96    CXXFLAGS="$CXXFLAGS -Wall -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti -export-dynamic "
97 fi
98
99 SUPCXX=`gcc -print-file-name=libsupc++.a`
100
101 LIBS="$SUPCXX $LIBS"
102
103 AC_ISC_POSIX
104 AC_HEADER_STDC
105
106 AC_CHECK_HEADERS(stdio.h)
107
108 AC_SUBST(CPPFLAGS)
109 AC_SUBST(LDFLAGS)
110 AC_SUBST(CFLAGS)
111
112 AC_CONFIG_FILES([ Makefile src/Makefile man/Makefile ])
113 AC_OUTPUT
114
115
116
117 dnl
118 dnl __END__
119 dnl