1 dnl $RCSfile: configure.ac,v $
7 AM_INIT_AUTOMAKE(cdck, 0.5.2)
21 AC_SUBST(LIBTOOL_DEPS)
33 dnl Check how echo works in this /bin/sh
35 -n) _echo_n= _echo_c='\c';;
36 *) _echo_n=-n _echo_c=;;
39 echo $_echo_n "checking perl version ... $_echo_c"
40 (perl -version 2> /dev/null | grep 'perl' > /dev/null 2>&1) || {
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)"
48 test "$prefix" = "NONE" && prefix='/usr/local'
50 echo $_echo_n "checking version of ${CC} ... $_echo_c"
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'
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")
60 echo " - ok, good enough"
66 AM_CONFIG_HEADER(src/config.h)
67 AC_PREFIX_DEFAULT(/usr/local)
71 [ --with-debug Compile with '-g -O0' and enable global DEBUG ],
72 [ with_debug=$withval; ],
74 if test x$with_debug = xyes; then
75 AC_DEFINE(DEBUG, 1, "debugging")
76 ARG_CFLAGS="-g -O0 -Wall"
78 ARG_CFLAGS="-O2 -Wall"
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")
89 test "x${S_CFLAGS}" = "x" && CFLAGS=${ARG_CFLAGS}
91 if test x$GCC = xyes; then
92 CFLAGS="$CFLAGS -Wall"
95 if test x$GXX = xyes; then
96 CXXFLAGS="$CXXFLAGS -Wall -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti -export-dynamic "
99 SUPCXX=`gcc -print-file-name=libsupc++.a`
106 AC_CHECK_HEADERS(stdio.h)
112 AC_CONFIG_FILES([ Makefile src/Makefile man/Makefile ])