Removed wrong errno setting.
[silc.git] / lib / Makefile.ad
index 79473f739e9ba25f51fb969674858278f64117fa..9f3cb4671acfe2071bbb4107c951ee8275c2210c 100644 (file)
@@ -3,7 +3,7 @@
 #
 #  Author: Pekka Riikonen <priikone@silcnet.org>
 #
-#  Copyright (C) 2000 - 2005 Pekka Riikonen
+#  Copyright (C) 2000 - 2007 Pekka Riikonen
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -56,15 +56,29 @@ SILCLIB_DIRS =              \
 #endif SILC_DIST_SSH
 
 if SILC_ENABLE_SHARED
+if SILC_WIN32
+LIBTOOL_OPTS= -release $(LIB_BASE_VERSION) -rpath $(DESTDIR)$(libdir) -export-dynamic -no-undefined
+else
 LIBTOOL_OPTS= -release $(LIB_BASE_VERSION) -rpath $(DESTDIR)$(libdir)
+endif
 LIBTOOL_SILC_VERSION = -version-info $(LIBSILC_CURRENT):$(LIBSILC_REVISION):$(LIBSILC_AGE)
 LIBTOOL_SILCCLIENT_VERSION = -version-info $(LIBSILCCLIENT_CURRENT):$(LIBSILCCLIENT_REVISION):$(LIBSILCCLIENT_AGE)
 LIBTOOL_SILCSERVER_VERSION = -version-info $(LIBSILCSERVER_CURRENT):$(LIBSILCSERVER_REVISION):$(LIBSILCSERVER_AGE)
 else
 LIBTOOL_OPTS=
-LIBTOOL_SILC_VERSION = 
-LIBTOOL_SILCCLIENT_VERSION = 
-LIBTOOL_SILCSERVER_VERSION = 
+LIBTOOL_SILC_VERSION =
+LIBTOOL_SILCCLIENT_VERSION =
+LIBTOOL_SILCSERVER_VERSION =
+endif
+
+if SILC_WIN32
+SILC_LINK_LIBS=$(LIBS)
+SILCCLIENT_LINK_LIBS=$(LIBS) -lsilc
+SILCSERVER_LIBS=$(LIBS) -lsilc
+else
+SILC_LINK_LIBS=
+SILCCLIENT_LINK_LIBS=
+SILCSERVER_LIBS=
 endif
 
 SILCLIB = libsilc.a
@@ -134,7 +148,7 @@ LIBSILC_AGE=@LIBSILC_AGE@
 
 libsilc.a:
        find $(SILCLIB_DIRS) -type f -name *.lo | xargs \
-       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
+       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(SILC_LINK_LIBS) \
        $(LIBTOOL_SILC_VERSION) \
        $(LIBTOOL_OPTS) -o libsilc.la
 
@@ -146,7 +160,7 @@ LIBSILCCLIENT_AGE=@LIBSILCCLIENT_AGE@
 libsilcclient.a:
        find $(SILCCLIENTLIB_DIRS) -type f -name *.lo | xargs \
        $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
-       $(LIBTOOL_SILCCLIENT_VERSION) \
+       $(SILCCLIENT_LINK_LIBS) $(LIBTOOL_SILCCLIENT_VERSION) \
        $(LIBTOOL_OPTS) -o libsilcclient.la
 #endif SILC_DIST_CLIENTLIB
 
@@ -157,7 +171,7 @@ LIBSILCSERVER_AGE=@LIBSILCSERVER_AGE@
 
 libsilcserver.a:
        find $(SILCSERVERLIB_DIRS) -type f -name *.lo | xargs \
-       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
+       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(SILCSERVER_LIBS) \
        $(LIBTOOL_SILCSERVER_VERSION) \
        $(LIBTOOL_OPTS) -o libsilcserver.la
 #endif SILC_DIST_SERVERLIB