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
|
Modified from: PDL Linux
https://raw.githubusercontent.com/pld-linux/uudeview/master/uudeview-shared.patch
https://github.com/pld-linux/uudeview
Bug: https://bugs.gentoo.org/780018
From: orbea <orbea@riseup.net>
Date: Wed, 13 Jul 2022 22:17:55 -0700
Subject: [PATCH] Use libtool
diff --git a/Makefile.in b/Makefile.in
index 951c731..342bf56 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -25,6 +25,10 @@ CC = @CC@
#
CFLAGS = @CFLAGS@ -I. @CPPFLAGS@ @DEFS@
#
+# the libtool program
+#
+LIBTOOL = @LIBTOOL@
+#
# the ranlib program
#
RANLIB = @RANLIB@
@@ -40,9 +44,16 @@ PATCH = @PATCH@
VDEF = -DVERSION=\"$(VERSION)\" -DPATCH=\"$(PATCH)\"
#
+top_builddir = @top_builddir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+libdir = @libdir@
+includedir = @includedir@
+
UULIB_SOURCE = uulib.c uucheck.c uunconc.c uuutil.c uuencode.c \
uuscan.c uustring.c fptools.c crc32.c
-UULIB_OBJ = ${UULIB_SOURCE:.c=.o}
+UULIB_OBJ = ${UULIB_SOURCE:.c=.lo}
#
# make stuff
@@ -51,11 +62,11 @@ UULIB_OBJ = ${UULIB_SOURCE:.c=.o}
.SUFFIXES:
.SUFFIXES: .c .o
-all: libuu.a
+all: libuu.la
clean:
rm -f [Xx]deview gif2gfp
- rm -f *.o *.a *.so core *~ TAGS
+ rm -f *.o *.a *.so core *~ TAGS *.lo *.la
distclean: clean
rm -f config.status config.cache config.log Makefile config.h
@@ -67,22 +78,25 @@ new: clean
rm -f libuu.a
$(MAKE) all
-libuu.a: $(UULIB_OBJ)
- rm -f $@
- ar r $@ $(UULIB_OBJ)
- -$(RANLIB) $@
+libuu.la: $(UULIB_OBJ)
+ $(LIBTOOL) --mode=link $(CC) -o libuu.la $(LDFLAGS) $(UULIB_OBJ) -rpath $(libdir)
+
+%.lo : %.c
+ $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $(VDEF) $<
-.c.o:
- $(CC) -c $(CFLAGS) $(VDEF) $<
+install: libuu.la
+ mkdir -p $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
+ $(LIBTOOL) --mode=install install libuu.la $(DESTDIR)$(libdir)
+ cp uudeview.h fptools.h $(DESTDIR)$(includedir)
-uuencode.o: uuencode.c uudeview.h uuint.h uustring.h fptools.h config.h
-uulib.o: uulib.c uudeview.h uuint.h uustring.h fptools.h config.h
-uunconc.o: uunconc.c uudeview.h uuint.h uustring.h fptools.h config.h
-uucheck.o: uucheck.c uudeview.h uuint.h uustring.h fptools.h config.h
-uuutil.o: uuutil.c uudeview.h uuint.h uustring.h fptools.h config.h
-uuscan.o: uuutil.c uudeview.h uuint.h uustring.h fptools.h config.h
-uustring.o: uustring.c uudeview.h uuint.h uustring.h config.h
-fptools.o: fptools.c fptools.h config.h
+uuencode.lo: uuencode.c uudeview.h uuint.h uustring.h fptools.h config.h
+uulib.lo: uulib.c uudeview.h uuint.h uustring.h fptools.h config.h
+uunconc.lo: uunconc.c uudeview.h uuint.h uustring.h fptools.h config.h
+uucheck.lo: uucheck.c uudeview.h uuint.h uustring.h fptools.h config.h
+uuutil.lo: uuutil.c uudeview.h uuint.h uustring.h fptools.h config.h
+uuscan.lo: uuutil.c uudeview.h uuint.h uustring.h fptools.h config.h
+uustring.lo: uustring.c uudeview.h uuint.h uustring.h config.h
+fptools.lo: fptools.c fptools.h config.h
uustring.h: uustring.c
awk -f uustring.awk < uustring.c > uustring.h
diff --git a/configure.in b/configure.in
index ef00d18..563c77d 100644
--- a/configure.in
+++ b/configure.in
@@ -8,6 +8,8 @@ dnl
AC_INIT(uulib.c)
AC_PREREQ(2.9)
+AC_CONFIG_AUX_DIR([.])
+AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER(config.h)
#
@@ -20,7 +22,7 @@ AC_PROG_CC
AC_PROG_CPP
wi_PROTOTYPES
AC_PROG_MAKE_SET
-AC_PROG_RANLIB
+LT_INIT
if test "$wi_cv_prototypes" = no ; then
AC_WARN([Your compiler does not support function prototyping and])
diff --git a/aclocal.m4 b/m4/uulib.m4
similarity index 100%
rename from aclocal.m4
rename to m4/uulib.m4
|