1dnl -*-Mode: C; comment-start: "dnl "-*-
2dnl Process this file with autoconf to produce a configure script.
3AC_REVISION([configure.in,v 1.2 1998/10/03 00:17:50 jmacd Exp])dnl
4AC_INIT(xdelta.c)
5AM_CONFIG_HEADER(config.h)
6
7dnl $Format: "AM_INIT_AUTOMAKE(xdelta, $ReleaseVersion$, no-define)" $
8AM_INIT_AUTOMAKE(xdelta, 1.1.4, no-define)
9
10AM_MAINTAINER_MODE
11
12DEBUGFLAG=
13PROFILEFLAG=
14
15AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging [default=no]])
16AC_ARG_ENABLE(profile, [  --enable-profile        turn on profiling [default=no]])
17
18TMPCFLAGS="$CFLAGS"
19CFLAGS=
20
21AC_PROG_CC
22AC_PROG_CPP
23
24CFLAGS=$TMPCFLAGS
25
26changequote(,)dnl
27if test "x$GCC" = "xyes"; then
28  case " $CFLAGS " in
29  *[\ \	]-Wall[\ \	]*) ;;
30  *) CFLAGS="$CFLAGS -Wall" ;;
31  esac
32
33  if test "x$enable_debug" = "xyes"; then
34    DEBUGFLAG="-g"
35  fi
36
37  if test "x$enable_profile" = "xyes"; then
38    PROFILEFLAG="-pg"
39  fi
40
41  if test -n "$DEBUGFLAG"; then
42    case " $CFLAGS " in
43    *[\ \	]$DEBUGFLAG[\ \	]*) ;;
44    *) CFLAGS="$DEBUGFLAG $CFLAGS" ;;
45    esac
46  else
47    case " $CFLAGS " in
48    *[\ \	]-O[0-9\ \	]*) ;;
49    *) CFLAGS="$CFLAGS -O3" ;;
50    esac
51  fi
52
53  if test -n "$PROFILEFLAG"; then
54    case " $CFLAGS " in
55    *[\ \	]$PROFILEFLAG[\ \	]*) ;;
56    *) CFLAGS="$PROFILEFLAG $CFLAGS" ;;
57    esac
58  fi
59fi
60changequote([,])dnl
61
62AM_PROG_LIBTOOL
63AC_HEADER_STDC
64AC_PROG_MAKE_SET
65
66AC_CHECK_FUNCS(gettimeofday)
67AC_HEADER_TIME
68
69AC_PATH_PROGS(EMACS, emacs xemacs, emacs)
70
71top_srcdir_absolute=`cd $srcdir; pwd`
72AC_SUBST(top_srcdir_absolute)
73
74AM_PATH_GLIB(1.2.8,,
75  AC_MSG_ERROR(Test for GLIB failed. Download it from ftp://ftp.gtk.org/pub/gtk/v1.2/))
76
77dnl AC_CHECK_LIB(z, gzsetparams, */
78dnl   AC_CHECK_HEADER(zlib.h,, */
79dnl     AC_MSG_ERROR(ZLIB headers not found)), */
80dnl   AC_MSG_ERROR(ZLIB library not found)) */
81
82AC_OUTPUT(Makefile
83	  doc/Makefile
84          test/Makefile
85          djgpp/Makefile
86	  xdelta-config
87	  libedsio/Makefile
88	  libedsio/edsio-comp,
89
90	  chmod +x libedsio/edsio-comp xdelta-config
91	  )
92