File: configure.ac

package info (click to toggle)
cdebconf 0.192
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, jessie-kfreebsd-proposed-updates
  • size: 2,480 kB
  • sloc: ansic: 16,348; sh: 549; makefile: 446; sql: 52; perl: 13
file content (190 lines) | stat: -rw-r--r-- 6,214 bytes parent folder | download
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
dnl Process this file with autoconf to produce a configure script.
dnl The ONLY thing this is used for is to configure for different
dnl linux architectures and configurations, it is not used to make the
dnl code more portable

AC_INIT
AC_CONFIG_SRCDIR([configure.ac])
CFLAGS="-Wall $CFLAGS -D_GNU_SOURCE"
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_HEADER([src/config.h:src/config.h.in])

AC_DEFINE([DEBCONF_VERSION], [2.0], [debconf version])
AC_DEFINE([PACKAGE], ["cdebconf"], [package name])

dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
AC_ISC_POSIX

PKG_PROG_PKG_CONFIG

dnl We must have sed...
AC_PROG_SED

dnl Use pod2man for generating manpages
AC_PATH_PROG([POD2MAN], [pod2man])
AS_IF([test -n "$POD2MAN"], [], [AC_MSG_ERROR([pod2man is missing; cannot continue!])])
AC_SUBST([POD2MAN])

dnl setup source and build paths
TOPDIR=$(dirname $0)
if test "$TOPDIR" = "${TOPDIR#/}"; then
	# not absolute, resolve it 
	TOPDIR=$(readlink -f $(dirname $(pwd)/$0))
fi
AC_SUBST([TOPDIR])
BUILDDIR=$(pwd)
AC_SUBST([BUILDDIR])

if test "$TOPDIR" != "$BUILDDIR"; then
	echo "Setting up build directory"
	for d in `(cd $TOPDIR; find . -type d -a -not -name CVS -a -not -name debian)`; do
		mkdir -p $BUILDDIR/$d
		test -f $TOPDIR/$d/Makefile && cp $TOPDIR/$d/Makefile $BUILDDIR/$d/
		test -f $TOPDIR/$d/modules.mak && cp $TOPDIR/$d/modules.mak $BUILDDIR/$d/
	done
fi

dnl dh_auto_configure may pass these options, used by some automake macros.
dnl Ignore them.
AC_ARG_ENABLE([maintainer-mode], [])
AC_ARG_ENABLE([dependency-tracking], [])

dnl Enable debugging?
AC_ARG_WITH([debug], [AS_HELP_STRING([--without-debug], [turn off debugging?])])
if test "$with_debug" != "no"; then
  AC_DEFINE([DODEBUG], [1], [turn on debugging])
  CFLAGS="$CFLAGS -g -D_DEBUG_"
fi

dnl Use rpath? (for testing mostly)
AC_ARG_WITH([rpath], [AS_HELP_STRING([--with-rpath], [use rpath? (for testing)])])
if test "$with_rpath" != "no"; then
  RPATH="-Wl,-rpath,$(pwd)/src"
else
  RPATH="-Wl,-rpath,$prefix/lib/cdebconf"
fi
AC_SUBST([RPATH])

dnl What db modules to build?
AC_ARG_WITH([db], [AS_HELP_STRING([--with-db], [db modules to build])])
DB_MODULES=$with_db

dnl What frontend modules to build?
AC_ARG_WITH([frontend], [AS_HELP_STRING([--with-frontend], [frontend modules to build])])
FRONTEND_MODULES=$with_frontend

dnl debconf config file
DEBCONFCONFIG="/etc/cdebconf.conf"
AC_ARG_WITH([conffile], [AS_HELP_STRING([--with-conffile=PATH], [cdebconf config file [/etc/debconf.conf]])],
[case "$withval" in
  "") AC_MSG_ERROR([invalid conffile specified]) ;;
  *) DEBCONFCONFIG="$withval" ;;
 esac])
AC_DEFINE_UNQUOTED([DEBCONFCONFIG], ["$DEBCONFCONFIG"], [cdebconf config file])

DEFAULT_FRONTEND=text
AC_ARG_WITH([default-frontend], [AS_HELP_STRING([--with-default-frontend], [default frontend to use [text]])],
[case "$withval" in
  "") AC_MSG_ERROR([invalid default frontend specified]) ;;
  *)  DEFAULT_FRONTEND="$withval";;
 esac])
