Link to winsock2 under mingw (needed for ntohl).
1.1 --- a/configure.ac Thu Jan 08 16:54:05 2009 +0000
1.2 +++ b/configure.ac Thu Jan 08 17:12:28 2009 +0000
1.3 @@ -36,11 +36,13 @@
1.4 case $host_os in
1.5 *mingw*) AC_DEFINE([MSWIN_API], 1,
1.6 [Define to 1 to use Microsoft Windows native API.])
1.7 + EXTRA_LIBS='-lws2_32'
1.8 mswin_api=yes;;
1.9 *) mswin_api=no;;
1.10 esac
1.11 AC_MSG_RESULT([$mswin_api])
1.12 AM_CONDITIONAL(MSWIN_API, test "$mswin_api" = "yes")
1.13 +AC_SUBST(EXTRA_LIBS)
1.14
1.15 # Taken from dbus
1.16 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
2.1 --- a/data/razor.pc.in Thu Jan 08 16:54:05 2009 +0000
2.2 +++ b/data/razor.pc.in Thu Jan 08 17:12:28 2009 +0000
2.3 @@ -7,6 +7,6 @@
2.4 Description: library for depsolving, installing and removing packages
2.5 Version: @VERSION@
2.6 Requires: libcurl
2.7 -Libs: -L${libdir} -lexpat -lz -lrazor
2.8 +Libs: -L${libdir} -lexpat -lz -lrazor @EXTRA_LIBS@
2.9 Cflags: -I${includedir}/razor
2.10
3.1 --- a/librazor/Makefile.am Thu Jan 08 16:54:05 2009 +0000
3.2 +++ b/librazor/Makefile.am Thu Jan 08 17:12:28 2009 +0000
3.3 @@ -31,7 +31,7 @@
3.4 merger.c \
3.5 transaction.c
3.6
3.7 -librazor_la_LIBADD = $(ZLIB_LIBS) ../gl/libgnu.la
3.8 +librazor_la_LIBADD = $(ZLIB_LIBS) ../gl/libgnu.la $(EXTRA_LIBS)
3.9
3.10 clean-local :
3.11 rm -f *~
4.1 --- a/librazor/rpm.c Thu Jan 08 16:54:05 2009 +0000
4.2 +++ b/librazor/rpm.c Thu Jan 08 17:12:28 2009 +0000
4.3 @@ -33,7 +33,7 @@
4.4 #include <dirent.h>
4.5 #include <unistd.h>
4.6 #if MSWIN_API
4.7 -#include <winsock.h> /* For ntohl() */
4.8 +#include <winsock2.h> /* For ntohl() */
4.9 #else
4.10 #include <arpa/inet.h>
4.11 #endif
5.1 --- a/src/Makefile.am Thu Jan 08 16:54:05 2009 +0000
5.2 +++ b/src/Makefile.am Thu Jan 08 17:12:28 2009 +0000
5.3 @@ -22,13 +22,13 @@
5.4 if HAVE_RPMLIB
5.5 razor_SOURCES += import-rpmdb.c
5.6 endif
5.7 -razor_LDADD = $(RPM_LIBS) $(EXPAT_LIBS) $(CURL_LIBS) $(top_builddir)/librazor/librazor.la $(top_builddir)/gl/libgnu.la
5.8 +razor_LDADD = $(RPM_LIBS) $(EXPAT_LIBS) $(CURL_LIBS) $(top_builddir)/librazor/librazor.la $(top_builddir)/gl/libgnu.la $(EXTRA_LIBS)
5.9
5.10 rpm_SOURCES = rpm.c
5.11 -rpm_LDADD = $(top_builddir)/librazor/librazor.la
5.12 +rpm_LDADD = $(top_builddir)/librazor/librazor.la $(EXTRA_LIBS)
5.13
5.14 test_driver_SOURCES = test-driver.c
5.15 -test_driver_LDADD = $(EXPAT_LIBS) $(top_builddir)/librazor/librazor.la
5.16 +test_driver_LDADD = $(EXPAT_LIBS) $(top_builddir)/librazor/librazor.la $(EXTRA_LIBS)
5.17
5.18 TESTS = test-driver
5.19