Include winsock.h rather than arpa/inet.h on mingw platforms.
Also fix a trivial int/long mismatch.
1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(razor, 0.1, krh@redhat.com)
5 AM_INIT_AUTOMAKE(razor, 0.1)
6 AM_CONFIG_HEADER(config.h)
9 # libtool versioning - this applies to all libraries in this package
11 # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
25 AC_CHECK_HEADERS([sys/mman.h])
27 AC_CHECK_FUNCS([symlink chroot])
34 AC_MSG_CHECKING([for Microsoft Windows native API])
36 *mingw*) AC_DEFINE([MSWIN_API], 1,
37 [Define to 1 to use Microsoft Windows native API.])
41 AC_MSG_RESULT([$mswin_api])
42 AM_CONDITIONAL(MSWIN_API, test "$mswin_api" = "yes")
45 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
46 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
48 if test "${enable_verbose_mode}" != no; then
49 # To get -rdynamic you pass -export-dynamic to libtool.
50 AC_DEFINE(BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
51 R_DYNAMIC_LDFLAG=-export-dynamic
55 AC_SUBST(R_DYNAMIC_LDFLAG)
57 #### gcc warning flags
59 if test "x$GCC" = "xyes"; then
62 *[\ \ ]-Wall[\ \ ]*) ;;
63 *) CFLAGS="$CFLAGS -Wall" ;;
67 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
68 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
72 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
73 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
77 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
78 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
82 *[\ \ ]-Wcast-align[\ \ ]*) ;;
83 *) CFLAGS="$CFLAGS -Wcast-align" ;;
87 *[\ \ ]-Wformat[\ \ ]*) ;;
88 *) CFLAGS="$CFLAGS -Wformat" ;;
92 *[\ \ ]-Wformat-security[\ \ ]*) ;;
93 *) CFLAGS="$CFLAGS -Wformat-security" ;;
96 if test "x$enable_ansi" = "xyes"; then
98 *[\ \ ]-ansi[\ \ ]*) ;;
99 *) CFLAGS="$CFLAGS -ansi" ;;
103 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
104 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
108 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
109 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
113 *[\ \ ]-pedantic[\ \ ]*) ;;
114 *) CFLAGS="$CFLAGS -pedantic" ;;
121 # gcc default visibility stuff
124 AC_MSG_CHECKING(for -fvisibility)
126 #if defined(__GNUC__) && (__GNUC__ >= 4)
128 #error Need GCC 4.0 for visibility
130 int main () { return 0; }
133 if test "x$have_gcc4" = "xyes"; then
134 CFLAGS="$CFLAGS -fvisibility=hidden"
136 AC_MSG_RESULT($have_gcc4)
140 [AS_HELP_STRING([--without-curl], [disable support for curl])],
146 AS_IF([test "x$with_curl" != xno],
147 [PKG_CHECK_MODULES(CURL, [libcurl])
148 AC_DEFINE([HAVE_CURL], [1], [Define if you have curl])])
149 AC_SUBST(CURL_CFLAGS)
153 AC_ARG_WITH(zlib, [ --with-zlib=<dir> Use zlib from here],
156 CPPFLAGS="$CPPFLAGS -I$withval/include"
157 LDFLAGS="$LDFLAGS -L$withval/lib"
160 AC_CHECK_HEADERS(zlib.h, [AC_DEFINE(HAVE_ZLIB_H)],
161 [AC_MSG_ERROR([Can't find zlib.h. Please install zlib.])])
162 AC_CHECK_LIB(z, inflate, [ZLIB_LIBS="-lz"],
163 [AC_MSG_ERROR([Can't find zlib library. Please install zlib.])])
167 AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
170 CPPFLAGS="$CPPFLAGS -I$withval/include"
171 LDFLAGS="$LDFLAGS -L$withval/lib"
174 AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
175 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
176 AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
177 [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
181 AC_ARG_WITH(rpm, [ --with-rpm=<dir> Use rpm from here])
183 AS_IF([test "$with_rpm" != no],
184 [if test "$with_rpm" != yes; then
185 CPPFLAGS="$CPPFLAGS -I$with_rpm/include"
186 LDFLAGS="$LDFLAGS -L$with_rpm/lib"
188 AC_CHECK_HEADERS(rpm/rpmlib.h, [],
189 [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])])
190 AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
191 [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])])
192 AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])])
194 AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"])
196 if test "x$GCC" = "xyes"; then
197 LDFLAGS="-Wl,--as-needed $LDFLAGS"
200 # *****************************
201 # Make available to Makefile.am
202 # *****************************
203 AC_SUBST(SYSCONFDIR, $sysconfdir)
205 # ********************
206 # Internationalisation
207 # ********************
209 IT_PROG_INTLTOOL([0.35.0])
210 GETTEXT_PACKAGE=razor
211 AC_SUBST([GETTEXT_PACKAGE])
213 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
229 dnl ==========================================================================
236 libexecdir: ${libexecdir}
240 sysconfdir: ${sysconfdir}
241 localstatedir: ${localstatedir}
246 Maintainer mode: ${USE_MAINTAINER_MODE}
247 Building verbose mode: ${enable_verbose_mode}
248 Building gtk-doc: ${enable_gtk_doc}