SHA256
1
0
forked from pool/gpm
gpm/gpm-1.20.1-ceil.patch

60 lines
1.5 KiB
Diff
Raw Normal View History

Note that GCC 4.0 will optimize ceil (constant), we therefore
have to make the argument non-constant.
================================================================================
--- configure.in
+++ configure.in
@@ -91,6 +91,25 @@
AC_CHECK_FUNCS(vsyslog syslog)
AC_FUNC_ALLOCA
+AC_MSG_CHECKING(for ceil)
+AC_TRY_LINK([#define __NO_MATH_INLINES 1
+ double d;],
+ [d = ceil(1.0*d);],
+ SYNLDFLAGS=""
+ AC_MSG_RESULT(yes),
+ SYNLDFLAGS=-lm
+ AC_MSG_RESULT(no))
+
+if test "$SYNLDFLAGS" = "-lm" ; then
+ SAVE_LIBS="$LIBS"
+ AC_CHECK_LIB(m,
+ ceil,
+ ,
+ echo "libmath.so is needed due the ceil function"
+ exit 1)
+ LIBS="$SAVE_LIBS"
+fi
+
case $with_curses in
No|no|N|n) SHARED_LIBS=-lc ;;
*)
@@ -123,6 +142,7 @@
AC_SUBST(SHLIB)
AC_SUBST(PICFLAGS)
AC_SUBST(SOLDFLAGS)
+AC_SUBST(SYNLDFLAGS)
AC_SUBST(CURSES_OBJS)
AC_SUBST(SHARED_LIBS)
AC_SUBST(lispdir)
--- src/Makefile.in
+++ src/Makefile.in
@@ -70,6 +70,7 @@
all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG)
gpm: $(GOBJ)
+ $(CC) @LDFLAGS@ @SYNLDFLAGS@ $(GOBJ) -o gpm
# construct dependings of sourcefiles and link sourcefiles
$(DEPFILE) dep: prog/gpm-root.c
@@ -155,7 +156,7 @@
lib/libgpm.so.@abi_full@: $(PICS)
$(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \
- @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS)
+ @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ @SYNLDFLAGS@ $(LIBS)
lib/libgpm.so: lib/libgpm.so.@abi_full@
$(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so