]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
r12611@catbus: nickm | 2007-04-30 22:49:00 -0400
authorNick Mathewson <nickm@torproject.org>
Tue, 1 May 2007 02:53:32 +0000 (02:53 +0000)
committerNick Mathewson <nickm@torproject.org>
Tue, 1 May 2007 02:53:32 +0000 (02:53 +0000)
 For reasons which make sense to somebody, I'm sure, mingw gcc wants the libraries to appear at the end of the command line.  This is done by specifying them with LDADD in Makefile.am, not LDFLAGS.
 If anybody can explain to me why mingw thinks "gcc -o foo foo.o -lbar" is fine, whereas "gcc -lbar -o foo foo.o" is Doubleplusbad UnMingwThink, I'd quite appreciate it.  Until then, I'll just do what seems to work, and hope we don't blunder across any other great slumbering cthonian deities of arbitrary syntax.

svn:r10082

configure.in
src/or/Makefile.am
src/tools/Makefile.am

index 79df58d8ccd48fcadd11c448bd9f0f5491a301d2..db95eab0a2520b51bc1feb9a5ad10efff35b9378 100644 (file)
@@ -163,7 +163,9 @@ dnl ------------------------------------------------------
 dnl Where do you live, libevent?  And how do we call you?
 
 if test $bwin32 = true; then
-  TOR_LIB_WS32=-lws2_32 -lwsock32
+  TOR_LIB_WS32=-lws2_32
+  # Some of the cargo-cults recommend -lwsock32 as well, but I don't
+  # think it's actually necessary.
   TOR_LIB_GDI=-lgdi32
 else
   TOR_LIB_WS32=
index 4d4186d966505b9eab3a5a2e05ac213a72045bcc..411c062faf72da612e91ec398c045a17dff4644b 100644 (file)
@@ -13,10 +13,13 @@ tor_SOURCES = buffers.c circuitbuild.c circuitlist.c \
        eventdns.c \
        tor_main.c
 
-tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@ \
-        -lz -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@
-tor_LDADD = ../common/libor.a ../common/libor-crypto.a
+# -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
+# This seems to matter nowhere but on windows, but I assure you that it
+# matters a lot there, and is quite hard to debug if you forget to do it.
 
+tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
+tor_LDADD = ../common/libor.a ../common/libor-crypto.a \
+  -lz -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@
 test_SOURCES = buffers.c circuitbuild.c circuitlist.c \
        circuituse.c command.c config.c \
        connection.c connection_edge.c connection_or.c control.c \
@@ -27,9 +30,9 @@ test_SOURCES = buffers.c circuitbuild.c circuitlist.c \
        test.c
 
 test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
-        @TOR_LDFLAGS_libevent@ -lz -levent -lssl -lcrypto \
-        @TOR_LIB_WS32@ @TOR_LIB_GDI@
-test_LDADD = ../common/libor.a ../common/libor-crypto.a
+        @TOR_LDFLAGS_libevent@
+test_LDADD = ../common/libor.a ../common/libor-crypto.a \
+        -lz -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@
 
 noinst_HEADERS = or.h eventdns.h eventdns_tor.h micro-revision.i
 
index 6d256a54a69db6b0fa3347eb33037fd8f28831dd..7d7f2c7b8f81a5fe826f56b72cfb00b4cd7a098b 100644 (file)
@@ -1,11 +1,12 @@
 bin_PROGRAMS = tor-resolve tor-gencert
 
 tor_resolve_SOURCES = tor-resolve.c
-tor_resolve_LDFLAGS = @TOR_LDFLAGS_libevent@ -levent @TOR_LIB_WS32@
-tor_resolve_LDADD = ../common/libor.a
+tor_resolve_LDFLAGS = @TOR_LDFLAGS_libevent@
+tor_resolve_LDADD = ../common/libor.a -levent @TOR_LIB_WS32@
 
 tor_gencert_SOURCES = tor-gencert.c
 tor_gencert_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
-        @TOR_LDFLAGS_libevent@ -lz -lcrypto -levent \
-        @TOR_LIB_WS32@ @TOR_LIB_GDI@
-tor_gencert_LDADD = ../common/libor.a ../common/libor-crypto.a
+        @TOR_LDFLAGS_libevent@
+tor_gencert_LDADD = ../common/libor.a ../common/libor-crypto.a \
+        -lz -lcrypto -levent @TOR_LIB_WS32@ @TOR_LIB_GDI@
+