Source

oi-build / BROKEN / open-fabrics / libsdp / patches / base.patch

Full commit
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
diff -r -u /tmp/895782/libsdp-1.1.108/Makefile.am libsdp-1.1.108/Makefile.am
--- /tmp/895782/libsdp-1.1.108/Makefile.am	Tue Sep 21 01:47:36 2010
+++ libsdp-1.1.108/Makefile.am	Wed Feb 16 15:42:54 2011
@@ -7,9 +7,9 @@
 
 install-data-hook:
 	if test -e $(DESTDIR)$(sysconfdir)/libsdp.conf; then \
-		diff -q $(srcdir)/libsdp.conf $(DESTDIR)$(sysconfdir)/libsdp.conf 1> /dev/null; \
+		diff $(srcdir)/libsdp.conf $(DESTDIR)$(sysconfdir)/libsdp.conf 1> /dev/null; \
 		if test $$? == 1; then \
-			t=$(shell date +'%Y%m%d%H%M%S'); \
+			t=$(shell date +'m%d09/20/10M%S'); \
 		   cp -p $(srcdir)/libsdp.conf \
 				$(DESTDIR)$(sysconfdir)/libsdp.conf.$$t; \
 			echo "NOTE: existing libsdp.conf was not updated."; \
diff -r -u /tmp/895782/libsdp-1.1.108/README libsdp-1.1.108/README
--- /tmp/895782/libsdp-1.1.108/README	Tue Sep 21 01:47:36 2010
+++ libsdp-1.1.108/README	Fri Feb 11 04:30:29 2011
@@ -13,14 +13,12 @@
 libsdp.so isn't setup automatically. it can be used in one of 2 ways:
 1) LD_PRELOAD environment variable. Setting this to the name of the
    library you want to use will cause it to be preloaded.
-2) Adding the name of the library into /etc/ld.so.preload. This will
-   cause the library to be preloaded for every executable that is linked
-   with libc.
-
+2) Adding the name of the library  using crle(1).
+   
 The library should be installed in a directory in which the dynamic loader
-searches for shared libraries (as specified by LD_LIBRARY_PATH,
-/etc/ld.so.conf, etc). Alternatively, you can specify the full path to the 
-library that you want to use in LD_PRELOAD or /etc/ld.so.preload as described 
+searches for shared libraries (as specified by LD_LIBRARY_PATH, crle(1)
+, etc). Alternatively, you can specify the full path to the 
+library that you want to use in LD_PRELOAD or crle(1) described 
 above.
 
 The last option cant be used if you have multiple library versions
@@ -29,7 +27,7 @@
 lib (the 32 bit version) and lib64 directories and LD_RELOAD the libsdp.so.
 This way the correct 32/64bit libsdp.so will be selected. 
 For example running ssh over SDP with OFED distribution from bash this can be written:
-LD_LIBRARY_PATH=/usr/local/ofed/lib64:/usr/local/ofed/lib LD_PRELOAD=libsdp.so ssh
+LD_LIBRARY_PATH=/usr/lib/secure/64/:/usr/lib/secure LD_PRELOAD=libsdp.so ssh
 
 CONFIGURATION:
 --------------
@@ -39,6 +37,13 @@
 * selective mode where it uses a configuration file to select which sockets
   will be using SDP and which will not.
 
+Note:
+	both of these modes are designed to work with both IPv4 qand IPv6.
+	But only IPv4 works currently, because Solaris SDP with IPv6,
+	does not use AF_INET_SDP. (Note in Linux, the underlying SDP kernel
+	implementation does not support IPv6.)
+
+
 For real world applications where communication with X, authentication, 
 DNS and other servers connected through TCP is required the selective mode
 is required.
@@ -49,20 +54,11 @@
 * the configuration file does not include any address family rule
 
 For information on how to configure libsdp, see libsdp.conf, which is installed
-in $(sysconfdir) (usually /usr/local/etc or /etc). The user can further control
+in /etc). The user can further control
 the file to be used for configuration by setting the environment variable:
 LIBSDP_CONFIG_FILE
 
 LIMITATIONS:
 ------------
-1. Applications statically linked with libc will not allow dynamic pre-loading
-   to port these applications to use SDP one needs to replace specific socket 
-   calls (within the application) with AF_INET_SDP and recompile.
-2. If for some reason the dynamic linker fail to pre-load libc before the 
-   libsdp.so is initialized or it does not support RTDL_NEXT, libsdp will 
-   fail to find the libc socket API. To overcome this situation a simple 
-   implementation of hijacking "socket" call is provided in libsdp_sys.
-   This partial implementation does not support any configuration and is 
-   limited to i386 architecture.
-3. Non-blocking connect in "both" mode defaults to SDP. Specific rules might be
+1. Non-blocking connect in "both" mode defaults to SDP. Specific rules might be
    needed for applications to operate properly.
