]> www.ginac.de Git - ginac.git/commitdiff
Install ginac-excompiler in $LIBEXECDIR, not in $BINDIR.
authorRichard Kreckel <kreckel@ginac.de>
Mon, 4 Apr 2016 07:05:50 +0000 (09:05 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Mon, 4 Apr 2016 07:05:50 +0000 (09:05 +0200)
...and make the GiNaC library aware of where it is installed.

The ginac-excompiler script is only invoked by GiNaC::compile_ex(...)
and serves no purpose on its own. In compliance with the FHS, it should
be installed in $LIBEXECDIR, not in $BINDIR. This also disburdens
distribution packagers from having to provide a manpage (which may be
required for all programs in $BINDIR).

The location for $LIBEXECDIR defaults to ${prefix}/libexec/. It may be
overwritten at configuration time. (Many distributions want to set it to
${prefix}/lib/ginac/.)

CMakeLists.txt
doc/tutorial/ginac.texi
ginac/CMakeLists.txt
ginac/Makefile.am
ginac/excompiler.cpp
tools/CMakeLists.txt
tools/Makefile.am

index 182207d984e28aebcb864bb7311e84835068eb72..cdb18f092cdecc1222de3daaf94e1deeb5be5d3c 100644 (file)
@@ -171,6 +171,10 @@ find_program(FIG2DEV fig2dev)
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 add_definitions(-DHAVE_CONFIG_H)
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 add_definitions(-DHAVE_CONFIG_H)
 
+if (NOT LIBEXECDIR)
+       set (LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/libexec")
+endif()
+
 add_subdirectory(ginac)
 add_subdirectory(tools)
 add_subdirectory(check)
 add_subdirectory(ginac)
 add_subdirectory(tools)
 add_subdirectory(check)
index ecf4a2272b271a3ed7baf48a85d7907d13848c4a..17718f83936564157ca2aacc38699ec14ebacb6d 100644 (file)
@@ -6691,9 +6691,9 @@ ones supplied to @code{compile_ex} should appear in the expression.
 @cindex ginac-excompiler
 @code{compile_ex} uses the shell script @code{ginac-excompiler} to start the C
 compiler and produce the object files. This shell script comes with GiNaC and
 @cindex ginac-excompiler
 @code{compile_ex} uses the shell script @code{ginac-excompiler} to start the C
 compiler and produce the object files. This shell script comes with GiNaC and
-will be installed together with GiNaC in the configured @code{$PREFIX/bin}
-directory. You can also export additional compiler flags via the $CXXFLAGS
-variable:
+will be installed together with GiNaC in the configured @code{$LIBEXECDIR}
+(typically @code{$PREFIX/libexec} or @code{$PREFIX/lib/ginac}). You can also
+export additional compiler flags via the @env{$CXXFLAGS} variable:
 
 @example
 setenv("CXXFLAGS", "-O3 -fomit-frame-pointer -ffast-math", 1);
 
 @example
 setenv("CXXFLAGS", "-O3 -fomit-frame-pointer -ffast-math", 1);
index 00824a49eb572e17146f450fb59dc7dba4fab134..db96393591c8770b3b9aefd3a51c60fc6797f168 100644 (file)
@@ -147,6 +147,7 @@ set(ginaclib_private_headers
 )
 
 add_library(ginac ${ginaclib_sources})
 )
 
 add_library(ginac ${ginaclib_sources})
+add_definitions(-DLIBEXECDIR="${LIBEXECDIR}/")
 set_target_properties(ginac PROPERTIES
        SOVERSION ${ginaclib_soversion}
        VERSION ${ginaclib_version})
 set_target_properties(ginac PROPERTIES
        SOVERSION ${ginaclib_soversion}
        VERSION ${ginaclib_version})
index 6f9fe7489f421b14bc2f524cadba598d3aa9fc4d..890c5ac84facddca6b2a2752ce439738de4d5fd3 100644 (file)
@@ -58,6 +58,7 @@ polynomial/smod_helpers.h \
 polynomial/debug.h
 
 libginac_la_LDFLAGS = -version-info $(LT_VERSION_INFO)
 polynomial/debug.h
 
 libginac_la_LDFLAGS = -version-info $(LT_VERSION_INFO)
+libginac_la_CPPFLAGS = -DLIBEXECDIR='"$(libexecdir)/"'
 libginac_la_LIBADD = $(DL_LIBS)
 ginacincludedir = $(includedir)/ginac
 ginacinclude_HEADERS = ginac.h add.h archive.h assertion.h basic.h class_info.h \
 libginac_la_LIBADD = $(DL_LIBS)
 ginacincludedir = $(includedir)/ginac
 ginacinclude_HEADERS = ginac.h add.h archive.h assertion.h basic.h class_info.h \
index 1ef61d1f786ec309195e1c456f441f1cc54428e5..68e4a302a70420216411fedf61ad5f25b468e4a6 100644 (file)
@@ -140,7 +140,7 @@ public:
         */
        void compile_src_file(const std::string filename, bool clean_up)
        {
         */
        void compile_src_file(const std::string filename, bool clean_up)
        {
-               std::string strcompile = "ginac-excompiler " + filename;
+               std::string strcompile = LIBEXECDIR "ginac-excompiler " + filename;
                if (system(strcompile.c_str())) {
                        throw std::runtime_error("excompiler::compile_src_file: error compiling source file!");
                }
                if (system(strcompile.c_str())) {
                        throw std::runtime_error("excompiler::compile_src_file: error compiling source file!");
                }
index d92e5d930487ab5a352e972fc877d9a5959b0870..6feeb2d9c3c5296c4efd27967bd32d827f8c31dc 100644 (file)
@@ -12,5 +12,5 @@ if (CMAKE_COMPILER_IS_GNUCC)
           "${CMAKE_CURRENT_BINARY_DIR}/ginac-excompiler"
        )
 
           "${CMAKE_CURRENT_BINARY_DIR}/ginac-excompiler"
        )
 
-       install(PROGRAMS ginac-excompiler DESTINATION "${BIN_INSTALL_DIR}")
-endif  (CMAKE_COMPILER_IS_GNUCC)
+       install(PROGRAMS ginac-excompiler DESTINATION "${LIBEXECDIR}")
+endif (CMAKE_COMPILER_IS_GNUCC)
index 17867ab9725ef3a3edd1831e301f2f943dc7bea9..b4596f39fd1ef1db67e5f1042f1486ceca0c3095 100644 (file)
@@ -4,9 +4,9 @@ bin_PROGRAMS = viewgar
 viewgar_SOURCES = viewgar.cpp
 viewgar_LDADD = ../ginac/libginac.la
 
 viewgar_SOURCES = viewgar.cpp
 viewgar_LDADD = ../ginac/libginac.la
 
-bin_SCRIPTS = 
+libexec_SCRIPTS =
 if CONFIG_EXCOMPILER
 if CONFIG_EXCOMPILER
-bin_SCRIPTS += ginac-excompiler
+libexec_SCRIPTS += ginac-excompiler
 endif
 
 AM_CPPFLAGS = -I$(srcdir)/../ginac -I../ginac -DIN_GINAC
 endif
 
 AM_CPPFLAGS = -I$(srcdir)/../ginac -I../ginac -DIN_GINAC