~ubuntu-core-dev/synaptic/ubuntu

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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
dnl Process this file with autoconf to produce a configure script.
AC_INIT(configure.in)

AM_INIT_AUTOMAKE(synaptic, 0.48)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

dnl Checks for programs.
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_RANLIB

dnl i18n
ALL_LINGUAS="ar pt_BR es fr de tr zh_CN zh_HK zh_TW ru nl ja be it_IT pl cs hu sr sr@Latn da"
AM_GLIB_GNU_GETTEXT
GETTEXT_PACKAGE=synaptic
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[description])
AC_PROG_INTLTOOL([0.23])
synapticlocaledir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(synapticlocaledir)
     

dnl ask for wings
AC_ARG_WITH(wings,
	[--with-wings   build with WINGs gui (obsolete)],
	[AC_CHECK_PROG(WINGS, get-wings-flags, yes, no)
	if test x"$WINGS" == xno; then
	   AC_MSG_ERROR([WINGs is not installed])
	fi
	]
)
if test x"$WINGS" = xyes; then
	BUILD_wings="wings"
	WINGS_LIBS=`get-wings-flags --ldflags`
	WINGS_LIBS="$GUI_LIBS `get-wings-flags --libs`"
	WINGS_HDRS=`get-wings-flags --cflags`
	AC_SUBST(WINGS_LIBS)
	AC_SUBST(WINGS_HDRS)
fi
AC_SUBST(BUILD_wings)

dnl ask for qt
AC_ARG_WITH(qt,
	[--with-qt      build with QT gui (non-functional)],
	[gw_CHECK_QT
	BUILD_qt="qt"]
)
AC_SUBST(BUILD_qt)

dnl Checks for gtk
if [ -n "$BUILD_qt" -a -n "$BUILD_wings" ]; then
	pkg_modules="gtk+-2.0 >= 2.0.0, libglade-2.0 >= 2.0.0, pango >= 1.0.0, glib-2.0"
	PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
	BUILD_gtk="gtk"	
fi

AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)
AC_SUBST(BUILD_gtk)

if test x"$WINGS" = xno; then
if test x"$GTK" = xno; then
	AC_MSG_ERROR([Neither WINGs nor Gtk is installed, you need to install either one to get a GUI])
fi
fi




dnl Check for rpm version 
dnl =====================
rpm_version="none"
AC_MSG_CHECKING(RPM version)
SAVE_LIBS="$LIBS"
SAVE_CPPFLAGS="$CPPFLAGS"

RPM_HDRS=""
LIBS="$SAVE_LIBS -lrpmio -lrpmdb -lpopt"
CPPFLAGS="$SAVE_CPPFLAGS -I/usr/include/rpm"
AC_CHECK_HEADER(rpm/rpmlib.h,
      [AC_CHECK_LIB(rpm,rpmdbInitIterator,
        [AC_DEFINE(HAVE_RPM, 1, [whether RPM is present]) 
         RPM_LIBS="-lrpm -lrpmio -lrpmdb -lpopt"
         SAVE_CPPFLAGS="$SAVE_CPPFLAGS -I/usr/include/rpm"
	 RPM_HDRS="-I/usr/include/rpm"
         rpm_version="4"])])

if test $rpm_version = "none"; then
LIBS="$SAVE_LIBS -lpopt"
CPPFLAGS="$SAVE_CPPFLAGS -I/usr/include/rpm"
AC_CHECK_HEADER(rpm/rpmlib.h,
      [AC_CHECK_LIB(rpm,rpmdbOpen,
        [AC_DEFINE(HAVE_RPM, 1, [wheter RPM is present]) 
         RPM_LIBS="-lrpm -lpopt"
         SAVE_CPPFLAGS="$SAVE_CPPFLAGS -I/usr/include/rpm"
	 RPM_HDRS="-I/usr/include/rpm"
         rpm_version="3"])])
fi

AC_SUBST(RPM_LIBS)
AC_SUBST(RPM_HDRS)
CPPFLAGS="$SAVE_CPPFLAGS"
LIBS="$SAVE_LIBS"
AC_MSG_RESULT("RPM version is $rpm_version")

AC_MSG_CHECKING(for --enable-scripts)
AC_ARG_ENABLE([scripts],
	      AC_HELP_STRING(--enable-scripts, enable the extension system),
	      [enable_scripts="$enableval"],[enable_scripts="no"])
if test "$enable_scripts" != "no"; then
  AC_MSG_RESULT(no)
  AC_DEFINE(WITH_LUA, 1, 
	    [Define if you want to enable the extension system.]) 
else
  AC_MSG_RESULT(yes)
fi
AM_CONDITIONAL(WITH_LUA, test "$enable_scripts" != "no")

DEB_HDRS=""
AC_SUBST(DEB_HDRS)
DEB_LIBS=""
AC_SUBST(DEB_LIBS)


dnl Checks for header files.
AC_HEADER_STDC

AC_CHECK_HEADERS(unistd.h libintl.h iconv.h)

AC_LANG_CPLUSPLUS
AC_CHECK_HEADER(apt-pkg/configuration.h)

if test x$ac_cv_header_apt_pkg_configuration_h != xyes; then
	AC_ERROR([You need the apt-pkg headers installed to compile synaptic.])
fi

AC_LANG_C

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

dnl Checks for library functions.
AC_FUNC_STRCOLL
AC_CHECK_FUNCS(regcomp strdup iconv)

AC_ARG_WITH(pkg-hold, 
	[--with-pkg-hold   build with experimental package "hold" feature],
        AC_DEFINE(SYNAPTIC_PKG_HOLD, 1, [build with package pin feature] )
)


AC_ARG_WITH(debtags, 
	[--with-debtags-support   build with experimental debtags support],
        [AC_DEFINE(HAVE_DEBTAGS, 1, [build with debtags support])
	LIBTAGCOLL_DEFS
	]
)

dnl check for libvte
AC_ARG_WITH(vte, 
	      [--with-vte  compile with libvte support (terminal output)], 
	      [pkg_modules="vte >= 0.10.11"
	      PKG_CHECK_MODULES(VTE, [$pkg_modules])
	      AC_DEFINE(HAVE_VTE, 1, [build with VTE as output terminal])
	      AC_DEFINE(HAVE_TERMINAL, 1, [build with a terminal widget]) 
	      AC_SUBST(VTE_CFLAGS)
	      AC_SUBST(VTE_LIBS)
	      ]
	      )

dnl check for libzvt
AC_ARG_WITH(zvt, 
	      [--with-zvt  compile with libzvt support (terminal output)], 
	      [pkg_modules="libzvt-2.0 >= 2.0.0"
	      PKG_CHECK_MODULES(ZVT, [$pkg_modules])
	      AC_DEFINE(HAVE_ZVT, 1, [build with ZVT as output terminal]) 
	      AC_DEFINE(HAVE_TERMINAL, 1, [build with a terminal widget]) 
	      AC_SUBST(ZVT_CFLAGS)
	      AC_SUBST(ZVT_LIBS)
	      ]
	      )

# check and make sure that we only have vte _or_ zvt
if test "${with_vte+set}" = set; then
	if test "${with_zvt+set}" = set; then
		AC_MSG_ERROR([You can only build with vte or zvt])
	fi
fi

AC_OUTPUT([
common/Makefile 
wings/Makefile 
gtk/Makefile
qt/Makefile
data/Makefile
man/Makefile
pixmaps/Makefile 
po/Makefile.in
help/Makefile
help/C/Makefile
doc/Makefile
doc/html/Makefile
Makefile
],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])