plustek: Compilation problems on glibc2.2 based systems (SuSE 7.2)


Previous by date: 29 Jul 2001 11:33:37 -0000 Re: Problems compiling plustek_module-0_39_3 with Suse 7.2 - need help !, Jaeger, Gerhard
Next by date: 29 Jul 2001 11:33:37 -0000 Re: Problem with Plustek 4830 P scanner, tri10.poland.com
Previous in thread:
Next in thread:

Subject: Compilation problems on glibc2.2 based systems (SuSE 7.2)
From: "Jaeger, Gerhard" ####@####.####
Date: 29 Jul 2001 11:33:37 -0000
Message-Id: <01072913363400.01080@ruebennase>

Hi there,

it has been reported, that there are compilation
problems on glibc2.2 based systems (especially SuSE 7.2)
As I don't have such a system, I can't test my solution but I
have one for you.
I'd be glad to hear from you - please test.

Replace the makefile of the driver in the plustek_driver
directory with the one I have attached (only version 0.39!!!)
and try
make clean
make all K24=y
This enables the glibc2.2 specific stuff! Alternatively you can
enable the switch within the makefile - simply uncomment line 33

Hope this helps to solve your problems...

Gerhard

# Makefile for the plustek scanner driver
#
###############################################################################
#
# define the directories
#
HOME_DIR := .
SRC_DIR  := $(HOME_DIR)/src
INC_DIR  := $(HOME_DIR)/h
OBJ_DIR  := $(HOME_DIR)/obj
DOC_DIR  := $(HOME_DIR)/doc
BACKEND  := $(HOME_DIR)/..

#
# define the used tools
#
MD  = mkdir -p
CC  = gcc
TAR = tar
REF = cxref

#
# Comment/uncomment the following line to disable/enable debugging
# can also be set by commandline parameter: make all DEBUG=y
#
#DEBUG = y

#
# Comment/uncomment the following line to support the new style
# reference to the kernel headers (lib/modules/(uname -r)/build/include
# can also be set by commandline parameter: make all K24=y
#
# K24=y


#
# common compiler options
#
OPT = -fomit-frame-pointer -D_PTDRV_V1=$(VERSION1) \
-D_PTDRV_V0=$(VERSION0) -D_PTDRV_BUILD=$(BUILD)

#
# cxref options
#
REFOPT = -xref-all -index-all -html32

#
# Comment out if you are not running SMP. Someone take this out of here
# when the SMP stuff gets moved out of the kernel Makefile.
# SMP = 1
# SMP_PROF = 1

#
# add the following to get assembly listing
# -Wa,-alh,-L -g 

#
#
#
ifeq ($(LINUXVERSION),)
 LINUXVERSION = $(shell uname -r)
endif
VERSION0 = $(shell cat VERSION0)
VERSION1 = $(shell cat VERSION1)
BUILD    = $(shell cat BUILD)

# Change it here or specify it on the "make" commandline
ifeq ($(HEADER_PATH),)
MACHTYPE = $(shell env | grep debian-linux | wc -l | sed 's/ //g')
ifeq ($(MACHTYPE),1)
#  debian
  HEADER_PATH = /usr/src/kernel-headers-$(LINUXVERSION)/include
else
#  redhat, slackware
  HEADER_PATH = /usr/src/linux/include
endif
#   HEADER_PATH = /usr/include
endif

ifeq ($(DEBUG),y)
  DEBFLAGS = -O -g -DDEBUG # "-O" is needed to expand inlines
else
  DEBFLAGS = -O2
endif

ifeq ($(K24),y)
  HEADER_PATH= /lib/modules/$(LINUXVERSION)/build/include
endif

#
# seems to be necessary for kernels 2.4.x
#
MODVERFILE = $(shell if [ -e $(HEADER_PATH)/linux/modversions.h ]; then \
						echo $(HEADER_PATH)/linux/modversions.h ;	\
					 else											\
						echo $(HEADER_PATH)/linux/modsetver.h ;		\
					 fi )

MODFLAGS = -DMODULE 
# set MODVERSIONS if the kernel uses it
VERSUSED = $(shell grep 'define CONFIG_MODVERSIONS' \
                   $(HEADER_PATH)/linux/autoconf.h | wc -l | sed 's/ //g')
ifeq ($(VERSUSED),1)
  MODFLAGS += -DMODVERSIONS -include $(MODVERFILE)
endif

WARNFLAGS = -Wall -Wstrict-prototypes
CFLAGS    = $(WARNFLAGS) $(OPT) -D__KERNEL__ -I$(HEADER_PATH) -I$(INC_DIR) -I$(BACKEND) $(DEBFLAGS) $(MODFLAGS)
MODLIB    = /lib/modules/$(LINUXVERSION)

ifdef SMP
CFLAGS += -D__SMP__

ifdef SMP_PROF
CFLAGS += -D__SMP_PROF__
endif
endif

TARGET = pt_drv

if test -f $(SRC_DIR)/$(TARGET).c; then TARGET_INST = $(TARGET).o; else TARGET_INST = ""; fi;

