This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC] Build on OSX
- From: Masaki Muranaka <monaka at monami-software dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 12 Feb 2007 18:19:26 +0900
- Subject: [RFC] Build on OSX
Hello,
I've trying to build cross-gdb on OSX host from CVS head.
And the build was failed with following message:
/usr/bin/ld: warning multiple definitions of symbol _locale_charset
./../intl/libintl.a(localcharset.o) definition of _locale_charset in
section (__TEXT,__text)
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../libiconv.dylib
(localcharset.o) definition of _locale_charset
It is well known issue. OSX (maybe also Darwin) hosts
need to link 'resolv' library beforge libintl.a.
Here is a brute-forced patch. But I don't think this is
the good solution.
Any comments appreciated.
- - - - - - -
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.42
diff -u -p -r1.42 configure.ac
--- configure.ac 2 Feb 2007 22:54:09 -0000 1.42
+++ configure.ac 12 Feb 2007 08:55:46 -0000
@@ -1591,6 +1591,13 @@ AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "ISO
AM_ICONV
+# Darwin (MacOSX Tiger) needs -lresolv before libintl.a.
+if test x"$LIBINTL" != x; then
+ case ${host} in
+ *darwin*) LIBINTL="-lresolv $LIBINTL";
+ esac
+fi
+
AC_OUTPUT(Makefile .gdbinit:gdbinit.in,
[
dnl Autoconf doesn't provide a mechanism for modifying definitions
--
Masaki Muranaka
Monami software