forked from pixel/hexedit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
75 lines (62 loc) · 2.03 KB
/
configure.ac
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
dnl Autoconfigure input file for hexedit
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_PREREQ(2.50)
AC_INIT(hexedit.c)
AC_CONFIG_HEADERS(config.h)
define(TheVERSION, 1.5)
PRODUCT=hexedit
VERSION=TheVERSION
INCL=hexedit.h
SRCS="hexedit.c display.c mark.c page.c file.c interact.c misc.c search.c"
OTHER="COPYING Changes TODO install-sh configure config.h.in hexedit.1 hexedit-TheVERSION.lsm Makefile.in configure.ac Makefile-build.in"
AC_SUBST(PRODUCT)
AC_SUBST(VERSION)
AC_SUBST(INCL)
AC_SUBST(SRCS)
AC_SUBST(OTHER)
dnl Enable GNU extensions on systems that have them.
AH_VERBATIM([_GNU_SOURCE],
[/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif])
AC_DEFINE(_GNU_SOURCE)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
dnl Checks for libraries.
AC_CHECK_LIB(curses, initscr, LIBS="$LIBS -lcurses",
[AC_CHECK_LIB(ncurses, initscr, LIBS="$LIBS -lncurses")]
)
AC_CHECK_LIB(tinfo, keypad, LIBS="$LIBS -ltinfo")
AC_CHECK_FUNC(use_default_colors,
AC_DEFINE(HAVE_COLORS, , "Define if you want colored (fruit salad) display option")
)
dnl This test must come as early as possible after the compiler configuration
dnl tests, because the choice of the file model can (in principle) affect
dnl whether functions and headers are available, whether they work, etc.
AC_SYS_LARGEFILE
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_STAT
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h unistd.h libgen.h sys/mount.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_CHECK_FUNCS(memcmp memmem memrmem memrchr strdup strerror basename)
if test $ac_cv_func_basename = no; then
# basename not in the default libraries. See if it's elsewhere
AC_CHECK_LIB(gen, basename, [AC_DEFINE(HAVE_BASENAME)
LIBS="$LIBS -lgen"])
fi
AC_CHECK_DECLS([dirname, basename, memrchr, memmem, memrmem], , ,
$ac_includes_default
#if HAVE_LIBGEN_H
#include <libgen.h>
#endif
)
AC_OUTPUT(Makefile Makefile-build hexedit.1)