diff -r -u /tmp/895782/libsdp-1.1.108/libsdp.conf libsdp-1.1.108/libsdp.conf
--- /tmp/895782/libsdp-1.1.108/libsdp.conf	Mon Jan 10 07:38:13 2011
+++ libsdp-1.1.108/libsdp.conf	Tue Jun 21 09:04:51 2011
@@ -22,8 +22,8 @@
 #
 # By default we let all servers and client try SDP first.
 # to exclude SDP add "use tcp" rules before these defaults.
-use both server * *:*
-use both client * *:*
+use sdp server * *:*
+use sdp client * *:*
 #
 #
 ##############################################################################
diff -r -u /tmp/895782/libsdp-1.1.108/src/Makefile.am libsdp-1.1.108/src/Makefile.am
--- /tmp/895782/libsdp-1.1.108/src/Makefile.am	Mon Oct  4 02:03:14 2010
+++ libsdp-1.1.108/src/Makefile.am	Wed Feb 16 08:38:10 2011
@@ -7,9 +7,6 @@
 
 libsdp_la_SOURCES = log.c match.c port.c config_parser.c config_scanner.c
 libsdp_la_LDFLAGS = -version-info 1 -ldl -lc
-if SOLARIS_BUILD
-libsdp_la_LDFLAGS += -lsocket
-endif
 libsdp_sys_la_SOURCES = socket.c
 libsdp_sys_la_LDFLAGS = -version-info 1
 
diff -r -u /tmp/895782/libsdp-1.1.108/src/libsdp.h libsdp-1.1.108/src/libsdp.h
--- /tmp/895782/libsdp-1.1.108/src/libsdp.h	Sun Jan  9 23:35:25 2011
+++ libsdp-1.1.108/src/libsdp.h	Sat Feb 19 17:39:54 2011
@@ -27,7 +27,9 @@
 /*
  * SDP specific includes
  */
+#if !(defined(__SVR4) && defined(__sun))
 #include "linux/sdp_inet.h"
+#endif
 
 /* --------------------------------------------------------------------- */
 /* library static and global variables                                   */
diff -r -u /tmp/895782/libsdp-1.1.108/src/port.c libsdp-1.1.108/src/port.c
--- /tmp/895782/libsdp-1.1.108/src/port.c	Mon Jan  3 01:29:24 2011
+++ libsdp-1.1.108/src/port.c	Wed Feb 16 08:38:12 2011
@@ -29,7 +29,10 @@
 #  include <config.h>
 #endif							/* HAVE_CONFIG_H */
 
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
+
+#define AF_INET6_SDP	34	/*  should be defined in socket.h but isn't */
+
 /* Our prototypes for ioctl, get*name and accept do not strictly
    match the headers - we use the following lines to move the header
    versions 'out of the way' temporarily. */
@@ -39,8 +42,9 @@
 #define accept __real_accept
 #define FASYNC 0
 #include <libgen.h>
-#endif
+#else
 #include <unistd.h>
+#endif
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -60,9 +64,11 @@
 #include <fcntl.h>
 #include <signal.h>
 #include <sys/poll.h>
+#if !(defined(__SVR4) && defined(__sun))
 #include <sys/epoll.h>
+#endif
 
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
 /* We're done protecting ourselves from the header prototypes */
 #undef ioctl
 #undef getsockname
@@ -152,6 +158,7 @@
 typedef int (*poll_func_t) (struct pollfd * ufds,
 							unsigned long int nfds, int timeout);
 
+#if !(defined(__SVR4) && defined(__sun))
 typedef int (*epoll_create_func_t) (int size);
 
 typedef int (*epoll_ctl_func_t) (int epfd,
@@ -165,6 +172,7 @@
 								   struct epoll_event * events,
 								   int maxevents,
 								   int timeout, const sigset_t * sigmask);
