1 dnl Hey emacs -*- mode: m4 -*- thanks
2 dnl Process this file with autoconf to create a configure script
3 AC_INIT([wmfsm], [0.36], [wmaker-dev@googlegroups.com])
4 AC_CONFIG_SRCDIR([wmfsm/wmfsm.c])
7 AM_CONFIG_HEADER(config.h)
15 dnl Checks for libraries
17 X11LIBS="-L$x_libraries -I$x_includes -lX11 -lXpm -lXext -ldockapp"
19 AC_MSG_CHECKING([to see if we can use X])
20 AC_TRY_LINK([#include <X11/Xlib.h>],,AC_MSG_RESULT([yes]),AC_MSG_RESULT([no]); exit 1)
22 dnl Checks how to call statfs
23 AC_MSG_CHECKING([how to call statfs])
24 AC_TRY_COMPILE([#include <sys/vfs.h>
25 #include <sys/param.h>
26 #include <sys/mount.h>
28 [struct statfs a; statfs("/", &a);],
29 [AC_MSG_RESULT([2 arguments])
31 STATFS_2_ARGUMENTS, 1,
32 [Define if statfs takes two arguments (like linux)])
36 #include <sys/types.h>
37 #include <sys/statfs.h>
39 [struct statfs a; statfs("/", &a, sizeof(struct statfs), 0);],
40 [AC_MSG_RESULT([4 arguments])
42 STATFS_4_ARGUMENTS, 1,
43 [Define if statfs takes four arguments (like SunOS)])
45 AC_MSG_RESULT([Can not determine])))
48 dnl Checks for header files
50 AC_CHECK_HEADERS(unistd.h sys/statfs.h sys/vfs.h sys/param.h sys/mount.h)
52 dnl Checks for typedefs, structures, and compiler characteristics.
55 dnl Checks for library functions.
56 AC_CHECK_FUNCS(gethostname strcspn strdup strspn strstr statfs)
57 AC_CHECK_FUNCS(getopt_long, have_getopt=true)
58 AM_CONDITIONAL(GETOPT, test x$have_getopt = xtrue)
61 define([xpmlist], esyscmd([find wmfsm/ -name 'wmfsm_master_*.xpm' -exec basename {} .xpm \;| sed 's/wmfsm_master_//']))
63 AS_HELP_STRING([--with-xpm],
64 [Configure wmfsm to use specified xpm file for appearance. Defaults to
65 'highcolor'. Choices are: ]
70 xpm="wmfsm/wmfsm_master_${with_xpm}.xpm"
71 if test ! -e "${xpm}"; then
72 AC_MSG_ERROR([Cannot find xpm file '${xpm}'.])
75 echo "configuring for ${with_xpm} appearance..."
76 rm -f wmfsm/wmfsm_master.xpm
77 ln -sr ${xpm} wmfsm/wmfsm_master.xpm
79 AC_OUTPUT(Makefile wmfsm/Makefile)