1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(lib/765fdc.c)
3AC_CONFIG_AUX_DIR(config)
4VERSION=0.4.2
5UPDATED='12 January 2009'
6AM_INIT_AUTOMAKE(lib765, $VERSION)
7AM_CONFIG_HEADER(config.h)
8
9dnl Put this before tinkering with the CFLAGS.
10AC_PROG_CC
11
12LDSKPATH=
13dnl Enable / disable dependence on LibDsk
14AC_ARG_WITH(libdsk,
15[  --with-libdsk           Use LibDsk for all disc access [default=yes]],
16              , with_libdsk=yes)
17AC_ARG_WITH(libdsk-path,
18[  --with-libdsk-path=PATH Path to LibDsk installation [default=none]],
19            [LDSKPATH=$withval], [LDSKPATH= ] )
20
21
22if test x$with_libdsk = xyes; then
23    CFLAGS="$CFLAGS -DENABLE_LIBDSK"
24fi
25
26if test ! x$LDSKPATH = x; then
27    CPPFLAGS="$CPPFLAGS -I$LDSKPATH/include"
28    LDFLAGS="$LDFLAGS -L$LDSKPATH/lib"
29fi
30
31dnl Checks for programs.
32AC_PROG_INSTALL
33AC_PROG_RANLIB
34AC_PROG_MAKE_SET
35AM_PROG_LIBTOOL
36
37dnl GCC extra options
38if test "$ac_cv_prog_gcc" = "yes"; then
39  CFLAGS="-Wall $CFLAGS"
40fi
41
42dnl Checks for header files.
43AC_HEADER_STDC
44AC_CHECK_HEADERS(errno.h sys/ioctl.h sys/stat.h unistd.h fcntl.h)
45if test x$with_libdsk = xyes; then
46  AC_CHECK_HEADERS(libdsk.h)
47fi
48dnl Checks for functions
49AC_CHECK_FUNCS(strcmpi stricmp strcasecmp, break)
50
51dnl Checks for libraries.
52if test x$with_libdsk = xyes; then
53  AC_CHECK_LIB(dsk, dsk_open)
54fi
55
56dnl Checks for typedefs, structures, and compiler characteristics.
57AC_C_CONST
58AC_TYPE_SIZE_T
59AC_EXEEXT
60AC_OBJEXT
61
62dnl Checks for library functions.
63AC_PROG_GCC_TRADITIONAL
64AC_HEADER_MAJOR
65AC_FUNC_MEMCMP
66AC_CHECK_FUNCS(strerror)
67
68AC_OUTPUT(Makefile include/Makefile lib/Makefile)
69