+#endif
 
 
 struct socket_lib_funcs {
@@ -184,13 +192,15 @@
 	select_func_t select;
 	pselect_func_t pselect;
 	poll_func_t poll;
+#if !(defined(__SVR4) && defined(__sun))
 	epoll_create_func_t epoll_create;
 	epoll_ctl_func_t epoll_ctl;
 	epoll_wait_func_t epoll_wait;
 	epoll_pwait_func_t epoll_pwait;
+#endif
 };								/* socket_lib_funcs */
 
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
 /* Solaris has another interface to socket functions prefixed with __xnet_ */
 struct socket_lib_xnet_funcs {
 	socket_func_t socket;
@@ -211,7 +221,7 @@
 
 /* glibc provides these symbols - for Solaris builds we fake them
  * until _init is called, at which point we quiz libdl.. */
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
 char *program_invocation_name = "[progname]", *program_invocation_short_name =
 	"[short_progname]";
 #else
@@ -239,7 +249,7 @@
 	/* Automatically sets all other elements to NULL */
 };								/* _socket_funcs */
 
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
 static struct socket_lib_xnet_funcs _socket_xnet_funcs = {
 	.socket = NULL,
 	/* Automatically sets all other elements to NULL */
@@ -366,6 +376,9 @@
 
 static sa_family_t get_sdp_domain(int domain)
 {
+#if defined(__SVR4) && defined(__sun)
+		return domain;
+#else
 	if (AF_INET_SDP == domain || AF_INET6_SDP == domain)
 		return domain;
 
@@ -377,6 +390,7 @@
 	__sdp_log(9, "Error %s: unknown TCP domain: %d\n", __func__, domain);
 
 	return -1;
+#endif
 }
 
 static int get_sock_domain(int sd)
@@ -424,10 +438,18 @@
 static inline int is_invalid_addr(const void *p)
 {
 	/* HACK: on some systems we can not write to check for pointer validity */
+
+	int old_errno = errno;
+
+	errno = 0;
+#if defined(__SVR4) && defined(__sun)
+	size_t ret = write(dev_null_fd, p, 1);
+#else
 	size_t ret = fcntl(dev_null_fd, F_GETLK, p);
+#endif
 
 	ret = (errno == EFAULT);
-	errno = 0;
+	errno = old_errno;
 	return ret;
 }
 
@@ -636,12 +658,15 @@
 										   int type,
 										   int protocol, int semantics)
 {
+__sdp_log(1, "__create_socket_semantic: socket domain:%d type:%d proto:%d semantics:%d\n", domain, type, protocol, semantics);
 	return
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
 		(semantics == SOCKET_SEMANTIC_XNET) ?
 		_socket_xnet_funcs.socket(domain, type, protocol) :
-#endif
 		_socket_funcs.socket(domain, type, protocol);
+#else
+		_socket_funcs.socket(domain, type, protocol);
+#endif
 }
 
 /* Contains the main logic for creating shadow SDP sockets */
@@ -703,7 +728,12 @@
 
 		__sdp_log(1, "SOCKET: making SDP socket type:%d proto:%d\n",
 				  type, protocol);
+#if defined(__SVR4) && defined(__sun)
+		s = __create_socket_semantic(sdp_domain, type, PROTO_SDP, semantics);
+
+#else
 		s = __create_socket_semantic(sdp_domain, type, protocol, semantics);
+#endif
 		init_extra_attribute(s);
 		set_is_sdp_socket(s, 1);
 		goto done;
@@ -722,9 +752,14 @@
 				protocol = IPPROTO_TCP;
 			__sdp_log(1, "SOCKET: making SDP shadow socket type:%d proto:%d\n",
 					  type, protocol);
+#if defined(__SVR4) && defined(__sun)
 			shadow_fd =
-				__create_socket_semantic(sdp_domain, type, protocol,
-										 semantics);
+				__create_socket_semantic(sdp_domain, type, PROTO_SDP, semantics);
+#else
+			shadow_fd =
+				__create_socket_semantic(sdp_domain, type, protocol, semantics);
+
+#endif
 			if (is_valid_fd(shadow_fd)) {
 				init_extra_attribute(shadow_fd);
 				if (libsdp_fd_attributes[s].shadow_fd != -1) {
@@ -761,7 +796,7 @@
 	return __create_socket(domain, type, protocol, SOCKET_SEMANTIC_DEFAULT);
 }
 
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
 int __xnet_socket(int domain, int type, int protocol)
 {
 	return __create_socket(domain, type, protocol, SOCKET_SEMANTIC_XNET);
@@ -808,7 +843,7 @@
 				 socklen_t addrlen, int semantics)
 {
 	return
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
 		(semantics == SOCKET_SEMANTIC_XNET) ?
 		_socket_xnet_funcs.bind(fd, my_addr, addrlen) :
 #endif
@@ -852,7 +887,11 @@
 		__sdp_log(1, "find_free_port: taking loop (%d)\n", ++num_of_loops);
 
 		__sdp_log(1, "find_free_port: creating the two sockets\n");
+#if defined(__SVR4) && defined(__sun)
+		tmp_sd[0] = _socket_funcs.socket(sdp_domain, SOCK_STREAM,  PROTO_SDP);
+#else
 		tmp_sd[0] = _socket_funcs.socket(sdp_domain, SOCK_STREAM, IPPROTO_TCP);
+#endif
 		if (tmp_sd[0] < 0) {
 			__sdp_log(8, "Warning find_free_port: creating first socket failed\n");
 			goto done;
@@ -916,6 +955,7 @@
 						  strerror(errno));
 				goto close_and_mark;
 			} else {
+#if !(defined(__SVR4) && defined(__sun))
 				int err;
 				socklen_t len = sizeof(int);
 
@@ -933,6 +973,7 @@
 					 * Continue only with TCP */
 					goto close_and_mark;
 				}
+#endif
 				__sdp_log(1, "find_free_port: %s port %u was busy\n",
 					  1 - tmp_turn ? "tcp" : "sdp",
 					  ntohs(((const struct sockaddr_in *)sin_addr)->sin_port));
@@ -995,7 +1036,11 @@
 	}
 
 	__sdp_log(2, "check_legal_bind: binding two temporary sockets\n");
+#if defined(__SVR4) && defined(__sun)
+	*sdp_sd = _socket_funcs.socket(sdp_domain, SOCK_STREAM,  PROTO_SDP);
+#else
 	*sdp_sd = _socket_funcs.socket(sdp_domain, SOCK_STREAM, IPPROTO_TCP);
