# add missing LDFLAGS to build system.
# the configure script still fails to add LDFLAGS when linking
# the libtecla shared object but since it calls ld directory 
# LDFLAGS can't be used straight out of the box.

--- libtecla/Makefile.rules
+++ libtecla/Makefile.rules
@@ -66,7 +66,7 @@
  $(OBJDIR)/demo3.o -L. -ltecla$(SUFFIX) $(LIBS)
 
 enhance$(SUFFIX): $(OBJDIR)/enhance.o
-	LD_RUN_PATH="$(LIBDIR):$$LD_RUN_PATH:`pwd`" $(CC) $(CFLAGS) -o $@ \
+	LD_RUN_PATH="$(LIBDIR):$$LD_RUN_PATH:`pwd`" $(CC) $(LDFLAGS) $(CFLAGS) -o $@ \
  $(OBJDIR)/enhance.o -L. -ltecla$(SUFFIX) $(LIBS)
 
 #-----------------------------------------------------------------------
--- libtecla/configure.in
+++ libtecla/configure.in
@@ -468,7 +468,7 @@
     VERSION_OPT=''
   fi
 
-  LINK_SHARED="$LD"' -o $$@ -soname libtecla$$(SUFFIX).so.'${MAJOR_VER}' -shared '$VERSION_OPT' $$(LIB_OBJECTS) $$(LIBS) -lc'
+  LINK_SHARED="$LD"' $$(LFLAGS) -o $$@ -soname libtecla$$(SUFFIX).so.'${MAJOR_VER}' -shared '$VERSION_OPT' $$(LIB_OBJECTS) $$(LIBS) -lc'
   SHARED_CFLAGS="-fpic"
 
 dnl Reenable the inclusion of symbols which get undefined when POSIX_C_SOURCE
