Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 217552 | Differences between
and this patch

Collapse All | Expand All

(-)rzip-2.1/configure.in (-7 / +9 lines)
Lines 2-7 Link Here
2
AC_INIT(main.c)
2
AC_INIT(main.c)
3
AC_CONFIG_HEADER(config.h)
3
AC_CONFIG_HEADER(config.h)
4
4
5
# test prior to AC_PROG_CC, since it sets cflags on it's own.
6
if test x"CFLAGS" = x
7
then
8
	DEFAULT_CFLAGS="-g -Wall -O3"
9
fi
10
5
dnl Checks for programs.
11
dnl Checks for programs.
6
AC_PROG_CC
12
AC_PROG_CC
7
AC_PROG_INSTALL
13
AC_PROG_INSTALL
Lines 9-18 Link Here
9
AC_SYS_LARGEFILE
15
AC_SYS_LARGEFILE
10
16
11
# Thanks to Martin Pool
17
# Thanks to Martin Pool
12
if test x"$GCC" = xyes 
18
if test x"$GCC" = xyes && test x"$DEFAULT_CFLAGS" != x
13
then
19
then
14
    CFLAGS="-g -Wall -O3"
20
    CFLAGS="-g -Wall -O3"
15
    AC_MSG_NOTICE([Setting gcc options: $CFLAGS])
21
    AC_MSG_RESULT([Setting default cflags: $CFLAGS])
16
fi
22
fi
17
23
18
AC_CHECK_HEADERS(fcntl.h sys/time.h sys/unistd.h unistd.h)
24
AC_CHECK_HEADERS(fcntl.h sys/time.h sys/unistd.h unistd.h)
Lines 45-56 Link Here
45
AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, , 
51
AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, , 
46
        AC_MSG_ERROR([Could not find bz2 library - please install libbz2-devel]))
52
        AC_MSG_ERROR([Could not find bz2 library - please install libbz2-devel]))
47
53
48
echo $ac_n "checking for errno in errno.h... $ac_c"
49
AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
50
echo yes; AC_DEFINE(HAVE_ERRNO_DECL),
51
echo no)
52
53
AC_CHECK_FUNCS(mmap strerror)
54
AC_CHECK_FUNCS(mmap strerror)
54
AC_CHECK_FUNCS(getopt_long)
55
AC_CHECK_FUNCS(getopt_long)
56
AC_CHECK_FUNCS(strndup)
55
57
56
AC_OUTPUT(Makefile)
58
AC_OUTPUT(Makefile)
(-)rzip-2.1/main.c (+1 lines)
Lines 18-23 Link Here
18
/* rzip compression - main program */
18
/* rzip compression - main program */
19
19
20
#include "rzip.h"
20
#include "rzip.h"
21
#include "strutils.h"
21
22
22
static void usage(void)
23
static void usage(void)
23
{
24
{
(-)rzip-2.1/Makefile.in (-3 / +4 lines)
Lines 3-10 Link Here
3
3
4
prefix=@prefix@
4
prefix=@prefix@
5
exec_prefix=@exec_prefix@
5
exec_prefix=@exec_prefix@
6
INSTALL_BIN=$(exec_prefix)/bin
6
INSTALL_BIN=$(DESTDIR)/@bindir@
7
INSTALL_MAN=$(prefix)/man
7
INSTALL_MAN=$(DESTDIR)/@mandir@
8
8
9
LIBS=@LIBS@
9
LIBS=@LIBS@
10
CC=@CC@
10
CC=@CC@
Lines 20-26 Link Here
20
.SUFFIXES:
20
.SUFFIXES:
21
.SUFFIXES: .c .o
21
.SUFFIXES: .c .o
22
22
23
OBJS= rzip.o runzip.o main.o stream.o util.o crc32.o
23
OBJS= rzip.o runzip.o strutils.o main.o stream.o util.o crc32.o
24
24
25
# note that the -I. is needed to handle config.h when using VPATH
25
# note that the -I. is needed to handle config.h when using VPATH
26
.c.o:
26
.c.o:
Lines 35-40 Link Here
35
	${INSTALLCMD} -m 755 rzip ${INSTALL_BIN}
35
	${INSTALLCMD} -m 755 rzip ${INSTALL_BIN}
36
	-mkdir -p ${INSTALL_MAN}/man1
36
	-mkdir -p ${INSTALL_MAN}/man1
37
	${INSTALLCMD} -m 644 $(srcdir)/rzip.1 ${INSTALL_MAN}/man1/
37
	${INSTALLCMD} -m 644 $(srcdir)/rzip.1 ${INSTALL_MAN}/man1/
38
	ln -s rzip $(INSTALL_BIN)/runzip
38
39
39
rzip: $(OBJS)
40
rzip: $(OBJS)
40
	$(CC) $(CFLAGS) -o rzip $(OBJS) $(LIBS)
41
	$(CC) $(CFLAGS) -o rzip $(OBJS) $(LIBS)
(-)rzip-2.1/rzip.h (-1 / +1 lines)
Lines 94-100 Link Here
94
#define strerror(i) sys_errlist[i]
94
#define strerror(i) sys_errlist[i]
95
#endif
95
#endif
96
96
97
#ifndef HAVE_ERRNO_DECL
97
#if !defined(errno)
98
extern int errno;
98
extern int errno;
99
#endif
99
#endif
100
100
(-)rzip-2.1/strutils.c (+29 lines)
Line 0 Link Here
1
/* 
2
   Copyright (C) 2005 Gentoo Foundation
3
   
4
   This program is free software; you can redistribute it and/or modify
5
   it under the terms of the GNU General Public License as published by
6
   the Free Software Foundation; either version 2 of the License, or
7
   (at your option) any later version.
8
   
9
   This program is distributed in the hope that it will be useful,
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
   GNU General Public License for more details.
13
   
14
   You should have received a copy of the GNU General Public License
15
   along with this program; if not, write to the Free Software
16
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
*/
18
/* string utilities that may be missing on various platforms */
19
20
#include "strutils.h"
21
22
#ifndef HAVE_STRNDUP
23
char* strndup(const char* s, size_t n) {
24
	char* ret = malloc(n + 1);
25
	if (ret == NULL) return(ret);
26
	ret[n] = '\0';
27
	return(memcpy(ret, s, n));
28
}
29
#endif
(-)rzip-2.1/strutils.h (+31 lines)
Line 0 Link Here
1
/* 
2
   Copyright (C) 2005 Gentoo Foundation
3
   
4
   This program is free software; you can redistribute it and/or modify
5
   it under the terms of the GNU General Public License as published by
6
   the Free Software Foundation; either version 2 of the License, or
7
   (at your option) any later version.
8
   
9
   This program is distributed in the hope that it will be useful,
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
   GNU General Public License for more details.
13
   
14
   You should have received a copy of the GNU General Public License
15
   along with this program; if not, write to the Free Software
16
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
*/
18
/* string utilities that may be missing on various platforms */
19
20
#ifndef _HEADER_STRUTIL
21
#define _HEADER_STRUTIL 1
22
23
#include <stdlib.h>
24
#include <string.h>
25
#include "config.h"
26
27
# ifndef HAVE_STRNDUP
28
char* strndup(const char* s, size_t n);
29
# endif
30
31
#endif

Return to bug 217552