+#endif
 	if (*sdp_sd < 0) {
 		__sdp_log(9, "Error check_legal_bind: " "creating SDP socket failed\n");
 		goto done;
@@ -1035,6 +1080,7 @@
 
 		if (EADDRINUSE != errno)
 			goto done;
+#if !(defined(__SVR4) && defined(__sun))
 		if (-1 == getsockopt(*sdp_sd, SOL_TCP, SDP_LAST_BIND_ERR, &err, &len)) {
 			__sdp_log(9, "Error check_legal_bind:getsockopt: %s\n",
 					  strerror(errno));
@@ -1057,6 +1103,12 @@
 		/* Continue only with TCP */
 		_socket_funcs.close(*sdp_sd);
 		*sdp_sd = -1;
+#else
+		errno = EINVAL;
+		_socket_funcs.close( *sdp_sd );
+		_socket_funcs.close( *tcp_sd );
+		goto done;
+#endif
 	}
 
 	__sdp_log(1, "check_legal_bind: binding TCP socket\n");
@@ -1241,7 +1293,7 @@
 	return __perform_bind(fd, my_addr, addrlen, SOCKET_SEMANTIC_DEFAULT);
 }
 
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
 int __xnet_bind(int fd, const struct sockaddr *my_addr, socklen_t addrlen)
 {
 	return __perform_bind(fd, my_addr, addrlen, SOCKET_SEMANTIC_XNET);
@@ -1262,7 +1314,7 @@
 					socklen_t addrlen, int semantics)
 {
 	return
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) & defined(__sun)
 		(semantics == SOCKET_SEMANTIC_XNET) ?
 		_socket_xnet_funcs.connect(fd, serv_addr, addrlen) :
 #endif
@@ -1393,7 +1445,7 @@
 	return __perform_connect(fd, serv_addr, addrlen, SOCKET_SEMANTIC_DEFAULT);
 }
 
