configure: Change "sim" to "uspace", with fallout elsewhere
This commit is contained in:
parent
7801534668
commit
1d6c0d0646
13 changed files with 67 additions and 74 deletions
|
|
@ -75,7 +75,7 @@ CheckConfig(){
|
|||
MODULES_LOAD=
|
||||
MODULES_UNLOAD=
|
||||
case $RTPREFIX in
|
||||
sim) SHM_DEV=/dev/zero;;
|
||||
uspace) SHM_DEV=/dev/zero;;
|
||||
*)
|
||||
for MOD in $MODULES ; do
|
||||
eval MOD=\${MODPATH_$MOD}
|
||||
|
|
@ -103,7 +103,7 @@ CheckConfig(){
|
|||
|
||||
CheckStatus(){
|
||||
case $RTPREFIX in
|
||||
sim)
|
||||
uspace)
|
||||
if [ -z "$($PIDOF rtapi_app)" ]; then
|
||||
exit 1
|
||||
else
|
||||
|
|
@ -152,7 +152,7 @@ CheckMem(){
|
|||
Load(){
|
||||
CheckKernel
|
||||
case $RTPREFIX in
|
||||
sim)
|
||||
uspace)
|
||||
;;
|
||||
*)
|
||||
for MOD in $MODULES_LOAD ; do
|
||||
|
|
@ -181,7 +181,7 @@ CheckLoaded(){
|
|||
Unload(){
|
||||
CheckKernel
|
||||
case $RTPREFIX in
|
||||
sim)
|
||||
uspace)
|
||||
rtapi_app exit
|
||||
ipcrm -M 0x48414c32 2>/dev/null ;# HAL_KEY
|
||||
ipcrm -M 0x90280A48 2>/dev/null ;# RTAPI_KEY
|
||||
|
|
|
|||
18
src/Makefile
18
src/Makefile
|
|
@ -85,7 +85,7 @@ ifeq ($(KERNELRELEASE),)
|
|||
# The "modules" target is the gateway to the kernel module build.
|
||||
default: configs userspace modules
|
||||
ifeq ($(RUN_IN_PLACE),yes)
|
||||
ifneq ($(BUILD_SYS),sim)
|
||||
ifneq ($(BUILD_SYS),uspace)
|
||||
@if [ -f ../bin/linuxcnc_module_helper ]; then if ! [ `stat -c %u ../bin/linuxcnc_module_helper` -eq 0 -a -u ../bin/linuxcnc_module_helper ]; then $(VECHO) "You now need to run 'sudo make setuid' in order to run in place."; fi; fi
|
||||
endif
|
||||
endif
|
||||
|
|
@ -463,7 +463,7 @@ clean: depclean modclean
|
|||
# So that nothing is built as root, this rule does not depend on the touched
|
||||
# files (Note that files in depends/ might be rebuilt, and there's little that
|
||||
# can be done about it)
|
||||
ifeq ($(BUILD_SYS),sim)
|
||||
ifeq ($(BUILD_SYS),uspace)
|
||||
setuid:
|
||||
@echo "'make setuid' is not needed for the simulator"
|
||||
else
|
||||
|
|
@ -667,7 +667,7 @@ install-kernel-dep:
|
|||
$(DESTDIR)$(bindir) \
|
||||
$(DESTDIR)$(sysconfdir)/linuxcnc
|
||||
$(FILE) ../rtlib/*$(MODULE_EXT) $(DESTDIR)$(EMC2_RTLIB_DIR)
|
||||
ifneq "$(BUILD_SYS)" "sim"
|
||||
ifneq "$(BUILD_SYS)" "uspace"
|
||||
$(FILE) Module.symvers $(DESTDIR)$(EMC2_RTLIB_DIR)
|
||||
$(SETUID) ../bin/linuxcnc_module_helper $(DESTDIR)$(bindir)
|
||||
$(SETUID) ../bin/pci_write $(DESTDIR)$(bindir)
|
||||
|
|
@ -773,7 +773,7 @@ endif
|
|||
# find a way around it.
|
||||
|
||||
# Subdirectory: rtapi
|
||||
ifneq ($(BUILD_SYS),sim)
|
||||
ifneq ($(BUILD_SYS),uspace)
|
||||
obj-$(CONFIG_RTAPI) += rtapi.o
|
||||
rtapi-objs := rtapi/$(RTPREFIX)_rtapi.o
|
||||
endif
|
||||
|
|
@ -825,7 +825,7 @@ obj-$(CONFIG_SAMPLER) += sampler.o
|
|||
sampler-objs := hal/components/sampler.o $(MATHSTUB)
|
||||
|
||||
# Subdirectory: hal/drivers
|
||||
ifneq ($(BUILD_SYS),sim)
|
||||
ifneq ($(BUILD_SYS),uspace)
|
||||
obj-$(CONFIG_HAL_PARPORT) += hal_parport.o
|
||||
hal_parport-objs := hal/drivers/hal_parport.o $(MATHSTUB)
|
||||
obj-$(CONFIG_PCI_8255) += pci_8255.o
|
||||
|
|
@ -977,7 +977,7 @@ motmod-objs += libnml/posemath/_posemath.o
|
|||
motmod-objs += libnml/posemath/sincos.o $(MATHSTUB)
|
||||
|
||||
TORTOBJS = $(foreach file,$($(patsubst %.o,%,$(1))-objs), objects/rt$(file))
|
||||
ifeq ($(BUILD_SYS),sim)
|
||||
ifeq ($(BUILD_SYS),uspace)
|
||||
EXTRA_CFLAGS += -fPIC -Os
|
||||
RTOBJS := $(sort $(foreach mod,$(obj-m),$(call TORTOBJS,$(mod))))
|
||||
|
||||
|
|
@ -997,7 +997,7 @@ $(sort $(RTOBJS)) : objects/rt%.o : %.c
|
|||
$(ECHO) Compiling realtime $<
|
||||
@rm -f $@
|
||||
@mkdir -p $(dir $@)
|
||||
$(Q)$(CC) -c $(OPT) $(DEBUG) $(EXTRA_DEBUG) -DSIM -DSIMULATOR -DRTAPI $(EXTRA_CFLAGS) \
|
||||
$(Q)$(CC) -c $(OPT) $(DEBUG) $(EXTRA_DEBUG) -DRTAPI $(EXTRA_CFLAGS) \
|
||||
-MP -MD -MF "${@:.o=.d}" -MT "$@" \
|
||||
$< -o $@
|
||||
endif
|
||||
|
|
@ -1021,8 +1021,8 @@ $(sort $(RTOBJS)) : objects/rt%.o : %.c
|
|||
$(Q)ld -r -static -S $(LDFLAGS) -o $@ $^ $(EXTRALINK) $(MATHLIB)
|
||||
endif
|
||||
|
||||
ifneq "$(filter normal sim,$(BUILD_SYS))" ""
|
||||
ifneq "$(BUILD_SYS)" "sim"
|
||||
ifneq "$(filter normal uspace,$(BUILD_SYS))" ""
|
||||
ifneq "$(BUILD_SYS)" "uspace"
|
||||
../rtlib/rtapi$(MODULE_EXT): $(addprefix objects/rt,$(rtapi-objs))
|
||||
endif
|
||||
../rtlib/classicladder_rt$(MODULE_EXT): $(addprefix objects/rt,$(classicladder_rt-objs))
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@
|
|||
# complex-objs := complex1.o complex2.o complex_main.o
|
||||
# include .../Makefile.modinc
|
||||
|
||||
# Currently this Makefile is only suitable for 'kbuild' and 'sim' systems, but
|
||||
# there is no technical reason it cannot be extended to pre-kbuild systems.
|
||||
# Currently this Makefile is only suitable for 'kbuild' and 'uspace' systems,
|
||||
# but there is no technical reason it cannot be extended to pre-kbuild systems.
|
||||
|
||||
# When there is a single module and it consists of a single source file, an
|
||||
# easier way to build modules is to invoke 'comp':
|
||||
|
|
@ -95,7 +95,7 @@ install:
|
|||
cp $(patsubst %.o,%.ko,$(obj-m)) $(DESTDIR)$(RTLIBDIR)/
|
||||
endif
|
||||
|
||||
ifeq ($(BUILDSYS),sim)
|
||||
ifeq ($(BUILDSYS),uspace)
|
||||
EXTRA_CFLAGS += -DSIM -fPIC
|
||||
allmodules = $(patsubst %.o,%.so,$(obj-m))
|
||||
modules: $(allmodules)
|
||||
|
|
@ -125,6 +125,6 @@ IS_POWERPC = test `uname -m` = ppc -o `uname -m` = ppc64
|
|||
endif
|
||||
|
||||
ifeq ($(BUILDSYS),normal)
|
||||
$(error Makefile.modinc is only suitable for 'kbuild' kernels and 'sim' systems)
|
||||
$(error Makefile.modinc is only suitable for 'kbuild' kernels and 'uspace' systems)
|
||||
endif
|
||||
|
||||
|
|
|
|||
|
|
@ -157,39 +157,30 @@ RTL_MOD=""
|
|||
# accept --with-realtime=<path> from commandline #
|
||||
##############################################################################
|
||||
|
||||
RTDIR=""
|
||||
AC_ARG_ENABLE(simulator,
|
||||
[ --enable-simulator Run as a pure userspace program],
|
||||
[
|
||||
case "$enableval" in
|
||||
Y*|y*)
|
||||
SIMULATOR=yes
|
||||
RTS=simulator
|
||||
BUILD_SYS=sim
|
||||
MODEXT=.so
|
||||
MODULE_DIR=${prefix}/lib/linuxcnc/modules
|
||||
AC_MSG_RESULT([configuring for simulator])
|
||||
;;
|
||||
*)
|
||||
SIMULATOR=no
|
||||
Y*|y*)
|
||||
RTS=uspace
|
||||
AC_MSG_WARN([--enable-simulator is deprecated. Use --with-realtime=uspace instead.])
|
||||
;;
|
||||
esac
|
||||
],
|
||||
[
|
||||
SIMULATOR=no
|
||||
])
|
||||
AC_SUBST(SIMULATOR)
|
||||
|
||||
AC_ARG_WITH(realtime,
|
||||
[ --with-realtime=<path to realtime> Path where RTAI or RTlinux is installed],
|
||||
[ --with-realtime=<path to realtime> Path where RTAI or RTlinux is installed, or "uspace" for POSIX userspace],
|
||||
[ case "$withval" in
|
||||
"" | y | ye | yes | n | no)
|
||||
AC_MSG_ERROR([You must supply a path for --with-realtime.]) ;;
|
||||
AC_MSG_ERROR([You must supply a path or "uspace" for --with-realtime.]) ;;
|
||||
*)
|
||||
case "$SIMULATOR" in
|
||||
yes) AC_MSG_ERROR([--with-realtime and --enable-simulator are mutually exclusive]) ;;
|
||||
*) RTDIR="$withval" ;;
|
||||
esac
|
||||
;;
|
||||
esac])
|
||||
if test ! -z "$RTS"; then
|
||||
AC_MSG_ERROR([--with-realtime and --enable-simulator are mutually exclusive])
|
||||
fi
|
||||
RTS="$withval" ;;
|
||||
esac
|
||||
])
|
||||
|
||||
##############################################################################
|
||||
# Subsection 2.2 #
|
||||
|
|
@ -205,19 +196,22 @@ AC_ARG_WITH(realtime,
|
|||
# rtai-config for RTAI 3.x #
|
||||
##############################################################################
|
||||
|
||||
#at this point if RTDIR is empty, we need to find RT ourselves
|
||||
if test $SIMULATOR = yes; then
|
||||
RTS=sim
|
||||
#at this point if RTS is empty, we need to find RT ourselves
|
||||
if test "$RTS" = uspace ; then
|
||||
AC_MSG_RESULT([Using userspace realtime]);
|
||||
AC_PATH_PROG(PTH_CONFIG,pth-config,"")
|
||||
if test "$PTH_CONFIG" = ""; then
|
||||
AC_MSG_ERROR([GNU PTH library is required: get it with apt-get install libpth-dev])
|
||||
fi
|
||||
elif test -x "$RTS" -a ! -d "$RTS"; then
|
||||
AC_MSG_RESULT([Using $RTS as configure script for realtime])
|
||||
else
|
||||
if test -z "$RTDIR"; then
|
||||
DIRS="/usr/realtime-`uname -r` /usr/realtime /usr/realtime* /usr /usr/src/rtai*"
|
||||
else
|
||||
DIRS="$RTDIR"
|
||||
DIRS="$RTS"
|
||||
fi
|
||||
RTS=""
|
||||
for location in $DIRS; do
|
||||
for subdir in . scripts bin; do
|
||||
for signature in rtai rtl realtime; do
|
||||
|
|
@ -303,13 +297,16 @@ case $RTS in
|
|||
RTFLAGS=`$RTS --cflags`
|
||||
KERNELDIR=`$RTS --linux`
|
||||
;;
|
||||
sim)
|
||||
uspace)
|
||||
RTPREFIX=uspace
|
||||
RTDIR=$(pwd -P)
|
||||
RTFLAGS=-DSIMULATOR
|
||||
RTFLAGS=-DUSPACE
|
||||
BUILD_SYS=uspace
|
||||
MODEXT=.so
|
||||
MODULE_DIR=${prefix}/lib/linuxcnc/modules
|
||||
esac
|
||||
|
||||
if test $RTS != sim; then
|
||||
if test "$RTS" != uspace; then
|
||||
AC_MSG_CHECKING([for location of kernel headers])
|
||||
AC_ARG_WITH(kernel-headers,
|
||||
[ --with-kernel-headers=<directory> Location for kernel headers],
|
||||
|
|
@ -331,13 +328,14 @@ AC_SUBST([RTFLAGS])
|
|||
AC_SUBST([RTDIR])
|
||||
AC_SUBST([RTARCH])
|
||||
|
||||
if test $RTPREFIX = sim; then
|
||||
AC_DEFINE(RTAPI_SIM, [], [Realtime system is simulated])
|
||||
elif test $RTPREFIX = rtai; then
|
||||
AC_DEFINE(RTAPI_RTAI, [], [Realtime system is RTAI])
|
||||
elif test $RTPREFIX = rtl; then
|
||||
AC_DEFINE(RTAPI_RTL, [], [Realtime system is RTL])
|
||||
fi
|
||||
case "$RTPREFIX" in
|
||||
uspace)
|
||||
AC_DEFINE(RTAPI_USPACE, [], [Realtime system is userspace]) ;;
|
||||
rtai)
|
||||
AC_DEFINE(RTAPI_RTAI, [], [Realtime system is RTAI]) ;;
|
||||
rtl)
|
||||
AC_DEFINE(RTAPI_RTL, [], [Realtime system is RTL]) ;;
|
||||
esac
|
||||
|
||||
|
||||
EMC2_HOME=`(cd .. ; pwd)`
|
||||
|
|
@ -509,7 +507,7 @@ install with "sudo apt-get install libusb-1.0-0-dev" or disable with
|
|||
# compiled against. #
|
||||
##############################################################################
|
||||
|
||||
if test $RTS '!=' sim; then
|
||||
if test $RTS '!=' uspace; then
|
||||
AC_CHECK_HEADERS([$KERNELDIR/include/linux/version.h],[],[AC_MSG_ERROR([version.h not found - Is the kernel headers package installed ?])])
|
||||
|
||||
# Unfortunately, many distributions (redhat, mandrake) have #defines
|
||||
|
|
@ -1094,7 +1092,7 @@ AC_SUBST(BUILD_DOCS_HTML)
|
|||
# tests and linking to mathstubs.o at a later stage. #
|
||||
##############################################################################
|
||||
|
||||
if test "$SIMULATOR" != "yes"
|
||||
if test $RTS '!=' uspace
|
||||
then
|
||||
AC_MSG_CHECKING([for kernel math support])
|
||||
USE_LIBM=""
|
||||
|
|
@ -1769,21 +1767,16 @@ echo "# GPL. Check out http://www.linuxcnc.org/ for more details. #"
|
|||
echo "# #"
|
||||
echo "# #"
|
||||
echo "# It seems that ./configure completed successfully. #"
|
||||
if test $SIMULATOR = yes; then
|
||||
echo "# However, the configuration is for a simulator only, no RT #"
|
||||
echo "# capabilities will be used. In this mode no control of hardware #"
|
||||
echo "# is possible. Drivers won't be built. #"
|
||||
else
|
||||
echo "# This means that RT is properly installed #"
|
||||
fi
|
||||
echo "# If things don't work check config.log for errors & warnings #"
|
||||
echo "# #"
|
||||
|
||||
if test "xyes" = "x$RUN_IN_PLACE"; then
|
||||
echo "# Next compile by typing #"
|
||||
echo "# make #"
|
||||
if test $SIMULATOR != yes; then
|
||||
echo "# sudo make setuid #"
|
||||
if test $RTS = uspace; then
|
||||
echo "# (if realtime behavior and hardware access are required) #"
|
||||
fi
|
||||
echo "# #"
|
||||
echo "# Before running the software, set the environment: #"
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ pluto_clean:
|
|||
|
||||
# The kernel's build system won't know how to rebuild generated files
|
||||
# so modules must depend on them explicitly
|
||||
ifneq ($(BUILD_SYS),sim)
|
||||
ifneq ($(BUILD_SYS),uspace)
|
||||
modules: \
|
||||
hal/drivers/pluto_servo_rbf.h \
|
||||
hal/drivers/pluto_step_rbf.h
|
||||
|
|
|
|||
|
|
@ -1148,7 +1148,7 @@ void init_hal(void) {
|
|||
PyModule_AddIntConstant(m, "HAL_OUT", HAL_OUT);
|
||||
PyModule_AddIntConstant(m, "HAL_IO", HAL_IO);
|
||||
|
||||
#ifdef RTAPI_SIM
|
||||
#ifdef RTAPI_USPACE
|
||||
PyModule_AddIntConstant(m, "is_sim", 1);
|
||||
PyModule_AddIntConstant(m, "is_rt", 0);
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
ifeq ($(BUILD_SYS),sim)
|
||||
ifeq ($(BUILD_SYS),uspace)
|
||||
UPARPORT_SRCS := $(addprefix hal/simdrivers/, \
|
||||
uparport.c)
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ $(call TOOBJSDEPS, $(HALGTKSRCS)) : EXTRAFLAGS = $(GTK_CFLAGS)
|
|||
$(call TOOBJS, $(HALGTKSRCS)): Makefile.inc
|
||||
endif
|
||||
|
||||
ifneq ($(BUILD_SYS),sim)
|
||||
ifneq ($(BUILD_SYS),uspace)
|
||||
PCIWRITESRCS := hal/utils/pci_write.c hal/utils/upci.c
|
||||
USERSRCS += $(PCIWRITESRCS)
|
||||
../bin/pci_write: $(call TOOBJS, $(PCIWRITESRCS))
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ int do_newinst_cmd(char *comp_name, char *inst_name) {
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if defined(RTAPI_SIM)
|
||||
#if defined(RTAPI_USPACE)
|
||||
{
|
||||
char *argv[MAX_TOK];
|
||||
int m = 0, result;
|
||||
|
|
@ -1062,7 +1062,7 @@ int do_loadrt_cmd(char *mod_name, char *args[])
|
|||
hal_comp_t *comp;
|
||||
char *argv[MAX_TOK+3];
|
||||
char *cp1;
|
||||
#if defined(RTAPI_SIM)
|
||||
#if defined(RTAPI_USPACE)
|
||||
argv[m++] = "-Wn";
|
||||
argv[m++] = mod_name;
|
||||
argv[m++] = EMC2_BIN_DIR "/rtapi_app";
|
||||
|
|
@ -1126,7 +1126,7 @@ int do_loadrt_cmd(char *mod_name, char *args[])
|
|||
|
||||
if ( retval != 0 ) {
|
||||
halcmd_error("insmod failed, returned %d\n"
|
||||
#if !defined(RTAPI_SIM)
|
||||
#if !defined(RTAPI_USPACE)
|
||||
"See the output of 'dmesg' for more information.\n"
|
||||
#endif
|
||||
, retval );
|
||||
|
|
@ -1321,7 +1321,7 @@ static int unloadrt_comp(char *mod_name)
|
|||
int retval;
|
||||
char *argv[4];
|
||||
|
||||
#if defined(RTAPI_SIM)
|
||||
#if defined(RTAPI_USPACE)
|
||||
argv[0] = EMC2_BIN_DIR "/rtapi_app";
|
||||
argv[1] = "unload";
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -1131,7 +1131,7 @@ static int doLoadRt(char *mod_name, char *args[], connectionRecType *context)
|
|||
char *cp1;
|
||||
const char *nakStr = "SET LOADRT NAK";
|
||||
|
||||
#if defined(RTAPI_SIM)
|
||||
#if defined(RTAPI_USPACE)
|
||||
#if 0
|
||||
argv[m++] = "-Wn";
|
||||
argv[m++] = mod_name;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ INCLUDES += rtapi
|
|||
../include/%.hh: ./rtapi/%.hh
|
||||
cp $^ $@
|
||||
|
||||
ifeq ($(BUILD_SYS),sim)
|
||||
ifeq ($(BUILD_SYS),uspace)
|
||||
|
||||
RTAPI_APP_SRCS := \
|
||||
rtapi/uspace_rtapi_app.cc \
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ static pth_uctx_t main_ctx, this_ctx;
|
|||
/* data for all tasks */
|
||||
static struct rtapi_task task_array[MAX_TASKS] = {{0},};
|
||||
|
||||
/* Priority functions. SIM uses 0 as the highest priority, as the
|
||||
/* Priority functions. USPACE uses 0 as the highest priority, as the
|
||||
number increases, the actual priority of the task decreases. */
|
||||
|
||||
int rtapi_prio_highest(void)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
. rtapi.conf
|
||||
|
||||
if [ "$RTPREFIX" = sim ]; then
|
||||
if [ "$RTPREFIX" = uspace ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue