| @@ -1,15 +1,157 @@ | | | @@ -1,15 +1,157 @@ |
1 | $NetBSD: patch-librhash_Makefile,v 1.3 2023/07/18 06:13:51 adam Exp $ | | 1 | $NetBSD: patch-librhash_Makefile,v 1.4 2024/05/14 14:37:48 nia Exp $ |
2 | | | 2 | |
3 | Make ar(1) flags compatible with SunOS | | 3 | libtoolize. |
4 | | | 4 | |
5 | --- librhash/Makefile.orig 2023-07-14 13:06:29.000000000 +0000 | | 5 | --- librhash/Makefile.orig 2023-07-14 13:06:29.000000000 +0000 |
6 | +++ librhash/Makefile | | 6 | +++ librhash/Makefile |
7 | @@ -187,7 +187,7 @@ $(LIBRHASH_SHARED): $(SOURCES) $(EXPORTS | | 7 | @@ -4,7 +4,7 @@ include config.mak |
| | | 8 | |
| | | 9 | HEADERS = algorithms.h byte_order.h plug_openssl.h rhash.h rhash_torrent.h aich.h blake2b.h blake2s.h crc32.h ed2k.h edonr.h hex.h md4.h md5.h sha1.h sha256.h sha512.h sha3.h ripemd-160.h gost12.h gost94.h has160.h snefru.h tiger.h tth.h torrent.h ustd.h util.h whirlpool.h |
| | | 10 | SOURCES = algorithms.c byte_order.c plug_openssl.c rhash.c rhash_torrent.c aich.c blake2b.c blake2s.c crc32.c ed2k.c edonr.c hex.c md4.c md5.c sha1.c sha256.c sha512.c sha3.c ripemd-160.c gost12.c gost94.c has160.c snefru.c tiger.c tiger_sbox.c tth.c torrent.c util.c whirlpool.c whirlpool_sbox.c |
| | | 11 | -OBJECTS = $(SOURCES:.c=.o) |
| | | 12 | +OBJECTS = $(SOURCES:.c=.lo) |
| | | 13 | LIB_HEADERS = rhash.h rhash_torrent.h |
| | | 14 | TEST_STATIC = test_static$(EXEC_EXT) |
| | | 15 | TEST_SHARED = test_shared$(EXEC_EXT) |
| | | 16 | @@ -26,10 +26,7 @@ install-lib-static: $(LIBRHASH_STATIC) |
| | | 17 | |
| | | 18 | install-lib-shared: $(LIBRHASH_SHARED) $(EXTRA_INSTALL_LIBSHARED) |
| | | 19 | $(INSTALL) -d $(SO_DIR) |
| | | 20 | - $(INSTALL_SHARED) $(LIBRHASH_SHARED) $(SO_DIR)/ |
| | | 21 | - test "x$(LIBRHASH_SO_MAJ)" != "x$(LIBRHASH_SHARED)" && \ |
| | | 22 | - rm -f $(LIBDIR)/$(LIBRHASH_SO_MAJ) && \ |
| | | 23 | - ln -s $(LIBRHASH_SHARED) $(LIBDIR)/$(LIBRHASH_SO_MAJ) |
| | | 24 | + $(LIBTOOL) --mode=install --tag=CC $(INSTALL_SHARED) $(LIBRHASH_SHARED) $(SO_DIR)/ |
| | | 25 | |
| | | 26 | install-implib: |
| | | 27 | $(INSTALL) -d $(LIBDIR) |
| | | 28 | @@ -59,115 +56,10 @@ install-lib-headers: |
| | | 29 | uninstall-lib-headers: |
| | | 30 | for f in $(LIB_HEADERS); do rm -f "$(INCDIR)/$$f"; done |
| | | 31 | |
| | | 32 | -# not using GNU make extensions for compatibility with Unix/*BSD make |
| | | 33 | -#%.o: %.c |
| | | 34 | -# $(CC) -c $(CFLAGS) $< -o $@ |
| | | 35 | - |
| | | 36 | -# NOTE: dependences were generated by 'gcc -MM -DUSE_OPENSSL *.c' |
| | | 37 | -# we are using plain old makefile style to support BSD make |
| | | 38 | -aich.o: aich.c byte_order.h ustd.h algorithms.h rhash.h aich.h sha1.h |
| | | 39 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 40 | - |
| | | 41 | -algorithms.o: algorithms.c byte_order.h ustd.h rhash.h algorithms.h \ |
| | | 42 | - aich.h sha1.h crc32.h ed2k.h md4.h edonr.h gost12.h gost94.h has160.h \ |
| | | 43 | - md5.h ripemd-160.h snefru.h sha256.h sha512.h sha3.h tiger.h torrent.h \ |
| | | 44 | - tth.h whirlpool.h |
| | | 45 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 46 | - |
| | | 47 | -blake2b.o: blake2b.c blake2b.h ustd.h byte_order.h |
| | | 48 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 49 | - |
| | | 50 | -blake2s.o: blake2s.c blake2s.h ustd.h byte_order.h |
| | | 51 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 52 | - |
| | | 53 | -byte_order.o: byte_order.c byte_order.h ustd.h |
| | | 54 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 55 | - |
| | | 56 | -crc32.o: crc32.c byte_order.h ustd.h crc32.h |
| | | 57 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 58 | - |
| | | 59 | -ed2k.o: ed2k.c ed2k.h md4.h ustd.h |
| | | 60 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 61 | - |
| | | 62 | -edonr.o: edonr.c byte_order.h ustd.h edonr.h |
| | | 63 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 64 | - |
| | | 65 | -gost12.o: gost12.c gost12.h ustd.h byte_order.h |
| | | 66 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 67 | - |
| | | 68 | -gost94.o: gost94.c gost94.h ustd.h byte_order.h |
| | | 69 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 70 | - |
| | | 71 | -has160.o: has160.c byte_order.h ustd.h has160.h |
| | | 72 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 73 | - |
| | | 74 | -hex.o: hex.c hex.h ustd.h |
| | | 75 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 76 | - |
| | | 77 | -md4.o: md4.c byte_order.h ustd.h md4.h |
| | | 78 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 79 | - |
| | | 80 | -md5.o: md5.c byte_order.h ustd.h md5.h |
| | | 81 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 82 | - |
| | | 83 | -plug_openssl.o: plug_openssl.c algorithms.h rhash.h byte_order.h ustd.h \ |
| | | 84 | - plug_openssl.h |
| | | 85 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 86 | - |
| | | 87 | -rhash.o: rhash.c byte_order.h ustd.h algorithms.h rhash.h torrent.h \ |
| | | 88 | - sha1.h plug_openssl.h util.h hex.h |
| | | 89 | - $(CC) -c $(CFLAGS) $(VERSION_CFLAGS) $< -o $@ |
| | | 90 | - |
| | | 91 | -rhash_torrent.o: rhash_torrent.c algorithms.h rhash.h byte_order.h ustd.h \ |
| | | 92 | - torrent.h sha1.h rhash_torrent.h |
| | | 93 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 94 | - |
| | | 95 | -ripemd-160.o: ripemd-160.c byte_order.h ustd.h ripemd-160.h |
| | | 96 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 97 | - |
| | | 98 | -sha1.o: sha1.c byte_order.h ustd.h sha1.h |
| | | 99 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 100 | - |
| | | 101 | -sha256.o: sha256.c byte_order.h ustd.h sha256.h |
| | | 102 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 103 | - |
| | | 104 | -sha3.o: sha3.c byte_order.h ustd.h sha3.h |
| | | 105 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 106 | - |
| | | 107 | -sha512.o: sha512.c byte_order.h ustd.h sha512.h |
| | | 108 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 109 | - |
| | | 110 | -snefru.o: snefru.c byte_order.h ustd.h snefru.h |
| | | 111 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 112 | - |
| | | 113 | -test_lib.o: test_lib.c byte_order.h ustd.h rhash_torrent.h test_utils.h \ |
| | | 114 | - rhash.h test_lib.h util.h |
| | | 115 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 116 | - |
| | | 117 | -test_utils.o: test_utils.c byte_order.h ustd.h rhash.h test_utils.h |
| | | 118 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 119 | - |
| | | 120 | -tiger.o: tiger.c byte_order.h ustd.h tiger.h |
| | | 121 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 122 | - |
| | | 123 | -tiger_sbox.o: tiger_sbox.c byte_order.h ustd.h |
| | | 124 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 125 | - |
| | | 126 | -torrent.o: torrent.c byte_order.h ustd.h algorithms.h rhash.h hex.h \ |
| | | 127 | - torrent.h sha1.h |
| | | 128 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 129 | - |
| | | 130 | -tth.o: tth.c byte_order.h ustd.h tth.h tiger.h |
| | | 131 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 132 | - |
| | | 133 | -util.o: util.c util.h |
| | | 134 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 135 | - |
| | | 136 | -whirlpool.o: whirlpool.c byte_order.h ustd.h whirlpool.h |
| | | 137 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 138 | +.SUFFIXES: .lo |
| | | 139 | |
| | | 140 | -whirlpool_sbox.o: whirlpool_sbox.c byte_order.h ustd.h |
| | | 141 | - $(CC) -c $(CFLAGS) $< -o $@ |
| | | 142 | +.c.lo: |
| | | 143 | + $(LIBTOOL) --mode=compile --tag=CC $(CC) -c $(CFLAGS) $(VERSION_CFLAGS) $< -o $@ |
| | | 144 | |
| | | 145 | # build shared library |
| | | 146 | $(EXPORTS_FILE): $(LIB_HEADERS) |
| | | 147 | @@ -181,8 +73,8 @@ $(LIBRHASH_SOLINK): |
| | | 148 | rm -f $(LIBRHASH_SOLINK) |
| | | 149 | ln -s $(LIBRHASH_SO_MAJ) $(LIBRHASH_SOLINK) |
| | | 150 | |
| | | 151 | -$(LIBRHASH_SHARED): $(SOURCES) $(EXPORTS_TARGET) $(SOLINK_TARGET) |
| | | 152 | - $(CC) $(SHARED_CFLAGS) $(VERSION_CFLAGS) $(SOURCES) $(SHARED_LDFLAGS) -o $@ |
| | | 153 | +$(LIBRHASH_SHARED): $(OBJECTS) |
| | | 154 | + $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(OBJECTS) -rpath $(PREFIX)/lib -version-info 1:0 -o $@ |
| | | 155 | |
8 | # build static library | | 156 | # build static library |
9 | $(LIBRHASH_STATIC): $(OBJECTS) | | 157 | $(LIBRHASH_STATIC): $(OBJECTS) |
10 | rm -f $@ | | | |
11 | - $(AR) -cqs $@ $(OBJECTS) | | | |
12 | + $(AR) -crs $@ $(OBJECTS) | | | |
13 | | | | |
14 | # test targets | | | |
15 | $(TEST_SHARED): $(LIBRHASH_SHARED) test_lib.o test_utils.o | | | |