kernel 2.4.17+rtai compile


notes on emc/rcslib compile on plat=
Linux-2.4.17
RTAI-24.1.8

attached files
/usr/local/nist/rcslib/etc/linux_rtai_2_4_17.def
definitions for non-realtime plat
used regular rtai.def for realtime plat
and
/user/local/nist/compile
edited compile script for this kernel

other edits made

in .../emc/src/emctask/Makefile
added keystick to BINS anywhere between lines 85 to 109
keystick will not be built otherwise

in .../emc/src/emcmot/emcmot.c
comment out the "#if defined" block on lines 388 to 391
caused several redefinition errors 

# In file included from emcmot.c:390:
# /usr/include/sys/io.h:45: redefinition of `inb'
# /usr/src/linux-2.4.17-rtai/include/asm/io.h:309: `inb' previously defined 
here
# /usr/include/sys/io.h:54: redefinition of `inb_p'
...and so on

compiled fine after these edits

I also created a link in .../emc/plat to resolve version name mismatch
# ln -sf linux_rtai_2_4_17 linux_rtai
could have just renamed linux_rtai_2_4_17.def from the start
to avoid this

results
./sim.run -works
./rtsim.run -works but gives following errors and aborts on first move
not currently connected to anything so emc.run not tested

Brian

compile script


# The operating system version, as reported by 'os', if applicable.
OS =    linux

# Use "g++ -M" instead of makedepend.
USE_GPP_M=1

# The C compiler.
CC =    gcc

# The C++ compiler.
CPLUSPLUS =     g++
CPLUSPLUS_EXTENSION = cc

KERNEL_DIR:=$(shell $(RCSLIB_MAIN_DIR)/etc/linuxkerneldir)

ifdef OPTIMIZE
ifndef OPTIMIZE_FLAG
OPTIMIZE_FLAG = -O2
endif
endif

ifndef NO_DEBUG
ifndef DEGUG_FLAG
DEBUG_FLAG = -g
endif
endif

WARN_FLAG=

ifdef WARN_MAX
WARN_FLAG=-Wall
endif

ifdef NO_WARN
WARN_FLAG=-w
endif

NO_RTL=1

#RT Linux header files are needed by the non-realtime linux apps sometimes
# primarily for mbuff and rtfifo definitions.
RTAI_DIR := $(shell $(RCSLIB_MAIN_DIR)/etc/rtaidir )

RTAI_INCLUDE = -I$(RTAI_DIR)/include


SEARCH_PATH_FLAG = -Xlinker -rpath -Xlinker

ifdef FOR_EXPORT_FROM_NIST

RCS_LIB_SEARCH_PATH=/tmp/lib \
	$(SEARCH_PATH_FLAG) $(RCS_PLATLIB) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/usr/local/nist/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/usr/local/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/opt/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/usr/share/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/usr/local/share/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/rcslib,$(RCS_PLATLIB)) \


else

RCS_LIB_SEARCH_PATH=/tmp/lib \
	$(SEARCH_PATH_FLAG) $(RCS_PLATLIB) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/proj/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/isd/proj/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/usr/local/nist/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/usr/local/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/opt/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/usr/share/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/usr/local/share/rcslib,$(RCS_PLATLIB)) \
	$(SEARCH_PATH_FLAG) $(subst $(RCSLIB_MAIN_DIR),/rcslib,$(RCS_PLATLIB)) \

endif

CFLAGS  = $(DEBUG_FLAG) $(OPTIMIZE_FLAG) $(WARN_FLAG)  -I$(KERNEL_DIR)/include -DLINUX -D$(PLAT) -DPLATNAME=\"$(PLAT)\" -L/usr/lib -Dlinux_2_4 $(RTAI_INCLUDE)  -Dlinux_2_4_17 -Dlinux -DHAVE_LIBDL  -DLINUX_KERNEL_2_4 -fstrict-aliasing  -I/usr/include/g++-2/ -DNO_RTL -DHAVE_RTAI

ifdef DEBUG_LINKING
CLINK = -Xlinker --verbose --Xlinker -ldl
else
CLINK = -ldl
endif

CPLUSPLUSFLAGS =        -D__CPLUSPLUS__ $(CFLAGS)
CPLUSPLUSLINK =         $(CLINK)

# Flags for compiling and linking X Windows apps
XINC = -I/usr/include
XLINK = -L/usr/X11/lib -L/usr/X11R6/lib -lXaw

TCL_VERSION:=$(shell find /usr/lib -name libtcl\*.so -o -name libtcl\*.a | grep -v tclx | grep -v stub | sed s./usr/lib/libtcl.. | sort -r  | head -n 1 | sed s/.so// | sed s/.a//)

TK_VERSION:=$(shell find /usr/lib -name libtk\*.so -o -name libtk\*.a | grep -v stub | grep -v tkx | sed s./usr/lib/libtk.. | sort -r  | head -n 1 | sed s/.so// | sed s/.a// )

# Flags for compiling and linking Tcl apps
TCL_INC =
TCL_LINK = -ltcl$(TCL_VERSION) -ldl
TK_LINK = -ltk$(TK_VERSION)

HAVE_TCLX:=$(shell if ls  /usr/lib/libtclx*.{a,so} 2>/dev/null >/dev/null; then echo yes ; else echo no; fi )

ifeq (yes, $(HAVE_TCLX))     
TCLX_VERSION:=$(shell find /usr/lib -name libtclx\*.so -o -name libtclx\*.a | grep -v stub | sed s./usr/lib/libtclx.. | sort -r  | head -n 1 | sed s/.so// | sed s/.a// )
CFLAGS += -DHAVE_TCL_EXTENDED
TCL_LINK+= -ltclx$(TCLX_VERSION)
endif

HAVE_TKX:=$(shell if ls  /usr/lib/libtk*.{a,so} 2>/dev/null >/dev/null; then echo yes ; else echo no; fi )

ifeq (yes, $(HAVE_TKX))
TKX_VERSION:=$(shell find /usr/lib -name libtkx\*.so -o -name libtkx\*.a | grep -v stub | sed s./usr/lib/libtkx.. | sort -r  | head -n 1 | sed s/.so// | sed s/.a// )
CFLAGS += -DHAVE_TK_EXTENDED
TK_LINK+= -ltkx$(TKX_VERSION)
endif


# makedepend must be run from a sun. (Preferably one with a cross-compiler.)
MAKEDEPEND = /usr/X11R6/bin/makedepend

# The library archiver and ranlib programs.
AR =    ar
RANLIB =        ranlib

# The assembler.
AS =    as

LD =    ld

PLATBIN =       $(RCSDIR)/plat/$(PLAT)/bin
PLATLIB =       $(RCSDIR)/plat/$(PLAT)/lib

DYNAMIC_LINK_FLAG = -dy -G


COPY_SOURCE_COMMAND = cp
RCSLIB_LIBRARY_NAME = librcs.a
STRIP = strip

# disable SCCS make rule for Linux       
% : SCCS/s.%
	-at-true

% ::    RCS/%,v
	co $-at-











Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact