Skip to content

Commit 70c11a1

Browse files
committed
Added Patches by Robin Lee <robinlee.sysu@gmail.com> to make xstow work
with gcc 4.8. Changed some stuff in configure.ac to make ist work with uptodate automake versions. Static compilation has to be enabled now. Won't be build by default.
1 parent 05e42aa commit 70c11a1

19 files changed

Lines changed: 1352 additions & 1398 deletions

ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2014-01-02 Martin Oberzalkek <kingleo@gmx.at>
2+
3+
* ref.h added patch by Robin Lee <robinlee.sysu@gmail.com> fixed compilation bug with gcc 4.8
4+
5+
* doku added patch by Robin Lee <robinlee.sysu@gmail.com> fixed pod2man bug
6+
7+
* configure.ac: let it work with automake 1.13.4
8+
9+
* configure.ac: disable static compilation by default
10+
11+
* configure.ac: detect if libtinfo is required (seems to be outsourced fom curses)
12+
13+
114
2012-06-10 Martin Oberzalek <kingleo@gmx.at>
215

316
* configure.ac: fixed bug when trying to detect curses library

configure.ac

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
AC_INIT
1+
AC_INIT(xstow, 1.0.1)
22
AC_CONFIG_SRCDIR([src/main.cpp])
33
AM_CONFIG_HEADER(config.h)
4-
AM_INIT_AUTOMAKE(xstow, 1.0.1)
4+
AM_INIT_AUTOMAKE
55

6-
AC_ISC_POSIX
6+
AC_SEARCH_LIBS([strerror],[cposix])
77
AC_PROG_CXX
88
AC_LANG(C++)
99
AC_PROG_INSTALL
@@ -120,25 +120,33 @@ AC_ARG_WITH(curses,
120120
if test $support_curses -eq 1; then
121121
122122
AC_MSG_CHECKING([for ominous macros in curses])
123-
AC_TRY_COMPILE([
123+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
124124
#include <curses.h>
125125
#include <list>
126126
struct Foo { Foo() { std::list<int> il; il.erase(il.begin()); } };
127-
],
128-
[ Foo foo ],
129-
[
127+
]], [[ Foo foo ]])],[
130128
AC_MSG_RESULT(no)
131129
support_curses=1
132-
],
133-
[
130+
],[
134131
AC_MSG_RESULT(yes => curses support disabled)
135132
support_curses=0
136133
])
137134
138135
fi
139136
140137
if test $support_curses -eq 1; then
141-
AC_SUBST(LDFLAGS_DYNAMIC, "$LDFLAGS -l$curseslib")
138+
139+
AC_CHECK_LIB([tinfo],[COLS],
140+
[
141+
need_tinfo=1
142+
tinfolib="-ltinfo"
143+
],
144+
[ need_tinfo=0 ])
145+
146+
fi
147+
148+
if test $support_curses -eq 1; then
149+
AC_SUBST(LDFLAGS_DYNAMIC, "$LDFLAGS -l$curseslib $tinfolib")
142150
AC_DEFINE(HAVE_CURSES_H, 1, [curses library can be used])
143151
fi
144152
@@ -179,25 +187,22 @@ AC_ARG_ENABLE(ini,
179187
] )
180188

181189
AC_MSG_CHECKING([for GNU like STL containers])
182-
AC_TRY_COMPILE([
190+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
183191
#include <list>
184192
struct Foo { typedef std::list<Foo>::iterator it; };
185-
],
186-
[ Foo foo ],
187-
[
193+
]], [[ Foo foo ]])],[
188194
AC_MSG_RESULT(yes)
189195
190196
if test $no_ini -eq 0; then
191197
AC_DEFINE(CAN_USE_INI, 1, [the ini class should compile clean])
192198
support_ini=1
193199
fi
194-
],
195-
[
200+
],[
196201
AC_MSG_RESULT(no)
197202
AC_MSG_WARN([cannot compile with configuration file support])
198203
support_ini=0
199-
]
200-
)
204+
205+
])
201206

202207
AC_MSG_CHECKING([for debugging support])
203208
AC_ARG_ENABLE(debug,
@@ -219,19 +224,16 @@ AC_ARG_ENABLE(debug,
219224
] )
220225

221226
AC_MSG_CHECKING([for new std::ios_base])
222-
AC_TRY_COMPILE([
227+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
223228
#include <fstream>
224-
],
225-
[ std::ifstream in( "foo", std::ios_base::in ); ],
226-
[
229+
]], [[ std::ifstream in( "foo", std::ios_base::in ); ]])],[
227230
AC_MSG_RESULT(yes)
228231
AC_DEFINE(HAVE_IOS_BASE, 1, [ios_base can be used])
229-
],
230-
[
232+
],[
231233
AC_MSG_RESULT(no)
232234
AC_DEFINE(ios_base, ios, [use old ios instead of ios_base])
233-
]
234-
)
235+
236+
])
235237

236238
CXXFLAGS="$CXXFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
237239

@@ -249,7 +251,7 @@ AC_ARG_ENABLE(static,
249251
],
250252
[
251253
AC_MSG_RESULT(enabled)
252-
support_static=1
254+
support_static=0
253255
] )
254256

255257
AC_MSG_CHECKING([create merge-info?])

depcomp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/usr/share/automake-1.11/depcomp
1+
/usr/share/automake-1.13/depcomp

