Link to winsock2 under mingw (needed for ntohl).
authorJ. Ali Harlow <ali@juiblex.co.uk>
Thu, 8 Jan 2009 17:12:28 +0000 (17:12 +0000)
committerJ. Ali Harlow <ali@juiblex.co.uk>
Thu, 8 Jan 2009 17:12:28 +0000 (17:12 +0000)
configure.ac
data/razor.pc.in
librazor/Makefile.am
librazor/rpm.c
src/Makefile.am

index 88b6bb2..6527b25 100644 (file)
@@ -36,11 +36,13 @@ AC_MSG_CHECKING([for Microsoft Windows native API])
 case $host_os in
     *mingw*)   AC_DEFINE([MSWIN_API], 1,
                  [Define to 1 to use Microsoft Windows native API.])
+               EXTRA_LIBS='-lws2_32'
                mswin_api=yes;;
     *)         mswin_api=no;;
 esac
 AC_MSG_RESULT([$mswin_api])
 AM_CONDITIONAL(MSWIN_API, test "$mswin_api" = "yes")
+AC_SUBST(EXTRA_LIBS)
 
 # Taken from dbus
 AC_ARG_ENABLE(ansi,             [  --enable-ansi           enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
index 7f9121e..543dce0 100644 (file)
@@ -7,6 +7,6 @@ Name: razor
 Description: library for depsolving, installing and removing packages
 Version: @VERSION@
 Requires: libcurl
-Libs: -L${libdir} -lexpat -lz -lrazor
+Libs: -L${libdir} -lexpat -lz -lrazor @EXTRA_LIBS@
 Cflags: -I${includedir}/razor
 
index c3a5ebb..ead4f92 100644 (file)
@@ -31,7 +31,7 @@ librazor_la_SOURCES =                                 \
        merger.c                                        \
        transaction.c
 
-librazor_la_LIBADD = $(ZLIB_LIBS) ../gl/libgnu.la
+librazor_la_LIBADD = $(ZLIB_LIBS) ../gl/libgnu.la $(EXTRA_LIBS)
 
 clean-local :
        rm -f *~
index 211b584..6143469 100644 (file)
@@ -33,7 +33,7 @@
 #include <dirent.h>
 #include <unistd.h>
 #if MSWIN_API
-#include <winsock.h>   /* For ntohl() */
+#include <winsock2.h>  /* For ntohl() */
 #else
 #include <arpa/inet.h>
 #endif
index 465d27a..80409c1 100644 (file)
@@ -22,13 +22,13 @@ razor_SOURCES = main.c import-yum.c
 if HAVE_RPMLIB
 razor_SOURCES += import-rpmdb.c
 endif
-razor_LDADD = $(RPM_LIBS) $(EXPAT_LIBS) $(CURL_LIBS) $(top_builddir)/librazor/librazor.la $(top_builddir)/gl/libgnu.la
+razor_LDADD = $(RPM_LIBS) $(EXPAT_LIBS) $(CURL_LIBS) $(top_builddir)/librazor/librazor.la $(top_builddir)/gl/libgnu.la $(EXTRA_LIBS)
 
 rpm_SOURCES = rpm.c
-rpm_LDADD = $(top_builddir)/librazor/librazor.la
+rpm_LDADD = $(top_builddir)/librazor/librazor.la $(EXTRA_LIBS)
 
 test_driver_SOURCES = test-driver.c
-test_driver_LDADD = $(EXPAT_LIBS) $(top_builddir)/librazor/librazor.la
+test_driver_LDADD = $(EXPAT_LIBS) $(top_builddir)/librazor/librazor.la $(EXTRA_LIBS)
 
 TESTS = test-driver