File: configure.in

package info (click to toggle)
ncurses-hexedit 0.9.7-11
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 884 kB
  • ctags: 336
  • sloc: ansic: 7,422; sh: 371; makefile: 68
file content (106 lines) | stat: -rw-r--r-- 2,446 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
dnl configure.in for hexedit
dnl April 23rd, 1999 Adam Rogoyski <apoc@laker.net>
dnl see COPYING for terms of copying under the GNU General Public License

AC_INIT(src/main.c)

AM_INIT_AUTOMAKE(hexedit, 0.9.7)
AM_CONFIG_HEADER(config.h:config.in)

AC_PROG_CC
if test "$GCC" = "yes"; then
  CFLAGS="$CFLAGS -Wall"
fi

AC_PROG_INSTALL

AC_DEFINE(_GNU_SOURCE)

AC_HEADER_STDC
AC_PROG_GCC_TRADITIONAL

AC_CHECK_HEADERS(ncurses.h)
if test "$ac_cv_header_ncurses_h" = "no"; then
  AC_CHECK_HEADERS(curses.h)
  if test "$ac_cv_header_curses_h" = "no"; then
    echo "*** Cannot find Curses headers, probably not installed"
    echo "*** Hexedit will not run without the curses library"
  fi
fi

AC_CHECK_HEADERS(fcntl.h getopt.h limits.h sys/ioctl.h unistd.h)
AC_HEADER_DIRENT
AC_C_CONST
AC_STRUCT_TM
AC_CHECK_FUNCS(snprintf isprint)
AC_CHECK_FUNCS(getopt_long,AC_DEFINE(HAVE_GETOPT_LONG))


dnl find TIOCGWINSZ if possible

AC_MSG_CHECKING([for TIOCGWINSZ])
AC_EGREP_CPP(rogoyski_hexedit_termio,
[
#include <termio.h>
#ifdef TIOCGWINSZ
  rogoyski_hexedit_termio
#endif
], hex_termio_h=yes)

if test "$hex_termio_h" = "yes"; then
  AC_DEFINE(HAVE_TERMIO_H)
  AC_MSG_RESULT([yes, found in termio.h])
else

  AC_EGREP_CPP(rogoyski_hexedit_termios,
  [
  #include <termios.h>
  #ifdef TIOCGWINSZ
    rogoyski_hexedit_termios
  #endif
  ], hex_termios_h=yes)

  if test "$hex_termios_h" = "yes"; then
    AC_DEFINE(HAVE_TERMIOS_H)
    AC_MSG_RESULT([yes, found in termios.h])
  else

    AC_EGREP_CPP(rogoyski_hexedit_sys_termio,
    [
    #include <sys/termio.h>
    #ifdef TIOCGWINSZ
      rogoyski_hexedit_sys_termio
    #endif
    ], hex_sys_termio_h=yes)

    if test "$hex_sys_termio_h" = "yes"; then
      AC_DEFINE(HAVE_SYS_TERMIO_H)
      AC_MSG_RESULT([yes, found in sys/termio.h])
    else

      AC_EGREP_CPP(rogoyski_hexedit_sys_termios,
      [
      #include <sys/termios.h>
      #ifdef TIOCGWINSZ
        rogoyski_hexedit_sys_termios
      #endif
      ], hex_sys_termios_h=yes)

      if test "$hex_sys_termios_h" = "yes"; then
        AC_DEFINE(HAVE_SYS_TERMIOS_H)
        AC_MSG_RESULT([yes, found in sys/termios.h])
      else
        AC_MSG_RESULT([no])
      fi
    fi
  fi
fi

AC_CHECK_LIB(ncurses, newwin, ,
    AC_CHECK_LIB(curses, newwin), ,
    echo "Hexedit requires the curses library"
    echo "Ncurses is freely available: ftp://ftp.gnu.org/pub/gnu/"
    exit 1)


AC_OUTPUT(Makefile docs/Makefile gnu/Makefile src/Makefile)