doc/merge-info.1

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
1+
.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
22
.\"
33
.\" Standard preamble:
44
.\" ========================================================================
5-
.de Sh \" Subsection heading
6-
.br
7-
.if t .Sp
8-
.ne 5
9-
.PP
10-
\fB\\$1\fR
11-
.PP
12-
..
135
.de Sp \" Vertical space (when we can't use .PP)
146
.if t .sp .5v
157
.if n .sp
@@ -46,27 +38,36 @@
4638
. ds PI \(*p
4739
. ds L" ``
4840
. ds R" ''
41+
. ds C`
42+
. ds C'
4943
'br\}
5044
.\"
5145
.\" Escape single quotes in literal strings from groff's Unicode transform.
5246
.ie \n(.g .ds Aq \(aq
5347
.el .ds Aq '
5448
.\"
5549
.\" If the F register is turned on, we'll generate index entries on stderr for
56-
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
50+
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
5751
.\" entries marked with X<> in POD. Of course, you'll have to process the
5852
.\" output yourself in some meaningful fashion.
59-
.ie \nF \{\
60-
. de IX
61-
. tm Index:\\$1\t\\n%\t"\\$2"
53+
.\"
54+
.\" Avoid warning from groff about undefined register 'F'.
55+
.de IX
6256
..
63-
. nr % 0
64-
. rr F
65-
.\}
66-
.el \{\
67-
. de IX
57+
.nr rF 0
58+
.if \n(.g .if rF .nr rF 1
59+
.if (\n(rF:(\n(.g==0)) \{
60+
. if \nF \{
61+
. de IX
62+
. tm Index:\\$1\t\\n%\t"\\$2"
6863
..
64+
. if !\nF==2 \{
65+
. nr % 0
66+
. nr F 2
67+
. \}
68+
. \}
6969
.\}
70+
.rr rF
7071
.\"
7172
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
7273
.\" Fear. Run. Save yourself. No user-serviceable parts.
@@ -132,7 +133,7 @@
132133
.\" ========================================================================
133134
.\"
134135
.IX Title "MERGE-INFO 1"
135-
.TH MERGE-INFO 1 "2010-07-22" "XStow 1.0.0" "XStow Reference Guide"
136+
.TH MERGE-INFO 1 "2014-01-02" "XStow 1.0.1" "XStow Reference Guide"
136137
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
137138
.\" way too many mistakes in technical documents.
138139
.if n .ad l
@@ -141,7 +142,7 @@
141142
merge\-info, merge and unmerge GNU Info index files
142143
.SH "SYNOPSIS"
143144
.IX Header "SYNOPSIS"
144-
merge-info [\s-1OPTION\s0 ...] \s-1FILE\s0 \s-1FILE\s0
145+
merge-info [\s-1OPTION ...\s0] \s-1FILE FILE\s0
145146
.SH "DESCRIPTION"
146147
.IX Header "DESCRIPTION"
147148
merge-info can merge and unmerge the \s-1GNU\s0 Info index files named
@@ -166,7 +167,7 @@ This is the common case if you are using a tool like
166167
files and creates a new 'dir' file.
167168
.SH "USAGE"
168169
.IX Header "USAGE"
169-
merge-info [\s-1OPTION\s0 ...] \s-1FILE\s0 \s-1FILE\s0
170+
merge-info [\s-1OPTION ...\s0] \s-1FILE FILE\s0
170171
.PP
171172
Merge two files:
172173
.PP
@@ -192,6 +193,9 @@ Shows a help screen.
192193
.IX Item "-V -Version"
193194
Displays the verion number of the XStow package. \fBmerge-info\fR is
194195
shipped with \fBxstow\fR(1).
196+
.IP "\fB\-C \-no\-curses\fR" 4
197+
.IX Item "-C -no-curses"
198+
Do not detect the terminal width by using curses.
195199
.IP "\fB\-u \-unmerge\fR" 4
196200
.IX Item "-u -unmerge"
197201
Unmerge instead of merge. Note: It is not possible splitting up one
@@ -216,6 +220,27 @@ more than one section. If you do not wan't this, use this option.
216220
.IP "\fB\s-1XSTOW_DEBUG_LEVEL\s0\fR" 4
217221
.IX Item "XSTOW_DEBUG_LEVEL"
218222
Same as the \fB\-debug\-level\fR option.
223+
.IP "\fB\s-1XSTOW_USE_CURSES\s0\fR" 4
224+
.IX Item "XSTOW_USE_CURSES"
225+
Same as the \fB\-no\-curses\fR option.
226+
.Sp
227+
In previous versions xstow tried detecting the terminal width and height,
228+
by default at the startup routine. Even if this value is only used by
229+
the help screen. The result was:
230+
.Sp
231+
.Vb 2
232+
\& $ TERM="" xstow
233+
\& Error opening terminal: unknown.
234+
.Ve
235+
.Sp
236+
The error message is reported by the ncurses lib. This can cause problems
237+
if you wan't start xstow as a cron job.
238+
Now xstow tries detecting the terminal width not in it's startup, but
239+
when the help screen is printed out. As an extra option you can set
240+
the environment variable \fB\s-1XSTOW_USE_CURSES\s0\fR=\*(L"0\*(R" this will tell xstow
241+
not using curses anyway.
242+
.Sp
243+
merge-info has the same behaviour.
219244
.SH "AUTHORS"
220245
.IX Header "AUTHORS"
221246
merge-info was written by Martin Oberzalek <kingleo@gmx.at>.
@@ -231,22 +256,13 @@ the Free Software Foundation; either version 2 of the License, or
231256
(at your option) any later version.
232257
.PP
233258
This program is distributed in the hope that it will be useful,
234-
but \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of
235-
\&\s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the
259+
but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of
260+
\&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE. \s0 See the
236261
\&\s-1GNU\s0 General Public License for more details.
237262
.PP
238263
You should have received a copy of the \s-1GNU\s0 General Public License
239264
along with this program; if not, write to the Free Software
240-
Foundation, Inc., 675 Mass Ave, Cambridge, \s-1MA\s0 02139, \s-1USA\s0.
265+
Foundation, Inc., 675 Mass Ave, Cambridge, \s-1MA 02139, USA.\s0
241266
.SH "SEE ALSO"
242267
.IX Header "SEE ALSO"
243268
\&\fIinfo\fR\|(1) \fIinstall\-info\fR\|(1) \fIxstow\fR\|(1)
244-
.SH "POD ERRORS"
245-
.IX Header "POD ERRORS"
246-
Hey! \fBThe above document had some coding errors, which are explained below:\fR
247-
.IP "Around line 42:" 4
248-
.IX Item "Around line 42:"
249-
Can't have a 0 in =over 0
250-
.IP "Around line 83:" 4
251-
.IX Item "Around line 83:"
252-
Can't have a 0 in =over 0

0 commit comments

Comments
 (0)