[packages] Update libinklevel to 0.8.0rc2, fix usb device location

git-svn-id: svn://svn.openwrt.org/openwrt/packages@15692 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2009-05-07 15:10:01 +00:00
parent ecff693b04
commit 3756e305bc
5 changed files with 284 additions and 35 deletions

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libinklevel
PKG_VERSION:=0.7.3
PKG_VERSION:=0.8.0rc2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/libinklevel
PKG_MD5SUM:=c7ccefec29d1d218d1aae240f6044fe1
PKG_MD5SUM:=91ef91dd5c6338789ad5ae85134d7d0a
include $(INCLUDE_DIR)/package.mk

View File

@ -0,0 +1,247 @@
--- a/configure
+++ b/configure
@@ -12028,7 +12028,7 @@ fi
## Check for optional header files
-for ac_header in ifaddrs.h ieee1284.h
+for ac_header in ifaddrs.h
do
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -13648,235 +13648,6 @@ case $host in
cat >>confdefs.h <<_ACEOF
#define HOST_OS LINUX
_ACEOF
-
-
-for ac_header in ieee1284.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
- $as_echo "$as_val"'`
- { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- $as_echo_n "(cached) " >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
- $as_echo "$as_val"'`
- { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
- $as_echo "$as_val"'`
- if test "x$as_val" = x""yes; then
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-else
- { { $as_echo "$as_me:$LINENO: error: ( required header file ieee1284.h missing)" >&5
-$as_echo "$as_me: error: ( required header file ieee1284.h missing)" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-done
-
-
-{ $as_echo "$as_me:$LINENO: checking for ieee1284_open in -lieee1284" >&5
-$as_echo_n "checking for ieee1284_open in -lieee1284... " >&6; }
-if test "${ac_cv_lib_ieee1284_ieee1284_open+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lieee1284 $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ieee1284_open ();
-int
-main ()
-{
-return ieee1284_open ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
- }; then
- ac_cv_lib_ieee1284_ieee1284_open=yes
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_ieee1284_ieee1284_open=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee1284_ieee1284_open" >&5
-$as_echo "$ac_cv_lib_ieee1284_ieee1284_open" >&6; }
-if test "x$ac_cv_lib_ieee1284_ieee1284_open" = x""yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBIEEE1284 1
-_ACEOF
-
- LIBS="-lieee1284 $LIBS"
-
-else
- { { $as_echo "$as_me:$LINENO: error: Library not found" >&5
-$as_echo "$as_me: error: Library not found" >&2;}
- { (exit 1); exit 1; }; }
-fi
;;
*-*-solaris2.*)

View File

@ -1,21 +0,0 @@
--- libinklevel-0.7.3.orig/Makefile 2008-12-10 17:09:05.052017664 +0100
+++ libinklevel-0.7.3/Makefile 2008-12-10 19:40:44.904051107 +0100
@@ -1,7 +1,7 @@
-DESTDIR =
-PREFIX = /usr/local
-CFLAGS += -Wall -O2 -fPIC -DPIC -I.
-CC = gcc
+#DESTDIR =
+PREFIX = /usr
+#CFLAGS += -Wall -O2 -fPIC -DPIC -I.
+#CC = gcc
all: libinklevel.so.4.0.7.3
@@ -36,5 +36,5 @@ libinklevel.so.4.0.7.3: canon.o d4lib.o
linux.o util.o
$(CC) $(CFLAGS) -shared -Wl,-soname,libinklevel.so.4 \
-o libinklevel.so.4.0.7.3 canon.o d4lib.o epson_new.o \
- hp_new.o libinklevel.o linux.o util.o -lc -lieee1284
+ hp_new.o libinklevel.o linux.o util.o $(LIBS)

View File

@ -1,16 +1,19 @@
--- libinklevel-0.7.3.orig/linux.c 2008-12-10 17:09:05.052017664 +0100
+++ libinklevel-0.7.3/linux.c 2008-12-10 17:19:59.362144646 +0100
@@ -8,7 +8,9 @@
#include "inklevel.h"
--- a/linux.c
+++ b/linux.c
@@ -16,10 +16,11 @@
#include <string.h>
#include <sys/ioctl.h>
+#ifdef WITH_PARPORT
/* ieee1284.h uses HAVE_IEEE1284_H, so we undefine it */
#undef HAVE_IEEE1284_H
#include <ieee1284.h>
-
+#endif
#include <stdio.h>
#include <sys/types.h>
@@ -30,7 +32,9 @@ int open_printer_device(const int port,
#include "internal.h"
#include "inklevel.h"
#include "platform_specific.h"
@@ -32,7 +33,9 @@
int get_device_id(const int port, const char *device_file,
const int portnumber, char *device_id) {
@ -20,7 +23,7 @@
char tmp[BUFLEN];
char device_file1[256];
char device_file2[256];
@@ -39,6 +43,7 @@ int get_device_id(const int port, const
@@ -41,6 +44,7 @@ int get_device_id(const int port, const
char *c;
int realsize;
@ -28,7 +31,7 @@
if (port == PARPORT ) {
/* check if we have appropiate permissions */
@@ -71,7 +76,9 @@ int get_device_id(const int port, const
@@ -73,7 +77,9 @@ int get_device_id(const int port, const
return COULD_NOT_GET_DEVICE_ID;
@ -39,7 +42,7 @@
if (port == USB) {
sprintf(device_file1, "/dev/usb/lp%d", portnumber);
@@ -132,8 +139,10 @@ int open_printer_device(const int port,
@@ -138,8 +144,10 @@ int open_printer_device(const int port,
if (port == USB) {
sprintf(device_file1, "/dev/usb/lp%d", portnumber);
sprintf(device_file2, "/dev/usblp%d", portnumber);

View File

@ -0,0 +1,20 @@
--- a/linux.c
+++ b/linux.c
@@ -82,7 +82,7 @@ int get_device_id(const int port, const
if (port == USB || port == CUSTOM_USB) {
if (port == USB) {
- sprintf(device_file1, "/dev/usb/lp%d", portnumber);
+ sprintf(device_file1, "/dev/lp%d", portnumber);
sprintf(device_file2, "/dev/usblp%d", portnumber);
fd = open(device_file1, O_RDONLY);
if (fd == -1) {
@@ -142,7 +142,7 @@ int open_printer_device(const int port,
int fd;
if (port == USB) {
- sprintf(device_file1, "/dev/usb/lp%d", portnumber);
+ sprintf(device_file1, "/dev/lp%d", portnumber);
sprintf(device_file2, "/dev/usblp%d", portnumber);
#ifdef WITH_PARPORT
} else if (port == PARPORT) {