colm: patch to build a shared library
All checks were successful
test Test.

This commit is contained in:
Eugen Wissner 2023-03-29 17:18:43 +02:00
parent 7becd04148
commit 484d170b24
Signed by: belka
GPG Key ID: A27FDC1E8EE902C0
3 changed files with 346 additions and 0 deletions

View File

@ -82,6 +82,8 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
patch --verbose -p1 -i $CWD/without-static.patch
autoreconf -fi
CFLAGS="$SLKCFLAGS" \
@ -93,6 +95,7 @@ CXXFLAGS="$SLKCFLAGS" \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--disable-static \
--build=$ARCH-slackware-linux
make
@ -105,6 +108,8 @@ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
rm -f $PKG/usr/lib*/*.la
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

283
private/colm/config.log Normal file
View File

@ -0,0 +1,283 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by colm configure 0.14.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ /tmp/SBo/colm-0.14.7/configure
## --------- ##
## Platform. ##
## --------- ##
hostname = desktop.caraus.net
uname -m = x86_64
uname -r = 5.10.166
uname -s = Linux
uname -v = #1 SMP Sat Feb 4 12:53:34 CET 2023
/usr/bin/uname -p = AMD Ryzen 7 3700X 8-Core Processor
/bin/uname -X = unknown
/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /home/belka/.cabal/bin
PATH: /home/belka/.ghcup/bin
PATH: /home/belka/.rbenv/shims
PATH: /usr/lib64/go1.19.7/go/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/games
PATH: /usr/lib64/java/bin
PATH: /usr/lib64/libexec/kf5
PATH: /usr/lib64/libreoffice/program
PATH: /usr/lib64/qt5/bin
PATH: /home/belka/.local/bin
PATH: /home/belka/.cargo/bin
PATH: /home/belka/.yarn/bin
PATH: /home/belka/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2689: checking for a BSD-compatible install
configure:2757: result: /usr/bin/ginstall -c
configure:2768: checking whether build environment is sane
configure:2823: result: yes
configure:2974: checking for a thread-safe mkdir -p
configure:3013: result: /usr/bin/mkdir -p
configure:3020: checking for gawk
configure:3036: found /usr/bin/gawk
configure:3047: result: gawk
configure:3058: checking whether make sets $(MAKE)
configure:3080: result: yes
configure:3109: checking whether make supports nested variables
configure:3126: result: yes
configure:3143: error: source directory already configured; run "make distclean" there first
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_env_CCC_set=''
ac_cv_env_CCC_value=''
ac_cv_env_CC_set=''
ac_cv_env_CC_value=''
ac_cv_env_CFLAGS_set=''
ac_cv_env_CFLAGS_value=''
ac_cv_env_CPPFLAGS_set=''
ac_cv_env_CPPFLAGS_value=''
ac_cv_env_CPP_set=''
ac_cv_env_CPP_value=''
ac_cv_env_CXXCPP_set=''
ac_cv_env_CXXCPP_value=''
ac_cv_env_CXXFLAGS_set=''
ac_cv_env_CXXFLAGS_value=''
ac_cv_env_CXX_set=''
ac_cv_env_CXX_value=''
ac_cv_env_LDFLAGS_set=''
ac_cv_env_LDFLAGS_value=''
ac_cv_env_LIBS_set=''
ac_cv_env_LIBS_value=''
ac_cv_env_LT_SYS_LIBRARY_PATH_set=''
ac_cv_env_LT_SYS_LIBRARY_PATH_value=''
ac_cv_env_build_alias_set=''
ac_cv_env_build_alias_value=''
ac_cv_env_host_alias_set=''
ac_cv_env_host_alias_value=''
ac_cv_env_target_alias_set=''
ac_cv_env_target_alias_value=''
ac_cv_path_install='/usr/bin/ginstall -c'
ac_cv_path_mkdir='/usr/bin/mkdir'
ac_cv_prog_AWK='gawk'
ac_cv_prog_make_make_set='yes'
am_cv_make_support_nested_variables='yes'
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR=''
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AR=''
ASCIIDOC=''
AUTOCONF=''
AUTOHEADER=''
AUTOMAKE=''
AWK='gawk'
BUILD_MANUAL_FALSE=''
BUILD_MANUAL_TRUE=''
BUILD_PROGRAM_FALSE=''
BUILD_PROGRAM_TRUE=''
CC=''
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CRACK_BIN=''
CSHARP_BIN=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W=''
DEFS=''
DEPDIR=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
D_BIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
EXTERNAL_COLM=''
EXTERNAL_COLM_FALSE=''
EXTERNAL_COLM_TRUE=''
EXTERNAL_INC=''
EXTERNAL_LIBS=''
FGREP=''
GNUSTEP_CONFIG=''
GO_BIN=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
JAVAC_BIN=''
JULIA_BIN=''
LD=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LINKER_NO_UNDEFINED_FALSE=''
LINKER_NO_UNDEFINED_TRUE=''
LIPO=''
LN_S=''
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
MAKEINFO=''
MANIFEST_TOOL=''
MKDIR_P='/usr/bin/mkdir -p'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OCAML_BIN=''
OTOOL64=''
OTOOL=''
PACKAGE=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME='colm'
PACKAGE_STRING='colm 0.14.7'
PACKAGE_TARNAME='colm'
PACKAGE_URL=''
PACKAGE_VERSION='0.14.7'
PATH_SEPARATOR=':'
PUBDATE='February 2021'
PYGMENTIZE=''
RANLIB=''
RUBY_BIN=''
RUST_BIN=''
SED=''
SED_SUBST=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
SUBJ_AAPL_CPPFLAGS=''
SUBJ_COLM_BIN=''
SUBJ_COLM_CPPFLAGS=''
SUBJ_COLM_LDFLAGS=''
SUBJ_RAGEL_BIN=''
SUBJ_RAGEL_CPPFLAGS=''
SUBJ_RAGEL_LDFLAGS=''
SUBJ_RAGEL_LM=''
VERSION=''
WITH_RAGEL_KELBT_FALSE=''
WITH_RAGEL_KELBT_TRUE=''
aaplincludedir=''
ac_ct_AR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__isrc=' -I$(srcdir)'
am__leading_dot='.'
am__nodep=''
am__quote=''
am__tar=''
am__untar=''
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /tmp/SBo/colm-0.14.7/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
libfsmincludedir=''
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME "colm"
#define PACKAGE_TARNAME "colm"
#define PACKAGE_VERSION "0.14.7"
#define PACKAGE_STRING "colm 0.14.7"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
configure: exit 1

View File

@ -0,0 +1,58 @@
diff --git a/configure.ac b/configure.ac
index aa127b68..fc034f28 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,7 @@ AC_PROG_CXX
AC_CHECK_TOOL(AR, ar)
AC_PROG_RANLIB
AC_PROG_LIBTOOL
+
SED_SUBST=["\
-e 's|@CXX@|${CXX}|g' \
-e 's|@CC@|${CC}|g' \
@@ -420,6 +421,13 @@ test -e src/include/colm || ln -s .. src/include/colm
echo "#define VERSION \"$VERSION\"" > src/version.h
echo "#define PUBDATE \"$PUBDATE\"" >> src/version.h
+if test "x$enable_static" = "xyes"; then
+ AC_DEFINE([LINK_STATIC], [1], [Link static lib when invoking C compile and link])
+fi
+
+if test "x$enable_shared" = "xyes"; then
+ AC_DEFINE([LINK_SHARED], [1], [Link shared lib when invoking C compile and link])
+fi
dnl
dnl Wrap up.
diff --git a/src/main.cc b/src/main.cc
index 301fae91..8ca395f0 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -485,7 +485,14 @@ void compileOutput( const char *argv0, const bool inSource, char *srcLocation )
" -I%s/../aapl"
" -I%s/include"
" -L%s"
+#if defined(LINK_STATIC)
" %s/libcolm.a",
+#elif defined(LINK_SHARED)
+ " %s/libcolm.so",
+#else
+# error "must enabled at least one of shared or static libs"
+#endif
+
binaryFn, intermedFn, srcLocation,
srcLocation, location, location );
}
diff --git a/src/libfsm/codegen.cc b/src/libfsm/codegen.cc
index 21edb5ac..1150384e 100644
--- a/src/libfsm/codegen.cc
+++ b/src/libfsm/codegen.cc
@@ -30,6 +30,8 @@
#include <assert.h>
#include <iomanip>
+// Convenience: for checking for the presence of the libfsm.
+extern "C" void libfsm_present() {}
using std::ostream;
using std::ostringstream;