summaryrefslogtreecommitdiff
blob: 0384d717181e8373f6d3d77a14c41f6faac0ee14 (plain)
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
diff -ru ht-2.0beta2.orig/config.h.in ht-2.0beta2/config.h.in
--- ht-2.0beta2.orig/config.h.in	2006-11-24 02:08:37.000000000 +1100
+++ ht-2.0beta2/config.h.in	2007-01-27 17:42:22.000000000 +1100
@@ -18,6 +18,12 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the <lzo1x.h> header file. */
+#undef HAVE_LZO1X_H
+
+/* Define to 1 if you have the <lzo/lzo1x.h> header file. */
+#undef HAVE_LZO_LZO1X_H
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
@@ -48,6 +54,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Name of package */
+#undef PACKAGE
+
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
@@ -81,6 +90,12 @@
 /* Location of io/$IO_DIR/types.h */
 #undef SYSTEM_OSAPI_SPECIFIC_TYPES_HDR
 
+/* whether to use the included minilzo */
+#undef USE_MINILZO
+
+/* Version number of package */
+#undef VERSION
+
 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
    `char[]'. */
 #undef YYTEXT_POINTER
diff -ru ht-2.0beta2.orig/cstream.cc ht-2.0beta2/cstream.cc
--- ht-2.0beta2.orig/cstream.cc	2006-06-12 06:19:23.000000000 +1000
+++ ht-2.0beta2/cstream.cc	2007-01-27 17:42:22.000000000 +1100
@@ -22,7 +22,13 @@
 #include "htdebug.h"
 #include "except.h"
 #include "endianess.h"
-#include "minilzo.h"
+# ifdef USE_MINILZO
+#  include "minilzo/minilzo.h"
+# elif HAVE_LZO_LZO1X_H
+#  include <lzo/lzo1x.h>
+# elif HAVE_LZO1X_H
+#  include <lzo1x.h>
+# endif
 #include "tools.h"
 
 #include <string.h>
--- /tmp/ht-2.0beta2/Makefile.am	2006-11-03 00:00:56.000000000 +1100
+++ ht-2.0beta2/Makefile.am	2007-01-27 19:02:55.000000000 +1100
@@ -9,17 +9,20 @@
 IO_DIR		= io/@IO_DIR@
 OUTPUT_DIR	= output
 EVAL_DIR	= eval
-MINILZO_DIR	= minilzo
 #SRT_DIR		= srt
-
 EXTRA_DIST	= TODO ChangeLog README KNOWNBUGS INSTALL COPYING AUTHORS
-SUBDIRS		= tools analyser asm doc info io output eval minilzo
+SUBDIRS		= tools analyser asm doc info io output eval
 
-INCLUDES	= -I$(srcdir)/$(ANALYSER_DIR) -I$(srcdir)/$(ASM_DIR) -I$(srcdir)/$(INFO_DIR) -I$(srcdir)/$(IO_DIR) -I$(srcdir)/$(COMIO_DIR) -I$(srcdir)/$(OUTPUT_DIR) -I$(srcdir)/$(EVAL_DIR) -I$(srcdir)/$(MINILZO_DIR) -I$(srcdir)
+INCLUDES	= -I$(srcdir)/$(ANALYSER_DIR) -I$(srcdir)/$(ASM_DIR) -I$(srcdir)/$(INFO_DIR) -I$(srcdir)/$(IO_DIR) -I$(srcdir)/$(COMIO_DIR) -I$(srcdir)/$(OUTPUT_DIR) -I$(srcdir)/$(EVAL_DIR) -I$(srcdir)
 
-ht_LDADD	= $(ANALYSER_DIR)/libanalyser.a $(ASM_DIR)/libasm.a $(INFO_DIR)/libinfo.a $(IO_DIR)/libhtio.a $(OUTPUT_DIR)/liboutput.a $(COMIO_DIR)/libcomio.a $(EVAL_DIR)/libhteval.a $(MINILZO_DIR)/liblzo.a @HT_LIBS@
+ht_LDADD	= $(ANALYSER_DIR)/libanalyser.a $(ASM_DIR)/libasm.a $(INFO_DIR)/libinfo.a $(IO_DIR)/libhtio.a $(OUTPUT_DIR)/liboutput.a $(COMIO_DIR)/libcomio.a $(EVAL_DIR)/libhteval.a @HT_LIBS@ @LZO_LIBS@
 ht_LDFLAGS	= @HT_LDFLAGS@
 
+if ENABLE_INCLUDED_LZO
+SUBDIRS += minilzo
+ht_LDADD += minilzo/liblzo.a
+endif
+
 ht_SOURCES	= atom.cc atom.h except.cc except.h data.cc data.h \
 str.cc str.h strtools.cc strtools.h endianess.h endianess.cc \
 htdoc.c htdoc.h blockop.cc blockop.h coff_s.h \
--- /tmp/ht-2.0beta2/configure.in	2006-11-24 02:07:40.000000000 +1100
+++ ht-2.0beta2/configure.in	2007-01-27 20:43:36.000000000 +1100
@@ -1,22 +1,21 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(data.h)
 
-PACKAGE=ht
-VERSION=2.0beta2
+AC_INIT(ht,[2.0beta2],[https://sourceforge.net/tracker/?group_id=1066])
+AC_PREREQ(2.59)
 
 dnl Check the system.
 AC_CANONICAL_SYSTEM
 
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
-
 AC_ARG_ENABLE(x11-textmode, 
 	[  --enable-x11-textmode   build with x11 textmode support [default=yes]],,enable_x11_textmode="yes")
+AC_ARG_ENABLE(maintainermode,
+	[  --enable-maintainermode minimise autodetection for package mantainers [default=no]],,enable_maintainermode="no")
 AC_ARG_ENABLE(release,
 	[  --enable-release        make a release build [default=yes]],,enable_release="yes")
 AC_ARG_ENABLE(profiling,
 	[  --enable-profiling      make a profile build [default=no]],,enable_profiling="no")
 
+if test "x$enable_maintainermode" = "xno"; then
 if test "x$enable_release" = "xyes"; then
     FLAGS_ALL="-O2 -fomit-frame-pointer -Wall -fsigned-char"
 else
@@ -26,8 +25,9 @@
 if test "x$enable_profiling" = "xyes"; then
     FLAGS_ALL="$FLAGS_ALL -pg -g"
 fi
+fi
 
-AM_INIT_AUTOMAKE($PACKAGE,$VERSION,no-define)
+AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(config.h)
 
 dnl Check OS specifica
@@ -107,6 +107,7 @@
 AC_PATH_PROGS(MAKE, gmake make, :)
 AC_PROG_MAKE_SET
 AC_PROG_CC
+AC_PROG_CPP
 AC_PROG_CXX
 AC_PROG_YACC
 AM_PROG_LEX
@@ -119,6 +120,45 @@
 
 dnl Checks for libraries.
 
+minilzo_enabled=no
+
+AC_ARG_WITH(included-lzo,
+	AS_HELP_STRING([--with-included-lzo],
+		[use included minilzo]),
+	minilzo_enabled=$withval,
+	minilzo_enabled=no)
+
+AC_MSG_CHECKING([whether to use the included lzo compression library])
+AC_MSG_RESULT($minilzo_enabled)
+
+LZO_LIBS=
+if test "$minilzo_enabled" != "yes"; then
+  AC_CHECK_LIB(lzo2, lzo1x_1_compress, LZO_LIBS=-llzo2)
+  if test "$LZO_LIBS" = ""; then
+    AC_CHECK_LIB(lzo, lzo1x_1_compress, LZO_LIBS=-llzo, [
+      minilzo_enabled=yes
+      AC_MSG_WARN(
+***
+*** Could not find liblzo or liblzo2. Will use the included minilzo.
+)
+    ])
+  fi
+fi
+AC_SUBST(LZO_LIBS)
+
+if test "$LZO_LIBS" = "-llzo"; then
+  AC_CHECK_HEADERS(lzo1x.h)
+elif test "$LZO_LIBS" = "-llzo2"; then
+  AC_CHECK_HEADERS(lzo/lzo1x.h)
+fi
+
+if test "$minilzo_enabled" = "yes"; then
+  AC_DEFINE(USE_MINILZO, 1, [whether to use the included minilzo])
+fi
+
+AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes")
+AM_CONDITIONAL(ENABLE_INCLUDED_LZO, test "$minilzo_enabled" = "yes")
+
 HAVE_X11=0
 
 if test "x$enable_x11_textmode" = "xyes"; then
@@ -198,3 +238,4 @@
 fi
 echo "enable profiling:                 $enable_profiling" 1>&2
 echo "make a release build:             $enable_release" 1>&2
+echo "using included minilzo:           $minilzo_enabled" 1>&2