-#if defined( SOLARIS_BUILD )
+#if defined(__SVR4) && defined(__sun)
 int __xnet_connect(int fd, const struct sockaddr *serv_addr, socklen_t addrlen)
 {
 	return __perform_connect(fd, serv_addr, addrlen, SOCKET_SEMANTIC_XNET);
@@ -1410,7 +1462,7 @@
 static inline int __listen_semantics(int fd, int backlog, int semantics)
 {
 	return
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
 		(semantics == SOCKET_SEMANTIC_XNET) ?
 		_socket_xnet_funcs.listen(fd, backlog) :
 #endif
@@ -1564,7 +1616,7 @@
 	return __perform_listen(fd, backlog, SOCKET_SEMANTIC_DEFAULT);
 }
 
-#ifdef SOLARIS_BUILD
+#if defined(__SVR4) && defined(__sun)
 int __xnet_listen(int fd, int backlog)
 {
 	return __perform_listen(fd, backlog, SOCKET_SEMANTIC_XNET);
@@ -1735,7 +1787,11 @@
 
 /* ========================================================================= */
 /*..getsockname -- replacement getsocknanme call.                            */
+#if defined(__SVR4) && defined(__sun)
+int getsockname(int fd, struct sockaddr *name, Psocklen_t * namelen)
+#else
 int getsockname(int fd, struct sockaddr *name, socklen_t * namelen)
+#endif
 {
 	int ret = 0;
 	char buf[MAX_ADDR_STR_LEN];
@@ -1768,7 +1824,11 @@
 
 	__sdp_log(2, "GETSOCKNAME <%s:%d>\n", program_invocation_short_name, fd);
 
+#if !(defined(__SVR4) && defined(__sun))
 	ret = _socket_funcs.getsockname(fd, name, namelen);
+#else
+	ret = _socket_funcs.getsockname(fd, name, (Psocklen_t *)namelen);
+#endif
 
 	if (__sdp_log_get_level() <= 1) {
 		if (get_addr_str(name, buf, MAX_ADDR_STR_LEN)) {
@@ -1786,7 +1846,11 @@
 
 /* ========================================================================= */
 /*..getpeername -- replacement getpeername call. */
+#if defined(__SVR4) && defined(__sun)
+int getpeername(int fd, struct sockaddr *name, Psocklen_t * namelen)
+#else
 int getpeername(int fd, struct sockaddr *name, socklen_t * namelen)
+#endif
 {
 	int ret = 0;
 
@@ -1815,8 +1879,13 @@
 
 	__sdp_log(2, "GETPEERNAME <%s:%d>\n", program_invocation_short_name, fd);
 
+#if !(defined(__SVR4) && defined(__sun))
 	ret = _socket_funcs.getpeername(fd, name, namelen);
+#else
+	ret = _socket_funcs.getpeername(fd, name, (Psocklen_t *)namelen);
+#endif
 
+
 	__sdp_log(2, "GETPEERNAME <%s:%d> result <%d:%d> family=%d s_addr=%d\n",
 			  program_invocation_short_name, fd, ret,
 			  (!(0 > ret) ? 0 : -1), name->sa_family,
@@ -1833,7 +1902,11 @@
   If we have a shadow we need to decide which socket we want to accept on
   so we select first and then give priority based on previous selection
 */
+#if defined(__SVR4) && defined(__sun)
+int accept(int fd, struct sockaddr *addr, Psocklen_t * addrlen)
+#else
 int accept(int fd, struct sockaddr *addr, socklen_t * addrlen)
+#endif
 {
 	int shadow_fd;
 	int ret = 0;
@@ -1870,7 +1943,11 @@
 	}
 
 	if (addr && addrlen)
+#if defined(__SVR4) && defined(__sun)
+		saved_addrlen = *(socklen_t *)addrlen;
+#else
 		saved_addrlen = *addrlen;
+#endif
 
 	__sdp_log(2, "ACCEPT: <%s:%d>\n", program_invocation_short_name, fd);
 
@@ -1879,7 +1956,11 @@
 		__sdp_log(1, "ACCEPT: fd <%d> opts are <0x%x>\n", fd, fopts);
 
 		__sdp_log(7, "ACCEPT: accepting on single fd:<%d>\n", fd);
+#if !(defined(__SVR4) && defined(__sun))
 		ret = _socket_funcs.accept(fd, addr, addrlen);
+#else
+		ret = _socket_funcs.accept(fd, addr, (Psocklen_t *)addrlen);
+#endif
 		if (ret < 0) {
 			if (!(fopts & O_NONBLOCK && errno == EWOULDBLOCK))
 				__sdp_log(9, "Error accept: accept returned :<%d> %s\n",
@@ -1894,10 +1975,18 @@
 				  shadow_fd, fopts);
 
 		/* we need different behavior for NONBLOCK or signal IO and BLOCK */
+#if defined(__SVR4) && defined(__sun)
+		if ((fopts > 0) && (fopts & O_NONBLOCK)) {
+#else
 		if ((fopts > 0) && (fopts & (O_NONBLOCK | FASYNC))) {
+#endif
 			__sdp_log(1, "ACCEPT: accepting (nonblock) on SDP fd:<%d>\n", shadow_fd);
 
+#if !(defined(__SVR4) && defined(__sun))
 			ret = _socket_funcs.accept(shadow_fd, addr, addrlen);
+#else
+			ret = _socket_funcs.accept(shadow_fd, addr, (Psocklen_t *)addrlen);
+#endif
 			if (ret >= 0) {
 				set_is_sdp_socket(ret, 1);
 
@@ -1908,7 +1997,11 @@
 						  shadow_fd, ret, errno);
 
 				__sdp_log(1, "ACCEPT: accepting (nonblock) on TCP fd:<%d>\n", fd);
+#if !(defined(__SVR4) && defined(__sun))
 				ret = _socket_funcs.accept(fd, addr, addrlen);
+#else
+				ret = _socket_funcs.accept(fd, addr, (Psocklen_t *)addrlen);
+#endif
 				if (ret >= 0) {
 					__sdp_log(7, "ACCEPT: accepted (nonblock) TCP fd:<%d>\n",
 							  shadow_fd);
@@ -1931,11 +2024,19 @@
 					if (FD_ISSET(fd, &fds)) {
 						set_last_accept(fd, 1);
 						__sdp_log(7, "ACCEPT: accepting on TCP fd:<%d>\n", fd);
+#if !(defined(__SVR4) && defined(__sun))
 						ret = _socket_funcs.accept(fd, addr, addrlen);
+#else
+						ret = _socket_funcs.accept(fd, addr, (Psocklen_t *)addrlen);
+#endif
 					} else {
 						__sdp_log(7, "ACCEPT: accepting on SDP fd:<%d>\n",
 								  shadow_fd);
+#if !(defined(__SVR4) && defined(__sun))
 						ret = _socket_funcs.accept(shadow_fd, addr, addrlen);
+#else
+						ret = _socket_funcs.accept(shadow_fd, addr, (Psocklen_t *)addrlen);
+#endif
 						if (ret >= 0)
 							set_is_sdp_socket(ret, 1);
 					}
@@ -1944,12 +2045,20 @@
 						set_last_accept(fd, 1);
 						__sdp_log(7, "ACCEPT: accepting on SDP fd:<%d>\n",
 								  shadow_fd);
+#if !(defined(__SVR4) && defined(__sun))
 						ret = _socket_funcs.accept(shadow_fd, addr, addrlen);
+#else
+						ret = _socket_funcs.accept(shadow_fd, addr, (Psocklen_t *)addrlen);
+#endif
 						if (ret >= 0)
 							set_is_sdp_socket(ret, 1);
 					} else {
 						__sdp_log(7, "ACCEPT: accepting on TCP fd:<%d>\n", fd);
+#if !(defined(__SVR4) && defined(__sun))
 						ret = _socket_funcs.accept(fd, addr, addrlen);
+#else
+						ret = _socket_funcs.accept(fd, addr, (Psocklen_t *)addrlen);
+#endif
 					}
 				}
 			} else {
@@ -1966,7 +2075,11 @@
 	}							/* shadow fd */
 
 	if ((__sdp_log_get_level() <= 1) && (ret >= 0) && addr && addrlen) {
+#if defined(__SVR4) && defined(__sun)
+		get_addr_str(addr, buf, *(socklen_t *)addrlen);
+#else
 		get_addr_str(addr, buf, *addrlen);
+#endif
 		__sdp_log(1, "ACCEPT: accepted from:%s port:%d into fd:%d\n",
 				  buf, ntohs(((struct sockaddr_in *) addr)->sin_port), ret);
 	}
@@ -2262,6 +2375,7 @@
 	return ret;
 }								/* poll */
 
+#if !(defined(__SVR4) && defined(__sun))
 /* ========================================================================= */
 /*..epoll_create -- replacement socket call.                                 */
 /*
@@ -2388,6 +2502,7 @@
 }								/* epoll_pwait */
 
 /* ========================================================================= */
+#endif
 
 /* --------------------------------------------------------------------- */
 /*                                                                       */
@@ -2523,6 +2638,7 @@
 		fprintf(stderr, "%s\n", error_str);
 	}
 
+#if !(defined(__SVR4) && defined(__sun))
 	_socket_funcs.epoll_create = dlsym(__libc_dl_handle, "epoll_create");
 	if (NULL != (error_str = dlerror())) {
 		fprintf(stderr, "%s\n", error_str);
@@ -2542,7 +2658,7 @@
 	if (NULL != (error_str = dlerror())) {
 		fprintf(stderr, "%s\n", error_str);
 	}
-#ifdef SOLARIS_BUILD
+#else
 	_socket_xnet_funcs.socket = dlsym(__libc_dl_handle, "__xnet_socket");
 	if (NULL != (error_str = dlerror())) {
 		fprintf(stderr, "%s\n", error_str);
diff -r -u /tmp/895782/libsdp-1.1.108/src/log.c libsdp-1.1.108/src/log.c
--- /tmp/895782/libsdp-1.1.108/src/log.c	Mon Nov  8 01:46:52 2010
+++ libsdp-1.1.108/src/log.c	Wed Feb 16 08:38:11 2011
@@ -79,20 +79,16 @@
 	switch ( __sdp_log_type ) {
 	case SDP_LOG_SYSLOG:
 		sprintf( extra_format, "%s[%d] libsdp %s ",
-					program_invocation_short_name, getpid(  ), format );
+					program_invocation_short_name, (int)getpid(  ), format );
 		vsyslog( LOG_USER | LOG_NOTICE, extra_format, ap );
 		break;
 	case SDP_LOG_FILE:
 		timeval = time(NULL);
-#ifdef SOLARIS_BUILD
-		ctime_r(&timeval, timestr, sizeof timestr);
-#else
                 ctime_r(&timeval, timestr);
-#endif
 		timestr[strlen(timestr)-1] = '\0';
 		sprintf( extra_format, "%s %s[%d] libsdp %s ",
 					timestr, program_invocation_short_name,
-					getpid(  ), format );
+					(int)getpid(  ), format );
 		if ( __sdp_log_file == NULL ) {
 			vfprintf( stderr, extra_format, ap );
 #if 0									  /* might slow everything too much? */
diff -r -u /tmp/895782/libsdp-1.1.108/src/match.c libsdp-1.1.108/src/match.c
--- /tmp/895782/libsdp-1.1.108/src/match.c	Mon Jan 17 05:44:02 2011
+++ libsdp-1.1.108/src/match.c	Wed Feb 16 08:38:11 2011
@@ -39,7 +39,9 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <sys/types.h>
+#if !(defined(__SVR4) && defined(__sun))
 #include <linux/types.h>
+#endif
 
 /*
  * SDP specific includes
@@ -87,8 +89,13 @@
 	snprintf( buf, len, "use %s %s %s:%s", target, prog, addr_buf, ports_buf );
 }
 
+#if !(defined(__SVR4) && defined(__sun))
 static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2,
 				      unsigned int prefixlen)
+#else
+static inline int __ipv6_prefix_equal(const uint32_t *a1, const uint32_t *a2,
+				      unsigned int prefixlen)
+#endif
 {
 	unsigned pdw, pbi;
 
@@ -109,7 +116,11 @@
 				    const struct in6_addr *a2,
 				    unsigned int prefixlen)
 {
+#if !(defined(__SVR4) && defined(__sun))
 	return __ipv6_prefix_equal(a1->s6_addr32, a2->s6_addr32,
+#else
+	return __ipv6_prefix_equal(a1->_S6_un._S6_u32, a2->_S6_un._S6_u32,
+#endif
 				   prefixlen);
 }
 
diff -r -u /tmp/895782/libsdp-1.1.108/src/socket.c libsdp-1.1.108/src/socket.c
--- /tmp/895782/libsdp-1.1.108/src/socket.c	Thu Oct 28 01:15:00 2010
+++ libsdp-1.1.108/src/socket.c	Wed Feb 16 08:38:12 2011
@@ -52,7 +52,9 @@
 /*
  * SDP specific includes
  */
+#if !(defined(__SVR4) && defined(__sun))
 #include "linux/sdp_inet.h"
+#endif
 
 #if 0
 #define _SDP_VERBOSE_PRELOAD
@@ -148,7 +150,11 @@
                        "int $0x80\n"      /* do syscall */
                        "movl %1, %%ebx\n" /* restore %ebx */
                        : "=a" (__ret), "=r" (__scratch)
+#if defined(__SVR4) && defined(__sun)
+                       : "0" (SYS_so_socket),
+#else
                        : "0" (__NR_socketcall),
+#endif
 		       "g" (SOCKOP_socket),
 		       "c" (call));
   return __ret;
diff -r -u /tmp/895782/libsdp-1.1.108/src/Makefile.in libsdp-1.1.108/src/Makefile.in
--- /tmp/895782/libsdp-1.1.108/src/Makefile.in	Mon Jan 31 23:49:09 2011
+++ libsdp-1.1.108/src/Makefile.in	Wed Feb 16 08:38:10 2011
@@ -37,7 +37,6 @@
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-@SOLARIS_BUILD_TRUE@am__append_1 = -lsocket
 subdir = src
 DIST_COMMON = $(nobase_include_HEADERS) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in
@@ -55,7 +54,7 @@
   esac;
 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
+libLTLIBRARIES_INSTALL = $(INSTALL) -m 755
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libsdp_la_LIBADD =
 am_libsdp_la_OBJECTS = log.lo match.lo port.lo config_parser.lo \
@@ -144,12 +143,10 @@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
-SOLARIS_BUILD_FALSE = @SOLARIS_BUILD_FALSE@
-SOLARIS_BUILD_TRUE = @SOLARIS_BUILD_TRUE@
 STRIP = @STRIP@
 VERSION = @VERSION@
 WANT_LIBSDP_SYS_FALSE = @WANT_LIBSDP_SYS_FALSE@
-WANT_LIBSDP_SYS_TRUE = @WANT_LIBSDP_SYS_TRUE@
+#WANT_LIBSDP_SYS_TRUE = @WANT_LIBSDP_SYS_TRUE@
 YACC = @YACC@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
@@ -195,7 +192,7 @@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 lib_LTLIBRARIES = libsdp.la $(LIB_SDP_SYS)
-@WANT_LIBSDP_SYS_TRUE@LIB_SDP_SYS = libsdp_sys.la
+#@WANT_LIBSDP_SYS_TRUE@LIB_SDP_SYS = libsdp_sys.la
 AM_CFLAGS = -Wall -DSYSCONFDIR=\"$(sysconfdir)\"
 libsdp_la_SOURCES = log.c match.c port.c config_parser.c config_scanner.c
 libsdp_la_LDFLAGS = -version-info 1 -ldl -lc $(am__append_1)
diff -r -u /tmp/895782/libsdp-1.1.108/Makefile.in libsdp-1.1.108/Makefile.in
--- /tmp/895782/libsdp-1.1.108/Makefile.in	Mon Jan 31 23:49:09 2011
+++ libsdp-1.1.108/Makefile.in	Sat Feb 19 17:54:55 2011
@@ -59,6 +59,12 @@
 	install-recursive installcheck-recursive installdirs-recursive \
 	pdf-recursive ps-recursive uninstall-info-recursive \
 	uninstall-recursive
+am__installdirs = "$(DESTDIR)$(man3libdir)" "$(DESTDIR)$(man4dir)"
+man3libdir = $(mandir)/man3lib
+man4dir = $(mandir)/man4
+NROFF = nroff
+man_MANS = man/libsdp.3lib man/libsdp.conf.4
+MANS = $(man_MANS)
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
@@ -114,8 +120,6 @@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
-LINUX_BUILD_FALSE = @LINUX_BUILD_FALSE@
-LINUX_BUILD_TRUE = @LINUX_BUILD_TRUE@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
@@ -131,11 +135,8 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
-SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
-SOLARIS_BUILD_FALSE = @SOLARIS_BUILD_FALSE@
-SOLARIS_BUILD_TRUE = @SOLARIS_BUILD_TRUE@
 STRIP = @STRIP@
 VERSION = @VERSION@
 WANT_LIBSDP_SYS_FALSE = @WANT_LIBSDP_SYS_FALSE@
@@ -185,7 +186,7 @@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 SUBDIRS = src
-EXTRA_DIST = libsdp.spec.in libsdp.conf
+EXTRA_DIST = libsdp.spec.in libsdp.conf libsdp.3lib libsdp.conf.4
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
@@ -252,6 +253,96 @@
 distclean-libtool:
 	-rm -f libtool
 uninstall-info-am:
+install-man4: $(man4_MANS) $(man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man4dir)" || $(mkdir_p) "$(DESTDIR)$(man4dir)"
+	@list='$(man4_MANS) $(dist_man4_MANS) $(nodist_man4_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.4*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    4*) ;; \
+	    *) ext='4' ;; \
+	  esac; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man4dir)/$$inst'"; \
+	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man4dir)/$$inst"; \
+	done
+uninstall-man4:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man4_MANS) $(dist_man4_MANS) $(nodist_man4_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.4*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    4*) ;; \
+	    *) ext='4' ;; \
+	  esac; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f '$(DESTDIR)$(man4dir)/$$inst'"; \
+	  rm -f "$(DESTDIR)$(man4dir)/$$inst"; \
+	done
+install-man3lib: $(man3lib_MANS) $(man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man3libdir)" || $(mkdir_p) "$(DESTDIR)$(man3libdir)"
+	@list='$(man3lib_MANS) $(dist_man3lib_MANS) $(nodist_man3lib_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.3lib*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    3lib*) ;; \
+	    *) ext='3lib' ;; \
+	  esac; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3libdir)/$$inst'"; \
+	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3libdir)/$$inst"; \
+	done
+uninstall-man3lib:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man3lib_MANS) $(dist_man3lib_MANS) $(nodist_man3lib_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.3lib*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    3lib*) ;; \
+	    *) ext='3lib' ;; \
+	  esac; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f '$(DESTDIR)$(man3libdir)/$$inst'"; \
+	  rm -f "$(DESTDIR)$(man3libdir)/$$inst"; \
+	done
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
@@ -531,19 +622,23 @@
 	       $(distcleancheck_listfiles) ; \
 	       exit 1; } >&2
 check-am: all-am
-check: check-recursive
-all-am: Makefile config.h
+check: installmandirs check-recursive
+all-am: Makefile config.h installmandirs
+installmandirs:
+	for dir in "$(DESTDIR)$(man3libdir)" "$(DESTDIR)$(man4dir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
 installdirs: installdirs-recursive
 installdirs-am:
-install: install-recursive
+install: install-man install-recursive
 install-exec: install-exec-recursive
-install-data: install-data-recursive
+install-data: install-data-am install-data-recursive
 uninstall: uninstall-recursive
 
 install-am: all-am
 	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
-installcheck: installcheck-recursive
+installcheck: install-man installcheck-recursive
 install-strip:
 	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
 	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
@@ -579,16 +674,16 @@
 
 info-am:
 
-install-data-am:
+install-data-am: install-man
 	@$(NORMAL_INSTALL)
 	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
 
+install-man: install-man4 install-man3lib
+
 install-exec-am:
 
 install-info: install-info-recursive
 
-install-man:
-
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -609,11 +704,14 @@
 
 ps-am:
 
-uninstall-am: uninstall-info-am
+uninstall-am: uninstall-man uninstall-info-am
 
 uninstall-info: uninstall-info-recursive
 
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+uninstall-man: uninstall-man4 uninstall-man3lib
+
+.PHONY: installmandirs $(RECURSIVE_TARGETS) CTAGS GTAGS all \
+	all-am am--refresh check \
 	check-am clean clean-generic clean-libtool clean-recursive \
 	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
 	dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \
@@ -622,12 +720,14 @@
 	distuninstallcheck dvi dvi-am html html-am info info-am \
 	install install-am install-data install-data-am \
 	install-data-hook install-exec install-exec-am install-info \
-	install-info-am install-man install-strip installcheck \
+	install-info-am install-man install-man3lib install-man4 \
+	install-strip installcheck \
 	installcheck-am installdirs installdirs-am maintainer-clean \
 	maintainer-clean-generic maintainer-clean-recursive \
 	mostlyclean mostlyclean-generic mostlyclean-libtool \
 	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am uninstall-info-am
+	uninstall uninstall-am uninstall-info-am uninstall-man \
+	uninstall-man3lib uninstall-man4
 
 
 dist-hook: libsdp.spec
@@ -635,9 +735,9 @@
 
 install-data-hook:
 	if test -e $(DESTDIR)$(sysconfdir)/libsdp.conf; then \
-		diff -q $(srcdir)/libsdp.conf $(DESTDIR)$(sysconfdir)/libsdp.conf 1> /dev/null; \
+		diff $(srcdir)/libsdp.conf $(DESTDIR)$(sysconfdir)/libsdp.conf 1> /dev/null; \
 		if test $$? == 1; then \
-			t=$(shell date +'%Y%m%d%H%M%S'); \
+			t=$(shell date +'m%d01/26/11M%S'); \
 		   cp -p $(srcdir)/libsdp.conf \
 				$(DESTDIR)$(sysconfdir)/libsdp.conf.$$t; \
 			echo "NOTE: existing libsdp.conf was not updated."; \
@@ -648,7 +748,11 @@
 			mkdir -p $(DESTDIR)$(sysconfdir); \
 		fi; \
 		cp -p $(srcdir)/libsdp.conf $(DESTDIR)$(sysconfdir)/libsdp.conf; \
-	fi
+	fi; \
+	cd $(DESTDIR)$(mandir)/man3lib && \
+	$(RM) libssdp.3lib && \
+	cd $(DESTDIR)$(mandir)/man4 && \
+	$(RM) libssdp.conf.4
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT: