File: configure.in

package info (click to toggle)
iselect 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 828 kB
  • sloc: sh: 3,353; ansic: 2,074; perl: 485; makefile: 137
file content (104 lines) | stat: -rw-r--r-- 2,768 bytes parent folder | download | duplicates (4)
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
dnl ##
dnl ##  configure.in -- GNU autoconf configuration spec
dnl ##  Copyright (c) Ralf S. Engelschall <rse@engelschall.com>
dnl ##

AC_PREREQ(2.61)dnl
AC_REVISION(1.0)dnl
AC_INIT(README)
SHTOOL="./etc/shtool"
T_MD=`$SHTOOL echo -e %B 2>/dev/null`
T_ME=`$SHTOOL echo -e %b 2>/dev/null`
echo "${T_MD}Configuring for iSelect `./etc/shtool version -lc -dlong iselect_version.c`${T_ME}"
echo "Copyright (c) 1997-2007 Ralf S. Engelschall <rse@engelschall.com>"

AC_CONFIG_HEADER(config_ac.h)dnl
AC_PREFIX_DEFAULT(/usr/local)

AC_CONFIGURE_PART(CHECK: Build Environment)

AC_PROG_CC
AC_PROG_CPP

AC_MSG_CHECKING(for compilation debug mode)
AC_ARG_ENABLE(debug,dnl
[  --enable-debug          to enable the debugging options for compilation],
x="enabled"
CFLAGS="-Wall -g"
LDFLAGS="-g"
debug=on
,
x=disabled
CFLAGS="-O2"
LDFLAGS=""
debug=off
)dnl
AC_SUBST(debug)
AC_MSG_RESULT([$x])

AC_SET_MAKE
AC_SUBST(SHTOOL)

AC_CONFIGURE_PART(CHECK: Curses Environment)

AC_MSG_CHECKING(for additional include dir)
AC_ARG_WITH(incdir,dnl
[  --with-incdir=DIR       add DIR to the include path],
CFLAGS="$CFLAGS -I$with_incdir"
CPPFLAGS="$CPPFLAGS -I$with_incdir"
x="$with_incdir"
,
x="none particular"
)dnl
AC_MSG_RESULT([$x])
AC_MSG_CHECKING(for additional library dir)
AC_ARG_WITH(libdir,dnl
[  --with-libdir=DIR       add DIR to the library path],
LDFLAGS="$LDFLAGS -L$with_libdir"
x="$with_libdir"
,
x="none particular"
)dnl
AC_MSG_RESULT([$x])

AC_CHECK_HEADER(ncurses/ncurses.h, HAVE_NCURSES_HEADER=YES, HAVE_NCURSES_HEADER=NO)
AC_CHECK_LIB(ncurses, initscr, HAVE_NCURSES_LIB=YES, HAVE_NCURSES_LIB=NO)
AC_CHECK_HEADER(slcurses.h, HAVE_SLCURSES_HEADER=YES, HAVE_SLCURSES_HEADER=NO)
OLIBS=$LIBS
LIBS="$LIBS -ltermcap"
AC_CHECK_LIB(slang, SLcurses_initscr, HAVE_SLCURSES_LIB=YES, HAVE_SLCURSES_LIB=NO)
LIBS=$OLIBS
if test ".$HAVE_NCURSES_HEADER.$HAVE_NCURSES_LIB." = .YES.YES.; then
    USE_NCURSES=YES
    AC_DEFINE(USE_NCURSES, 1, [use NCurses])
    LIBS="$LIBS -lncurses"
    AC_MSG_CHECKING([which Curses to use])
    AC_MSG_RESULT([GNU NCurses])
else
    if test ".$HAVE_SLCURSES_HEADER.$HAVE_SLCURSES_LIB." = .YES.YES.; then
        USE_SLCURSES=YES
        AC_DEFINE(USE_SLCURSES, 1, [use SLcurses])
        LIBS="$LIBS -lslang -ltermcap"
        AC_MSG_CHECKING([which Curses to use])
        AC_MSG_RESULT([S-Lang Curses])
    else
        USE_CURSES=YES
        AC_DEFINE(USE_CURSES, 1, [use plain Curses])
        LIBS="$LIBS -lcurses"
        AC_MSG_CHECKING([which Curses to use])
        AC_MSG_RESULT([Vendor Curses])
    fi
fi

AC_CONFIGURE_PART(CHECK: System Ingredients)
AC_CONST
AC_STDC_HEADERS
AC_HAVE_HEADERS(stdio.h stddef.h string.h strings.h stdlib.h)

AC_CONFIGURE_PART(RESULT: Sourcefile Substitution)
AC_OUTPUT(dnl
Makefile dnl
config_sc.h dnl
,dnl
)dnl