| 1 | dnl -*-m4-*- |
| 2 | dnl |
| 3 | dnl $Id$ |
| 4 | dnl |
| 5 | dnl Autoconfiguration for Catacomb |
| 6 | dnl |
| 7 | dnl (c) 1999 Straylight/Edgeware |
| 8 | dnl |
| 9 | |
| 10 | dnl ----- Licensing notice -------------------------------------------------- |
| 11 | dnl |
| 12 | dnl This file is part of Catacomb. |
| 13 | dnl |
| 14 | dnl Catacomb is free software; you can redistribute it and/or modify |
| 15 | dnl it under the terms of the GNU Library General Public License as |
| 16 | dnl published by the Free Software Foundation; either version 2 of the |
| 17 | dnl License, or (at your option) any later version. |
| 18 | dnl |
| 19 | dnl Catacomb is distributed in the hope that it will be useful, |
| 20 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | dnl GNU Library General Public License for more details. |
| 23 | dnl |
| 24 | dnl You should have received a copy of the GNU Library General Public |
| 25 | dnl License along with Catacomb; if not, write to the Free |
| 26 | dnl Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
| 27 | dnl MA 02111-1307, USA. |
| 28 | |
| 29 | dnl --- Boring boilerplate --- |
| 30 | |
| 31 | AC_INIT(blkc.h) |
| 32 | AM_CONFIG_HEADER(config.h) |
| 33 | AC_CONFIG_AUX_DIR(.) |
| 34 | AM_INIT_AUTOMAKE(catacomb, 2.1.1) |
| 35 | |
| 36 | dnl --- Make sure I can compile and build libraries --- |
| 37 | |
| 38 | AC_PROG_CC |
| 39 | AM_PROG_LIBTOOL |
| 40 | AX_CFLAGS_WARN_ALL |
| 41 | |
| 42 | AC_PROG_YACC |
| 43 | |
| 44 | dnl --- Actually, I assume these exist anyway --- |
| 45 | |
| 46 | AC_CHECK_HEADERS(unistd.h) |
| 47 | AC_HEADER_STDC |
| 48 | |
| 49 | dnl --- Check for various important system types --- |
| 50 | |
| 51 | AC_CHECK_TYPE(pid_t, int) |
| 52 | AC_CHECK_TYPE(size_t, unsigned) |
| 53 | AC_TYPE_UID_T |
| 54 | AC_CHECK_TYPE(time_t, long) |
| 55 | AC_CHECK_TYPE(ssize_t, int) |
| 56 | |
| 57 | dnl --- The maths library, for Maurer's test --- |
| 58 | |
| 59 | OLIBS=$LIBS |
| 60 | AC_SEARCH_LIBS(log, m) |
| 61 | AC_SEARCH_LIBS(sqrt, m) |
| 62 | AC_SUBST([CATACOMB_LIBS], [$LIBS]) LIBS=$OLIBS |
| 63 | |
| 64 | dnl --- Functions used for noise-gathering --- |
| 65 | |
| 66 | AC_CHECK_FUNCS(setgroups) |
| 67 | |
| 68 | AC_CACHE_CHECK([whether the freewheel noise generator will work], |
| 69 | [catacomb_cv_freewheel], |
| 70 | [AC_TRY_LINK([ |
| 71 | #include <setjmp.h> |
| 72 | #include <sys/time.h> |
| 73 | ], |
| 74 | [struct itimerval itv = { { 0, 0 }, { 0, 5000 } }; |
| 75 | jmp_buf j; |
| 76 | setitimer(ITIMER_REAL, &itv, 0); |
| 77 | sigsetjmp(j, 1);], |
| 78 | [catacomb_cv_freewheel=yes], |
| 79 | [catacomb_cv_freewheel=no])]) |
| 80 | if test "$catacomb_cv_freewheel" = "yes"; then |
| 81 | AC_DEFINE([USE_FREEWHEEL], [1], |
| 82 | [Define if you want to use the freewheel noise generator.]) |
| 83 | fi |
| 84 | |
| 85 | dnl --- Support for the passphrase pixie --- |
| 86 | |
| 87 | OLIBS=$LIBS |
| 88 | AC_SEARCH_LIBS(socket, socket) |
| 89 | AC_SUBST([PIXIE_LIBS], [$LIBS]) LIBS=$OLIBS |
| 90 | AC_CHECK_FUNCS(mlock) |
| 91 | |
| 92 | dnl --- Debugging things --- |
| 93 | |
| 94 | AC_ARG_ENABLE([mpw], |
| 95 | [AS_HELP_STRING([--enable-mpw], |
| 96 | [force small-width mp digits])], |
| 97 | [case "$enableval" in |
| 98 | y*|t*|short) |
| 99 | AC_DEFINE([FORCE_MPW_SHORT], [1], |
| 100 | [Define to force small-width mp digits.]) |
| 101 | ;; |
| 102 | cussid) |
| 103 | AC_DEFINE([FORCE_MPW_CUSSID], [1], |
| 104 | [Define to force strange-width mp digits.]) |
| 105 | ;; |
| 106 | esac]) |
| 107 | |
| 108 | dnl --- Done --- |
| 109 | |
| 110 | PKG_CHECK_MODULES(mLib, mLib >= 2.0.4) |
| 111 | CFLAGS="$CFLAGS $mLib_CFLAGS" |
| 112 | LIBS="$LIBS $mLib_LIBS" |
| 113 | AC_OUTPUT(Makefile tests/Makefile catacomb.pc qcc, |
| 114 | chmod 755 qcc) |
| 115 | |
| 116 | dnl ----- That's all, folks ------------------------------------------------- |