2 # Source file to generate "./configure" to prepare package for compilation
3 # Copyright (C) 2004 Jan Kratochvil <project-udpforward@jankratochvil.net>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl 2.53 for AM_GLIB_GNU_GETTEXT:
22 dnl Not yet present in: Red Hat autoconf-2.57-3
23 dnl AC_CONFIG_MACRO_DIR(macros)
24 AM_INIT_AUTOMAKE(udpforward,1.0cvs)
25 AM_CONFIG_HEADER(config.h)
27 dnl Prevent "AC_TRY_COMPILE was called before AC_ISC_POSIX":
33 dnl Workaround for autoconf-2.57:
34 m4_pattern_allow([AC_MSG_WARN])
35 m4_pattern_allow([AC_CHECK_LIB])
36 m4_pattern_allow([AC_CHECK_HEADERS])
38 dnl gettext localization.
39 dnl Use simpler AM_GLIB_GNU_GETTEXT instead of AM_GNU_GETTEXT
40 dnl as we depend on glib and glib requires system installed gettext anyway.
41 dnl http://lists.gnome.org/archives/gtk-devel-list/2003-April/msg00066.html
42 dnl Special 'GETTEXT_PACKAGE' is required by glib gettext.
44 GETTEXT_PACKAGE="$PACKAGE"
45 AC_SUBST(GETTEXT_PACKAGE)
48 dnl Do not discard 'CFLAGS' settings as they may have been passed us by rpmbuild(8)
50 dnl Define MAINTAINER_MODE in config.h.
51 if test "$USE_MAINTAINER_MODE" = "yes";then
52 AC_DEFINE(MAINTAINER_MODE,,[Turn even some software behaviour according to MAINTAINER_MODE.])
53 CFLAGS="$CFLAGS -ggdb3 -Wall -Wstrict-prototypes -Wsign-compare"
55 dnl Some Makefiles use additional tests etc.
56 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
59 AC_ARG_ENABLE(man-pages,
60 [ --enable-man-pages=no/yes/auto pod2man(1) required for man pages (def.=yes)],,enable_man_pages=yes)
63 dnl Permit 'if NEVER' for Makefile.am-s; symbol 'FALSE' forbidden by automake
64 AM_CONDITIONAL(NEVER,false)
67 AC_PATH_PROGS(PERL,perl5 perl)
68 AM_CONDITIONAL(HAVE_PERL,test -n "$PERL")
71 AC_PATH_PROGS(POD2MAN,pod2man)
72 AM_CONDITIONAL(HAVE_POD2MAN,[ test -n "$POD2MAN" ])
73 if test x$enable_man_pages = xyes;then
74 if test -z "$POD2MAN";then
75 AC_MSG_ERROR([udpforward requires pod2man(1) for man pages; try --disable-man-pages.])
77 if test -z "$PERL";then
78 AC_MSG_ERROR([udpforward requires perl(1) for man pages; try --disable-man-pages.])
80 elif test x$enable_man_pages != xno;then
81 if test -z "$POD2MAN";then
82 AC_MSG_WARN([udpforward requires pod2man(1) for man pages by --enable-man-pages; mans will not be installed.])
84 if test -z "$PERL";then
85 AC_MSG_WARN([udpforward requires perl(1) for man pages by --enable-man-pages; mans will not be installed.])
88 AM_CONDITIONAL(ENABLE_MAN_PAGES,[ test x$enable_man_pages != xno -a -n "$POD2MAN" -a -n "$PERL" ])
90 dnl Separate 'acconfig.h' is no longer recommended by autoconf
92 #ifndef _UDPFORWARD_CONFIG_H
93 #define _UDPFORWARD_CONFIG_H 1
96 /* Do not place any stuff to AH_TOP as some of its includes
97 * would discard the effect of _FILE_OFFSET_BITS by AC_SYS_LARGEFILE.
101 /* <libintl.h> is taken from "$(top_srcdir)/intl" if system doesn't provide intl */
102 # include <libintl.h>
103 #define _(String) gettext (String)
105 # define N_(String) gettext_noop (String)
107 # define N_(String) (String)
109 #else /* !ENABLE_NLS */
110 /* Stubs that do something close enough. */
111 # define textdomain(String) (String)
112 # define gettext(String) (String)
113 # define dgettext(Domain,Message) (Message)
114 # define dcgettext(Domain,Message,Type) (Message)
115 # define bindtextdomain(Domain,Directory) (Domain)
116 # define _(String) (String)
117 # define N_(String) (String)
118 #endif /* !ENABLE_NLS */
120 #include <glib/gtypes.h> /* for 'gchar' */
121 #define G_LOG_DOMAIN ((const gchar *)"UDPForward")
124 * udpforward_printf_alloca:
125 * @format: Format string. See the sprintf() documentation.
126 * @args...: Arguments for @format. See the sprintf() documentation.
128 * Format the given format string @format as in sprintf().
129 * Output buffer is allocated automatically and it does not need to be deallocated
130 * manually as it is managed by g_alloca().
132 * @Returns: Formatted output string located in g_alloca() memory.
134 #define udpforward_printf_alloca(format,args...) ({ \
135 gsize _udpforward_printf_alloca_size=udpforward_nv_printf_string_upper_bound((format) , ## args); \
136 gchar *_udpforward_printf_alloca_r=g_alloca(_udpforward_printf_alloca_size); \
137 g_snprintf(_udpforward_printf_alloca_r,_udpforward_printf_alloca_size,(format) , ## args); \
138 (const gchar *)_udpforward_printf_alloca_r; \
141 #include <glib/gmessages.h> /* for g_printf_string_upper_bound() */
142 static inline gsize udpforward_nv_printf_string_upper_bound(const gchar *format,...) G_GNUC_PRINTF(1,0) G_GNUC_UNUSED;
143 static inline gsize udpforward_nv_printf_string_upper_bound(const gchar *format,...)
149 r=g_printf_string_upper_bound(format,ap);
154 #endif /* !_UDPFORWARD_CONFIG_H */
157 dnl Do not use PKG_CHECK_MODULES() as it would not set 'GLIB_GENMARSHAL' etc.
158 AM_PATH_GLIB_2_0(,,[AC_MSG_ERROR([UDPForward requires glib-2.0 library.])],[])
159 dnl Force glib for the whole package
160 CFLAGS="$CFLAGS $GLIB_CFLAGS"
161 LIBS="$LIBS $GLIB_LIBS"
164 AC_CHECK_LIB(popt,poptParseArgvString,[POPT_LIBS="-lpopt"],[AC_MSG_ERROR([UDPForward requires popt library.])])
168 ./src/install/acquire/ui-gnome-interface.c
169 ./src/install/acquire/ui-gnome-interface.h
170 ./src/install/acquire/ui-gnome-callbacks.h
171 ./src/install/acquire/ui-gnome-support.c
172 ./src/install/acquire/ui-gnome-support.h
174 AC_SUBST(GNOMEUI_CFLAGS)
175 AC_SUBST(GNOMEUI_LIBS)
176 AM_CONDITIONAL(HAVE_GLADE_WRITESOURCE,[ test "x$PATH_GLADE" != "x" ])
177 dnl Do not: AM_CONDITIONAL(BUILD_GLADESRC,[ test "xyes" = "x$BUILD_GLADESRC" ])
178 dnl as we do not need it as we are conditioned by ENABLE_INSTALL_PKG
180 if test "x$BUILD_GLADESRC_TRUE" = "x"
182 AC_CHECK_LIB(Xi,XOpenDevice,GNOME_ADDON_LIBS="$GNOME_ADDON_LIBS -lXi")
184 AC_SUBST(GNOME_ADDON_LIBS)
189 dnl "Makefile" output files MUST have pathnames incl./excl. "./" prefix as specified!
190 dnl FIXME: Why the rule above was written here?
193 ./src/udpforward.pod.pl
201 dnl FIXME: Why is "po/POTFILES" being substituted?
202 make -C src distfiles DISTFILES_PRINT=1 \
203 |sed -n 's/^:DISTFILES: *\(.*\)$/\1/p'|tr ' ' '\n'|grep . >po/POTFILES.in