OBJ  = $(TARGET).o
NAMES := dac detect genericio image map misc models io procfs
NAMES := $(NAMES) motor p9636 ptdrv scale tpa p48xx p12 p12ccd
SRCS  := $(addprefix $(SRC_DIR)/, $(NAMES))
SRCS  := $(addsuffix .c, $(SRCS))
OBJS  := $(addprefix $(OBJ_DIR)/, $(NAMES))
OBJS  := $(addsuffix .o, $(OBJS))
INCS  := scan dbg types scandata procs hwdefs sysdep
INCS  := $(addsuffix .h, $(INCS))
HDRS  = $(addprefix $(INC_DIR)/plustek_, $(INCS))

#
# the header files we need from the backend
#
BACKINCS := plustek-share.h
BACKINCS := $(addprefix $(BACKEND)/, $(BACKINCS))

group = "root"
mode  = "664"


info:
	@clear
	@echo "Makefile to create the Plustek-Scanner kernel-module:"
	@echo "all          ... builds the module"
	@echo "all DEBUG=y  ... builds the module with debug-messages enabled"
	@echo "all K24=y    ... builds the module using the new fashioned kernel header path"
	@echo "clean        ... cleans up the show"
	@echo "install      ... installs the module to the library path"
	@echo "uninstall    ... removes the module from the library path"
	@echo "load         ... tries to load the module and creates device nodes"
	@echo "unload       ... unloads the module"


all: .depend chkdir $(TARGET).o

#
# create object directory
#
.PHONY : chkdir
chkdir:
	@-$(MD) $(OBJ_DIR)
	@-$(MD) $(DOC_DIR)

$(TARGET).o: $(OBJS)
	$(LD) -r $^ -o $@

$(OBJS): Makefile $(HDRS) $(BACKINCS)

$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c
	$(CC) $(CFLAGS) -c $< -o $@

$(OBJ_DIR)/ptdrv.o: VERSION1 VERSION0

#
# copy the driver to the modules directory
#
install: $(TARGET_INST)
	mkdir -p /lib/modules/$(LINUXVERSION)/misc
	install -c $(TARGET).o /lib/modules/$(LINUXVERSION)/misc

uninstall: $(TARGET_INST)
	rm -f /lib/modules/$(LINUXVERSION)/misc/$(TARGET).o

#
# use modprobe to load the driver, remember to set the
# parameter in /etc/conf.modules (see INSTALL for more details)
#
load:   /lib/modules/$(LINUXVERSION)/misc/$(TARGET).o
# invoke modprobe with all arguments we got
	/sbin/modprobe $(TARGET) || exit 1

# Remove stale nodes and replace them, then give gid and perms
	rm -f /dev/$(TARGET)*

# when using the devfs support, we check the /dev/scanner entries
# and only create links to the devfs nodes
# at least we create one link
	@if [ -e /dev/scanner/$(TARGET)* ]; then 				\
		ln -s /dev/scanner/$(TARGET)0 /dev/$(TARGET);		\
		for name in `ls /dev/scanner | grep $(TARGET)`; do	\
			ln -s /dev/scanner/$$name /dev/$$name ;     	\
		done												\
	else                      								\
		mknod /dev/$(TARGET) c `cat /proc/devices | sed -ne "s/\([0-9]*\) pt_drv/\1/p"` 0;  \
		mknod /dev/$(TARGET)0 c `cat /proc/devices | sed -ne "s/\([0-9]*\) pt_drv/\1/p"` 0;	\
		mknod /dev/$(TARGET)1 c `cat /proc/devices | sed -ne "s/\([0-9]*\) pt_drv/\1/p"` 1;	\
		mknod /dev/$(TARGET)2 c `cat /proc/devices | sed -ne "s/\([0-9]*\) pt_drv/\1/p"` 2; \
		mknod /dev/$(TARGET)3 c `cat /proc/devices | sed -ne "s/\([0-9]*\) pt_drv/\1/p"` 3;	\
																							\
		chgrp $(group) /dev/$(TARGET)*;	\
		chmod $(mode)  /dev/$(TARGET)*;	\
	fi

#
# unload the driver
#
unload:
	/sbin/modprobe -r $(TARGET) || exit 1

# Remove stale nodes
	rm -f /dev/$(TARGET)*

#
# create reference docu
#
doc: chkdir
	$(REF) $(REFOPT) $(INC_DIR)/*.h $(SRC_DIR)/*.c $(BACKEND)/plustek-share.h \
    -D__KERNEL__ -I$(HEADER_PATH) -I$(INC_DIR) -I$(BACKEND) $(MODFLAGS) \
    -D_PTDRV_V1=$(VERSION1) -D_PTDRV_V0=$(VERSION0) -D_PTDRV_BUILD=$(BUILD) -O$(DOC_DIR)

clean:
	@-rm -f $(OBJ_DIR)/*.o .depend depend dep $(OBJ) $(REF).* *.html
	@-rm -rf $(OBJ_DIR)
	@-rm -rf $(DOC_DIR)

depend .depend dep:
	$(CC) $(CFLAGS) -M $(SRC_DIR)/*.c > $@

ifeq (.depend,$(wildcard .depend))
include .depend
endif


Previous by date: 29 Jul 2001 11:33:37 -0000 Re: Problems compiling plustek_module-0_39_3 with Suse 7.2 - need help !, Jaeger, Gerhard
Next by date: 29 Jul 2001 11:33:37 -0000 Re: Problem with Plustek 4830 P scanner, tri10.poland.com
Previous in thread:
Next in thread:


Powered by ezmlm-browse 0.20.