putting ToggleDecor back in properly for blackbox 0.61.2 release
[bbkeys.git] / configure.in
blob0f605eef63d88875e0a65e404ff0157ff2cd6d35
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(src/bbkeys.cc)
3 AM_INIT_AUTOMAKE(bbkeys, 0.8.4-pre)
4 AM_MAINTAINER_MODE
5 AC_PREFIX_DEFAULT(/usr/local)
7 AC_CHECK_PROGS(regex_cmd, sed)
8 if test x$regex_cmd = "x"; then
9  AC_MSG_ERROR([error. sed is required to build the default bbtoolsrc file.])
13 dnl get the debug values right
14 AC_DEFUN(AC_SET_DEBUG,
16  test "$CFLAGS" = "" && CFLAGS="-g -Wall -DDEBUG"
17  test "$CXXFLAGS" = "" && CXXFLAGS="-g -Wall -DDEBUG"
18  test "$LDFLAGS" = "" && LDFLAGS=""
21 AC_DEFUN(AC_SET_NODEBUG,
23  test "$CFLAGS" = "" && CFLAGS="-O2 -Wall"
24  test "$CXXFLAGS" = "" && CXXFLAGS="-O2 -Wall"
25  test "$LDFLAGS" = "" && LDFLAGS="-s"
27       
29 AC_ARG_ENABLE(debug,[  --enable-debug   create debugging code [default=no]],
31 if test $enableval = "no";
32  then AC_SET_NODEBUG
33  else AC_SET_DEBUG
36 AC_SET_NODEBUG)
38 dnl Check for Interlacing
39 INTERLACE=""
40 AC_MSG_CHECKING([whether to include interlacing image code])
41 AC_ARG_ENABLE(
42   interlace, [  --enable-interlace      include code for image interlacing[default=yes]],
43   if test x$enableval = "xyes"; then
44     AC_MSG_RESULT([yes])
45     INTERLACE="-DINTERLACE"
46   else
47     AC_MSG_RESULT([no])
48   fi,
49   AC_MSG_RESULT([yes])
50   INTERLACE="-DINTERLACE"
52 AC_SUBST(INTERLACE)
54 dnl Checks for programs.
55 AC_PROG_CXX
56 AC_PROG_AWK
57 AC_PROG_CC
58 AC_PROG_CPP
59 AC_PROG_INSTALL
60 AC_PROG_LN_S
61 AC_PROG_MAKE_SET
62 AC_PROG_RANLIB
64 dnl minimum version we can live with
65 PERL_VERSION=5.004
66 dnl check for perl for our command-line configurator
67 AC_PATH_PROGS(PERL, $PERL perl5 perl )
68 if test -z "$PERL" || test "$PERL" = ":"; then
69     AC_MSG_ERROR([perl not found in \$PATH])
72 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
73 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
74 _perl_res=$?
75 AC_MSG_RESULT([$_perl_version])
77 if test "$_perl_res" != 0; then
78     AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
81 AC_MSG_CHECKING([for full perl installation])
82 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
83 _perl_res=$?
84 if test "$_perl_res" != 0; then
85     AC_MSG_RESULT([no])
86     AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}.  A full perl installation is required.])
87 else
88     AC_MSG_RESULT([yes])    
92 # Checks for header files.
93 AC_PATH_X
94 AC_PATH_XTRA
95 AC_HEADER_STDC
96 AC_HEADER_SYS_WAIT
97 AC_CHECK_HEADERS(ctype.h strings.h fcntl.h libgen.h locale.h process.h signal.h stdio.h time.h errno.h unistd.h sys/signal.h sys/param.h sys/select.h sys/stat.h sys/time.h sys/types.h sys/wait.h stdlib.h string.h malloc.h)
99 # Checks for typedefs, structures, and compiler characteristics.
100 AC_C_CONST
101 AC_C_INLINE
102 AC_HEADER_TIME
103 AC_STRUCT_TM
105 # Checks for library functions.
106 dnl AC_FUNC_FORK
107 dnl AC_FUNC_MALLOC
108 AC_TYPE_SIGNAL
109 dnl AC_FUNC_STAT
110 AC_CHECK_FUNCS(setlocale sigaction strftime gettimeofday memset strcasecmp strchr strcspn strdup strncasecmp select strstr)
113 CFLAGS="$CFLAGS $X_CFLAGS"
114 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
115 LDFLAGS="$LDFLAGS $X_LIBS $X_PRE_LIBS"
116 dnl Checks for X libraries.
117 AC_CHECK_LIB(X11, XOpenDisplay, LDFLAGS="$LDFLAGS -lX11",
118              AC_MSG_ERROR(XOpenDisplay not found in -lX11))
120 LDFLAGS="$LDFLAGS $X_EXTRA_LIBS"
122 dnl generate the config header
123 AM_CONFIG_HEADER(config.h) 
125 AC_OUTPUT( \
126 version.h \
127 Makefile \
128 src/Makefile \
129 src/bbkeysconf.pl \
130 data/Makefile \
131 doc/Makefile \
132 doc/bbkeys.1 \
133 redhat/Makefile \
134 redhat/bbkeys.spec \