Skip to content

Commit

Permalink
fix compilation on legacy linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ESResearchDepartment committed Dec 18, 2023
1 parent 60155a2 commit 45e6f58
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 12 deletions.
36 changes: 27 additions & 9 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
#!/bin/bash

#cleanup cache for correct versioning when run multiple times
rm -rf autom4te.cache

aclocal -I m4
autoconf
autoheader
automake --add-missing
autoreconf -i
./configure "$@"
olddir=`pwd`
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

(
cd "$srcdir"

#cleanup cache for correct versioning when run multiple times
rm -rf autom4te.cache

gprefix=`which glibtoolize 2>&1 >/dev/null`
if [ $? -eq 0 ]; then
glibtoolize --force
else
libtoolize --force
fi
aclocal -I m4
autoheader
automake --add-missing
autoconf

cd "$olddir"
)

if [ -z "$NOCONFIGURE" ]; then
$srcdir/configure "$@"
fi
15 changes: 13 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CFLAGS+=" -std=c11"
AC_MSG_CHECKING([whether we need platform-specific build settings])
case $host_os in
darwin* )
AC_MSG_RESULT([${host_os}])
AC_CHECK_LIB([c++], [_ZNSt13bad_exceptionD0Ev],[have_libcpp=true],[have_libcpp=false])
if test "x$have_libcpp" == "xtrue"; then
ORIG_CXXFLAGS=${CXXFLAGS}
Expand Down Expand Up @@ -52,8 +53,10 @@ case $host_os in
])
AC_LANG_POP([C++])
;;
*mingw*|*msys*)
*mingw*|*msys*|*linux*)
AC_MSG_RESULT([${host_os}])
LDFLAGS+=" -no-undefined -lpthread"
AC_SUBST([extra_lib_flags], ["-no-undefined -lpthread"])
;;
esac

Expand Down Expand Up @@ -139,12 +142,20 @@ else
AC_SUBST([FUNC_HAVE_DECL_HTONLL], [0])
fi

AC_SUBST([DEB_VERSION], [0.${VERSION_COMMIT_COUNT}-git-${VERSION_COMMIT_SHA}])

if test "x${host_cpu}" == "xx86_64"; then
AC_SUBST([DEB_ARCH], [amd64])
fi

AC_CONFIG_FILES([Makefile
include/libgeneral/macros.h
include/libgeneral/ByteOrder.hpp
include/Makefile
libgeneral.pc
libgeneral/Makefile])
libgeneral/Makefile
debian/libgeneral0.control
debian/libgeneral-dev.control])

AC_OUTPUT

Expand Down
8 changes: 8 additions & 0 deletions debian/libgeneral-dev.control.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: libgeneral-dev
Version: @DEB_VERSION@
Architecture: @DEB_ARCH@
Conflicts: libgeneral (<< @DEB_VERSION@)
Depends: libgeneral0 (>= @DEB_VERSION@)
Section: Development
Priority: optional
Description: Common library for tihmstar tools (Development files)
9 changes: 9 additions & 0 deletions debian/libgeneral0.control.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: libgeneral0
Version: @DEB_VERSION@
Architecture: @DEB_ARCH@
Conflicts: libgeneral (<< 1:0)
Replaces: libgeneral (<< 1:0)
Provides: libgeneral (= @DEB_VERSION@)
Section: Libraries
Priority: optional
Description: Common library for tihmstar tools
2 changes: 1 addition & 1 deletion libgeneral.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Name: libgeneral
Description: Mostly macros used by other projects

Version: @VERSION_COMMIT_COUNT@
Libs: -L${libdir} -lgeneral
Libs: -L${libdir} -lgeneral @extra_lib_flags@
Cflags: -I${includedir} @cpp_lib_flags@

0 comments on commit 45e6f58

Please sign in to comment.