-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
179 lines (159 loc) · 5.64 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
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([Printer Applications Framework], [0.0.1], [https://github.com/dheeraj135/Printer-Applications-Framework])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
######################################################################
# Directory
AC_PREFIX_DEFAULT(/)
if test "$prefix" = "NONE"; then
prefix="/"
fi
if test "$exec_prefix" = "NONE";then
if test "$prefix" = "/";then
exec_prefix="/usr"
else
exec_prefix="$prefix"
fi
fi
# echo $datarootdir
# echo "x\${datarootdir}"
#if test "x$datarootdir" = "x";then
datarootdir="$exec_prefix/share"
# echo "${datarootdir}"
#fi
if test "x$datadir" = "x\${datarootdir}";then
datadir="${datarootdir}/cups"
fi
if test "x$cachedir" = "x";then
cachedir="$prefix/var/cache"
fi
if test "x$serverbin" = "x";then
serverbin="$exec_prefix/lib/cups"
fi
if test "x$tmpdir" = "x";then
tmpdir="$prefix/var/tmp/"
fi
bindir="$exec_prefix/bin"
sbindir="$exec_prefix/sbin"
# AC_DEFINE([EXEC_PREFIX],[],[EXEC prefix])
# AC_DEFINE([PREFIX],[],[prefix])
# AC_DEFINE([DATADIR],[],[datadir])
# AC_DEFINE([CACHEDIR],[],[cachedir])
# AC_DEFINE([SERVERBIN],[],[serverbin])
# AC_DEFINE([BINDIR],[],[bindir])
# AC_DEFINE([SBINDIR],[],[sbindir])
# AC_DEFINE([TMPDIR],[],[tmpdir])
AC_DEFINE_UNQUOTED([EXEC_PREFIX],["$exec_prefix"],[exec prefix])
AC_DEFINE_UNQUOTED([PREFIX],["$prefix"],[prefix])
# AC_DEFINE_UNQUOTED([DATADIR],["$datadir"],[datadir])
AC_DEFINE_UNQUOTED([CACHEDIR],["$cachedir"],[cachedir])
# AC_DEFINE_UNQUOTED([SERVERBIN],["$serverbin"],[serverbin])
AC_DEFINE_UNQUOTED([BINDIR],["$bindir"],[bindir])
AC_DEFINE_UNQUOTED([SBINDIR],["$sbindir"],[sbindir])
AC_DEFINE_UNQUOTED([TMPDIR],["$tmpdir"],[temp dir])
# echo "$serverbin"
AC_SUBST([serverbin])
AC_SUBST([tmpdir])
######################################################################
# cups-config
AC_ARG_WITH([cups-config],
[AS_HELP_STRING([--with-cups-config=path], [Specify path to cups-config executable.])],
[with_cups_config="$withval"],
[with_cups_config=system]
)
AS_IF([test "x$with_cups_config" != "xsystem"], [
CUPSCONFIG=$with_cups_config
], [
AC_PATH_TOOL(CUPSCONFIG, [cups-config])
AS_IF([test -z "$CUPSCONFIG"], [
AC_MSG_ERROR([Required cups-config is missing. Please install CUPS developer packages.])
])
])
cups_serverbin=`$CUPSCONFIG --serverbin`
CUPS_DATADIR="`$CUPSCONFIG --datadir`"
CUPS_SERVERBIN="$cups_serverbin"
AC_SUBST(CUPS_SERVERBIN)
AC_SUBST(CUPS_DATADIR)
# AC_SUBST(LIB_CUPS)
# AC_SUBST(LDFLAGS_CUPS)
AC_DEFINE_UNQUOTED([CUPS_SERVERBIN],["$CUPS_SERVERBIN"],[Cups serverbin directory])
######################################################################
# CUPS-CONFIG
CUPS_API_VERSION=`$CUPSCONFIG --api-version`
CUPS_BUILD=`$CUPSCONFIG --build`
CUPS_CFLAGS=`$CUPSCONFIG --cflags`
CUPS_LDFLAGS=`$CUPSCONFIG --ldflags`
CUPS_LIBS=`$CUPSCONFIG --libs`
CUPS_STATIC=`$CUPSCONFIG --static --libs`
CUPS_VERSION=`$CUPSCONFIG --version`
CUPS_SERVERROOT=`$CUPSCONFIG --serverroot`
AC_DEFINE_UNQUOTED([DATADIR],["$CUPS_DATADIR"],[datadir])
AC_DEFINE_UNQUOTED([SERVERBIN],["$CUPS_SERVERBIN"],[serverbin])
AC_DEFINE_UNQUOTED([SERVERROOT],["$CUPS_SERVERBIN"],[serverroot])
echo "$CUPS_STATIC"
AC_SUBST(CUPS_API_VERSION)
AC_SUBST(CUPS_BUILD)
AC_SUBST(CUPS_LDFLAGS)
AC_SUBST(CUPS_LIBS)
AC_SUBST(CUPS_STATIC)
AC_SUBST(CUPS_CFLAGS)
AC_SUBST(CUPS_VERSION)
AC_SUBST(CUPS_SERVERROOT)
######################################################################
# Debug level
dbg_level=1
if test "x$DEBUG_LEVEL" = "x";then
dbg_level=1
else
dbg_level=$DEBUG_LEVEL
fi
AC_ARG_VAR(DEBUG_LEVEL,[Enable or set Debugging level[1-3] 3 is heighest])
AC_DEFINE_UNQUOTED([DEBUG_LEVEL],[$dbg_level],[Debugging level of the software.])
######################################################################
# Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
AC_CHECK_PROG(IPPEVEPRINTER,ippeveprinter,yes,no)
if test x"$IPPEVEPRINTER" != x"yes";then
AC_MSG_WARN([Please install ippeveprinter from cups or ippsample package.])
fi
AC_CHECK_PROG(CUPS_DRIVERD,cups-driverd,yes,no)
if test x"$CUPS_DRIVERD" != x"yes";then
AC_MSG_WARN([Please install cups-driverd from cups package.])
fi
# Checks for libraries.
AC_CHECK_LIB([cups],[cupsAddDest])
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h unistd.h])
AC_CHECK_HEADERS([cups/cups.h cups/array.h cups/dir.h cups/file.h cups/ppd.h])
######################################################################
# Check for avahi
PKG_CHECK_MODULES([libavahi],[avahi-client],[have_avahi=1],[have_avahi=0])
# echo "HAVE_AVAHI="$have_avahi
if test x"$have_avahi" = x"1"; then
AC_CHECK_HEADERS([avahi-client/client.h avahi-client/lookup.h avahi-common/simple-watch.h\
avahi-common/malloc.h avahi-common/error.h],[],[have_avahi=0])
fi
AC_DEFINE_UNQUOTED([HAVE_AVAHI],[$have_avahi],[Do we have Avahi?])
if test x"$have_avahi" = x"1"; then
LIB_AVAHI="-lavahi-common -lavahi-client"
echo "$LIB_AVAHI"
AC_SUBST(LIB_AVAHI)
fi
######################################################################
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT16_T
# Checks for library functions.
AC_FUNC_FORK
AC_CHECK_FUNCS([dup2 gettimeofday memmove memset socket strcasecmp strdup strerror strncasecmp strstr])
AC_CONFIG_FILES([Makefile
server/Makefile])
# This is a fake cups-config file allowing driver packages to detect this file and work accordingly.
# AC_CONFIG_FILES([cups-config],[chmod +x cups-config])
AC_OUTPUT