AC_SUBST([DEFAULT_FRONTEND])

dnl whether to use libtextwrap
AC_ARG_WITH([textwrap], [AS_HELP_STRING([--with-textwrap], [use libtextwrap for line-folding])],
[if test "x$withval" = "xyes" ; then
   AC_CHECK_LIB([textwrap], [textwrap_init],
      [AC_DEFINE([HAVE_LIBTEXTWRAP],[1],[use libtextwrap for line-folding])
         TEXTWRAP_LIBS="-ltextwrap"])
 fi])
AC_SUBST([TEXTWRAP_LIBS])

dnl logging to syslog (should be configurable in config file
AC_ARG_WITH([syslog-logging], [AS_HELP_STRING([--with-syslog-logging], [enable logging to syslog])],
[if test "x$withval" = "xyes"; then
   AC_DEFINE([SYSLOG_LOGGING], [1], [enable logging to syslog])
 fi])

TARGET=deb
dnl compile cdebconf udeb?
AC_ARG_ENABLE([d_i], [AS_HELP_STRING([--enable-d-i], [build cdebconf for the debian-installer])],
[if test "$enableval" = "yes"; then
   CFLAGS="$CFLAGS -DDI_UDEB"
   TARGET=udeb
 fi])
AC_SUBST([TARGET])

dnl Check for libraries
PKG_CHECK_MODULES([DI],[libdebian-installer])
AC_CHECK_LIB([dl], [dlopen])

dnl Autodetect what to build if not specified

dnl Databases - which to include.
if test -z "$DB_MODULES"; then
    DB_MODULES="textdb rfc822db stack"

    AC_CHECK_LIB([mysqlclient], [mysql_init], [DB_MODULES="$DB_MODULES mysql"], [AC_MSG_WARN([cannot build mysql database])])
fi

dnl Frontends - which to include.

if test -z "$FRONTEND_MODULES"; then
    FRONTEND_MODULES="passthrough text"

    AC_CHECK_LIB([bogl], [bowl_flush], [FRONTEND_MODULES="$FRONTEND_MODULES bogl"], [AC_MSG_WARN([cannot build BOGL frontend])])
    PKG_CHECK_EXISTS([glib-2.0 gtk+-x11-2.0 >= 2.24 pango gdk-pixbuf-2.0], [FRONTEND_MODULES="$FRONTEND_MODULES gtk"], [AC_MSG_WARN([cannot build GTK frontend])])
    PKG_CHECK_EXISTS([ncurses], [FRONTEND_MODULES="$FRONTEND_MODULES ncurses"], [AC_MSG_WARN([cannot build ncurses frontend])])
    PKG_CHECK_EXISTS([libnewt slang], [FRONTEND_MODULES="$FRONTEND_MODULES newt"], [AC_MSG_WARN([cannot build Newt frontend])])
    PKG_CHECK_EXISTS([slang], [FRONTEND_MODULES="$FRONTEND_MODULES slang"], [AC_MSG_WARN([cannot build Slang frontend])])
fi

for frontend in $FRONTEND_MODULES; do
    case $frontend in
      gtk) PKG_CHECK_MODULES([GTK_X11],[glib-2.0 gtk+-x11-2.0 >= 2.24 pango gdk-pixbuf-2.0]);;
      ncurses) PKG_CHECK_MODULES([NCURSES],[ncurses]);;
      newt) PKG_CHECK_MODULES([NEWT],[libnewt slang]);;
      slang) PKG_CHECK_MODULES([SLANG],[slang]);;
      *);;
    esac
done

AC_SUBST([FRONTEND_MODULES])
AC_SUBST([DB_MODULES])

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([fcntl.h sys/ioctl.h unistd.h])

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME

dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([socket strdup strstr strtol])

AC_CONFIG_FILES([globalmakeflags src/cdebconf.conf-dist
 src/Makefile
 man/Makefile
 src/modules/db/rfc822db/Makefile
 src/modules/frontend/gtk/Makefile
 src/modules/frontend/ncurses/Makefile
 src/modules/frontend/newt/Makefile
 src/modules/frontend/passthrough/Makefile
 src/modules/frontend/slang/Makefile
 src/modules/frontend/text/Makefile
])
AC_OUTPUT