diff --git a/configure/os/CONFIG_SITE.Common.linux-arm b/configure/os/CONFIG_SITE.Common.linux-arm index 556ac6f09..8f5fb8c82 100644 --- a/configure/os/CONFIG_SITE.Common.linux-arm +++ b/configure/os/CONFIG_SITE.Common.linux-arm @@ -1,39 +1,35 @@ # CONFIG_SITE.Common.linux-arm # -# Site Specific definitions for all linux-arm targets -#------------------------------------------------------- +# Site-specific settings for the linux-arm target -# NOTE for SHARED_LIBRARIES: In most cases if this is set to YES the +# NOTE: In most cases if SHARED_LIBRARIES is set to YES the # shared libraries will be found automatically. However if the .so # files are installed at a different path to their compile-time path # then in order to be found at runtime do one of these: # a) LD_LIBRARY_PATH must include the full absolute pathname to # $(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH) when invoking base # executables. -# b) Add the runtime path to SHRLIB_DEPLIB_DIRS and PROD_DEPLIB_DIRS, which +# b) Add the runtime path to SHRLIB_DEPLIB_DIRS and PROD_DEPLIB_DIRS, which # will add the named directory to the list contained in the executables. # c) Add the runtime path to /etc/ld.so.conf and run ldconfig # to inform the system of the shared library location. -# Depending on your version of Linux you'll want one of the following -# lines to enable command-line editing and history in iocsh. If you're -# not sure which, start with the top one and work downwards until the -# build doesn't fail to link the readline library. If none of them work, -# comment them all out to build without readline support. -# No other libraries needed (recent Fedora, Ubuntu etc.): -#COMMANDLINE_LIBRARY = READLINE +# Use GNU Readline if the header file is installed +COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \ + $(firstword $(READLINE_DIR) $(GNU_DIR))/include/readline/readline.h), \ + READLINE, EPICS)) -# Needs -lncurses (RHEL 5 etc.): +# If libreadline needs additional libraries to be linked with it, try +# uncommenting each of the lines below in turn, starting with the top +# one and working downwards, until the build succeeds. Do a 'make rebuild' +# from the top of the Base tree after changing this setting. + +# Needs -lncurses: #COMMANDLINE_LIBRARY = READLINE_NCURSES -# Needs -lcurses (older versions) +# Needs -lcurses: #COMMANDLINE_LIBRARY = READLINE_CURSES - -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g +# Readline is broken or you don't want use it: +#COMMANDLINE_LIBRARY = EPICS diff --git a/configure/os/CONFIG_SITE.Common.linux-cris b/configure/os/CONFIG_SITE.Common.linux-cris index b17cb0ee5..699f346ff 100644 --- a/configure/os/CONFIG_SITE.Common.linux-cris +++ b/configure/os/CONFIG_SITE.Common.linux-cris @@ -1,9 +1,8 @@ # CONFIG_SITE.Common.linux-cris # -# Site Specific definitions for linux-cris target -# Only the local epics system manager should modify this file +# Site-specific settings for the linux-cris target -# NOTE for SHARED_LIBRARIES: In most cases if this is set to YES the +# NOTE: In most cases if SHARED_LIBRARIES is set to YES the # shared libraries will be found automatically. However if the .so # files are installed at a different path to their compile-time path # then in order to be found at runtime do one of these: @@ -15,21 +14,21 @@ # c) Add the runtime path to /etc/ld.so.conf and run ldconfig # to inform the system of the shared library location. -# Depending on your version of Linux you may want one of the following -# lines to enable command-line editing and history in iocsh. If you're -# not sure which, start with the top one and work downwards until the -# build doesn't fail to link the readline library. If none of them work, -# comment them all out to build without readline support. -# No other libraries needed (recent Fedora, Ubuntu etc.): -#COMMANDLINE_LIBRARY = READLINE +# Use GNU Readline if the header file is installed +COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \ + $(GNU_DIR)/include/readline/readline.h), READLINE, EPICS)) -# Needs -lncurses (RHEL 5 etc.): +# If libreadline needs additional libraries to be linked with it, try +# uncommenting each of the lines below in turn, starting with the top +# one and working downwards, until the build succeeds. Do a 'make rebuild' +# from the top of the Base tree after changing this setting. + +# Needs -lncurses: #COMMANDLINE_LIBRARY = READLINE_NCURSES -# Needs -lcurses (older versions) +# Needs -lcurses: #COMMANDLINE_LIBRARY = READLINE_CURSES - -OP_SYS_CFLAGS += -g - +# Readline is broken or you don't want use it: +#COMMANDLINE_LIBRARY = EPICS diff --git a/configure/os/CONFIG_SITE.Common.linux-microblaze b/configure/os/CONFIG_SITE.Common.linux-microblaze index 43c543c2b..b66b4cced 100644 --- a/configure/os/CONFIG_SITE.Common.linux-microblaze +++ b/configure/os/CONFIG_SITE.Common.linux-microblaze @@ -1,7 +1,6 @@ # CONFIG_SITE.Common.linux-microblaze # -# Site specific definitions for linux-microblaze target builds. -#------------------------------------------------------- +# Site-specific settings for the linux-microblaze target # The gnu tools for cross compiling for MicroBlaze (little endian) # on Linux can be downloaded from the Xilinx git server: @@ -12,3 +11,21 @@ GNU_DIR = /usr/local/vw/microblaze-2.0/microblazeel-unknown-linux-gnu + +# Use GNU Readline if the header file is installed +COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \ + $(GNU_DIR)/include/readline/readline.h), READLINE, EPICS)) + +# If libreadline needs additional libraries to be linked with it, try +# uncommenting each of the lines below in turn, starting with the top +# one and working downwards, until the build succeeds. Do a 'make rebuild' +# from the top of the Base tree after changing this setting. + +# Needs -lncurses: +#COMMANDLINE_LIBRARY = READLINE_NCURSES + +# Needs -lcurses: +#COMMANDLINE_LIBRARY = READLINE_CURSES + +# Readline is broken or you don't want use it: +#COMMANDLINE_LIBRARY = EPICS diff --git a/configure/os/CONFIG_SITE.Common.linux-x86 b/configure/os/CONFIG_SITE.Common.linux-x86 index 07182820d..22410a5af 100644 --- a/configure/os/CONFIG_SITE.Common.linux-x86 +++ b/configure/os/CONFIG_SITE.Common.linux-x86 @@ -1,9 +1,8 @@ # CONFIG_SITE.Common.linux-x86 # -# Site Specific definitions for linux-x86 target -# Only the local epics system manager should modify this file +# Site-specific settings for the linux-x86 target -# NOTE for SHARED_LIBRARIES: In most cases if this is set to YES the +# NOTE: In most cases if SHARED_LIBRARIES is set to YES the # shared libraries will be found automatically. However if the .so # files are installed at a different path to their compile-time path # then in order to be found at runtime do one of these: @@ -15,14 +14,15 @@ # c) Add the runtime path to /etc/ld.so.conf and run ldconfig # to inform the system of the shared library location. -# Depending on your version of Linux you'll want one of the following -# lines to enable command-line editing and history in iocsh. If you're -# not sure which, start with the top one and work downwards until the -# build doesn't fail to link the readline library. If none of them work, -# comment them all out to build without readline support. -# No other libraries needed (recent Fedora, Ubuntu etc.): -COMMANDLINE_LIBRARY = READLINE +# Use GNU Readline if the header file is installed +COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \ + $(GNU_DIR)/include/readline/readline.h), READLINE, EPICS)) + +# If libreadline needs additional libraries to be linked with it, try +# uncommenting each of the lines below in turn, starting with the top +# one and working downwards, until the build succeeds. Do a 'make rebuild' +# from the top of the Base tree after changing this setting. # Needs -lncurses (RHEL 5 etc.): #COMMANDLINE_LIBRARY = READLINE_NCURSES @@ -30,6 +30,9 @@ COMMANDLINE_LIBRARY = READLINE # Needs -lcurses (older versions) #COMMANDLINE_LIBRARY = READLINE_CURSES +# Readline is broken or you don't want use it: +#COMMANDLINE_LIBRARY = EPICS + # Permit access to 64-bit file-systems OP_SYS_CFLAGS += -D_FILE_OFFSET_BITS=64 @@ -43,14 +46,6 @@ OP_SYS_CFLAGS += -D_FILE_OFFSET_BITS=64 #CCC = clang++ -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - - # Tune GNU compiler output for a specific 32-bit cpu-type # (e.g. generic, native, i386, i686, pentium2/3/4, prescott, k6, athlon etc.) GNU_TUNE_CFLAGS = -mtune=generic diff --git a/configure/os/CONFIG_SITE.Common.linux-x86_64 b/configure/os/CONFIG_SITE.Common.linux-x86_64 index 18fb2974d..f75c4f210 100644 --- a/configure/os/CONFIG_SITE.Common.linux-x86_64 +++ b/configure/os/CONFIG_SITE.Common.linux-x86_64 @@ -1,9 +1,8 @@ # CONFIG_SITE.Common.linux-x86_64 # -# Site Specific definitions for linux-x86_64 target -# Only the local epics system manager should modify this file +# Site-specific settings for the linux-x86_64 target -# NOTE for SHARED_LIBRARIES: In most cases if this is set to YES the +# NOTE: In most cases if SHARED_LIBRARIES is set to YES the # shared libraries will be found automatically. However if the .so # files are installed at a different path to their compile-time path # then in order to be found at runtime do one of these: @@ -15,14 +14,15 @@ # c) Add the runtime path to /etc/ld.so.conf and run ldconfig # to inform the system of the shared library location. -# Depending on your version of Linux you'll want one of the following -# lines to enable command-line editing and history in iocsh. If you're -# not sure which, start with the top one and work downwards until the -# build doesn't fail to link the readline library. If none of them work, -# comment them all out to build without readline support. -# No other libraries needed (recent Fedora, Ubuntu etc.): -COMMANDLINE_LIBRARY = READLINE +# Use GNU Readline if the header file is installed +COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \ + $(GNU_DIR)/include/readline/readline.h), READLINE, EPICS)) + +# If libreadline needs additional libraries to be linked with it, try +# uncommenting each of the lines below in turn, starting with the top +# one and working downwards, until the build succeeds. Do a 'make rebuild' +# from the top of the Base tree after changing this setting. # Needs -lncurses (RHEL 5 etc.): #COMMANDLINE_LIBRARY = READLINE_NCURSES @@ -30,6 +30,9 @@ COMMANDLINE_LIBRARY = READLINE # Needs -lcurses (older versions) #COMMANDLINE_LIBRARY = READLINE_CURSES +# Readline is broken or you don't want use it: +#COMMANDLINE_LIBRARY = EPICS + # Uncomment the followings lines to build with CLANG instead of GCC. # @@ -39,14 +42,6 @@ COMMANDLINE_LIBRARY = READLINE #CCC = clang++ -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - - # Tune GNU compiler output for a specific 64-bit cpu-type # (e.g. generic, native, core2, nocona, k8, opteron, athlon64, barcelona etc.) GNU_TUNE_CFLAGS = -mtune=generic diff --git a/configure/os/CONFIG_SITE.Common.linux-xscale_be b/configure/os/CONFIG_SITE.Common.linux-xscale_be index 015229647..5fb5a4642 100644 --- a/configure/os/CONFIG_SITE.Common.linux-xscale_be +++ b/configure/os/CONFIG_SITE.Common.linux-xscale_be @@ -1,4 +1,23 @@ # CONFIG_SITE.Common.linux-xscale_be # -# Site specific definitions for all linux-xscale_be target builds. -#------------------------------------------------------- +# Site-specific settings for the linux-xscale_be target + + +# Use GNU Readline if the header file is installed +COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \ + $(firstword $(READLINE_DIR) $(GNU_DIR))/include/readline/readline.h), \ + READLINE, EPICS)) + +# If libreadline needs additional libraries to be linked with it, try +# uncommenting each of the lines below in turn, starting with the top +# one and working downwards, until the build succeeds. Do a 'make rebuild' +# from the top of the Base tree after changing this setting. + +# Needs -lncurses: +#COMMANDLINE_LIBRARY = READLINE_NCURSES + +# Needs -lcurses: +#COMMANDLINE_LIBRARY = READLINE_CURSES + +# Readline is broken or you don't want use it: +#COMMANDLINE_LIBRARY = EPICS diff --git a/configure/os/CONFIG_SITE.Common.linuxCommon b/configure/os/CONFIG_SITE.Common.linuxCommon new file mode 100644 index 000000000..7f5d4aa11 --- /dev/null +++ b/configure/os/CONFIG_SITE.Common.linuxCommon @@ -0,0 +1,11 @@ +# CONFIG_SITE.Common.linuxCommon +# +# Site-specific settings for all linux targets + + +# It makes sense to include debugging symbols even in optimized builds +# in case you want to attach gdb to the process or examine a core-dump. +# This does cost disk space, but not memory as debug symbols are not +# loaded into RAM when the binary is loaded. +OPT_CFLAGS_YES += -g +OPT_CXXFLAGS_YES += -g diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md index 0b9ed400f..707b8b1a7 100644 --- a/documentation/RELEASE_NOTES.md +++ b/documentation/RELEASE_NOTES.md @@ -6,7 +6,16 @@ This version of EPICS Base has not been released yet. -### Replace EPICS_TIMEZONE with EPICS_TZ +### GNU Readline detection on Linux + +Most Linux architectures should now configure themselves automatically to use +the GNU Readline library if its main header file can be found in the expected +place, and not try to use Readline if the header file isn't present. For older +Linux architectures where libncurses or libcurses must also be linked with, the +manual configuration of the `COMMANDLINE_LIBRARY` variable in the appropriate +`configure/os/CONFIG_SITE.Common.` file will still be necessary. + +### Replace `EPICS_TIMEZONE` with `EPICS_TZ` The `EPICS_TIMEZONE` environment parameter provided time-zone information for the IOC's locale in the old ANSI format expected by VxWorks for its `TIMEZONE` @@ -25,7 +34,7 @@ Larry Hoff in 2009; it is unforunate that it has taken 10 years for them to be integrated into Base. The default value for the `EPICS_TZ` environment parameter is set in the Base -configure/CONFIG_SITE_ENV file, which contains example settings for most EPICS +`configure/CONFIG_SITE_ENV` file, which contains example settings for most EPICS sites that use VxWorks, and a link to a page describing the Posix TZ format for any locations that I missed.