On Thu, 2006-11-30 at 21:19 -0500, DJ Delorie wrote:
> I wonder if we should mimic the libiberty/* and include/* trees
> (outside of our src/*) to help with maintenance.

Try this patch..

I don't have access to a system with a builtin libiberty (BSD?), so
haven't been able to test if the feature to prefer linking against a
system-installed libiberty works ok. (And the header files are found
appropriatly).

Peter C
--- pcb.rawdbus_tmp/configure.ac	2006-12-01 01:49:17.000000000 +0000
+++ pcb.rawdbus/configure.ac	2006-12-01 15:35:26.000000000 +0000
@@ -491,6 +491,29 @@
     esac
 done
 
+# ------------- libibertiy -------------------
+
+dnl The DBus integration code uses libiberty for a portable
+dnl way to determine the full path of a file
+if test "x$with_dbus" = "xyes"; then
+	libiberty_support=yes
+else
+	libiberty_support=no
+fi
+
+if test "${libiberty_support}" = "yes"; then
+	dnl If we have an installed library, prefer it over the bundled one
+	AC_CHECK_LIB(iberty, lrealpath,
+		[AC_MSG_NOTICE([Using external libiberty library.])],
+		[ AC_MSG_NOTICE([Using bundled libiberty library.])
+			AC_CONFIG_SUBDIRS([libiberty])
+			LIBIBERTY="../libiberty/libiberty.a"
+			LIBIBERTY_INCLUDES="-I../include" ] )
+fi
+
+AC_SUBST(LIBIBERTY)
+AC_SUBST(LIBIBERTY_INCLUDES)
+
 
 # ------------- dmalloc -------------------
 dnl dmalloc checks
--- pcb.rawdbus_tmp/Makefile.am	2006-04-14 13:32:37.000000000 +0100
+++ pcb.rawdbus/Makefile.am	2006-12-01 15:15:56.000000000 +0000
@@ -6,7 +6,7 @@
 DIRS=		win32 src lib newlib example tools tutorial README_FILES
 SUBDIRS=	${DIRS} @DOC@
 DIST_SUBDIRS=	${DIRS} doc
-EXTRA_DIST=	autogen.sh globalconst.h README.cvs README.win32
+EXTRA_DIST=	autogen.sh globalconst.h README.cvs README.win32 libiberty include
 
 DISTCLEANFILES=	configure.lineno
 
--- pcb.rawdbus_tmp/src/Makefile.am	2006-12-01 01:49:17.000000000 +0000
+++ pcb.rawdbus/src/Makefile.am	2006-12-01 15:33:05.000000000 +0000
@@ -155,7 +155,7 @@
 	res_parse.h \
 	hid/common/hidlist.h
 
-pcb_bin_LDADD = @HIDLIBS@
+pcb_bin_LDADD = @HIDLIBS@ @LIBIBERTY@
 pcb_bin_DEPENDENCIES = @HIDLIBS@
 
 # Action, Attribute, and Flag lists.
@@ -165,7 +165,7 @@
 	mv [EMAIL PROTECTED] $@
 
 # for globalconst.h
-INCLUDES=	-I$(top_srcdir) -I$(srcdir)/icons
+INCLUDES=	-I$(top_srcdir) -I$(srcdir)/icons @LIBIBERTY_INCLUDES@
 
 EXTRA_DIST= \
 	check_icon.data \

_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to