Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

OS-1331 libxml2 build system needs conversion

  • Loading branch information...
commit 61c70cf2438b4ed7324f8558d57836753447a500 1 parent 3dfd6c5
@wesolows wesolows authored
View
115 libxml/Makefile
@@ -20,100 +20,53 @@
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
-# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+# Copyright (c) 2013, Joyent, Inc. All rights reserved.
#
-#
-# This makefile has not been adapted to use the infrastructure because of
-# the need to patch libtool after the fact, and because of the way the
-# mapfile is integrated. libxml2 is an extreme example of a nonconforming
-# build system.
-#
-
-BVER=libxml2-2.7.6
-VER=$(BVER)$(STRAP)
-VER64=$(VER)-64
-
-LDFLAGS= -z defs -z text -z combreloc -lpthread -lc -nodefaultlibs
-ifneq ($(STRAP),strap)
- LDFLAGS += $(GENLDFLAGS)
-endif
-LARGEFILES= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
- -fno-builtin
-
-BASE=$(PWD)
-DESTDIR=$(BASE)/../proto
+VER = libxml2-2.7.6
-GCC=$(DESTDIR)/usr/bin/gcc
+include ../Makefile.defs
-all: real-all
+BUILD64 = yes
-all32: $(VER)/config.status
- (cd $(VER); env - PATH=$(PATH) \
- "CC=$(GCC)" \
- "CFLAGS=$(LARGEFILES)" \
- "LDFLAGS=$(LDFLAGS)" \
- make -e libxml2.la; \
- env - PATH=$(PATH) "CFLAGS=$(LARGEFILES)" \
- "CC=$(GCC)" \
- "LDFLAGS=$(LDFLAGS)" \
- make -e $(PARALLEL))
+LIBXML2_LDFLAGS = \
+ -Wl,-zdefs \
+ -Wl,-ztext \
+ -Wl,-zcombreloc
-all64: $(VER64)/config.status
- (cd $(VER64); env - PATH=$(PATH) "CC=$(GCC)" \
- "CFLAGS=-m64 $(LARGEFILES)" \
- "LDFLAGS=$(LDFLAGS)" \
- make -e libxml2.la; \
- env - PATH=$(PATH) "CFLAGS=-m64 $(LARGEFILES)" \
- "CC=$(GCC)" \
- "LDFLAGS=$(LDFLAGS)" \
- make -e $(PARALLEL))
+LDFLAGS += $(LIBXML2_LDFLAGS)
+LDFLAGS.64 += $(LIBXML2_LDFLAGS)
-install: all
- BASE=$(BASE) DESTDIR=$(DESTDIR) PATH=$(PATH) ksh93 ./install-libxml2 $(VER)
- BASE=$(BASE) DESTDIR=$(DESTDIR) PATH=$(PATH) MACH64=amd64 ksh93 ./install-libxml2-64 $(VER64)
-
-real-all: all32 all64
+LIBS += \
+ -lpthread \
+ -lc
-test: test32 test64
+CPPFLAGS += \
+ -D_FILE_OFFSET_BITS=64 \
+ -D_LARGEFILE_SOURCE
-# Test suite don't work under normal make, have to use gmake
+AUTOCONF_OPTS += \
+ --with-threads \
+ --without-python \
+ --enable-symbol-versioning=$(BASE)/mapfile
-test32: all32
- (cd $(VER); gmake tests)
+PATCHES = Patches/*
-test64: all64
- (cd $(VER64); gmake tests)
+include ../Makefile.targ
-$(VER)/config.status: $(VER)/configure
- (cd $(VER); \
- env - "CC=$(GCC)" "CFLAGS=$(LARGEFILES)" \
- "LDFLAGS=$(LDFLAGS)" \
- "PATH=$(DESTDIR)/usr/bin/:$(PATH)" \
- ./configure --prefix=/usr --with-threads \
- --without-python)
- cp mapfile $(VER)/libxml2.syms
- patch -N $(VER)/libtool < libtool.patch
+all: all_autoconf
-$(VER64)/config.status: $(VER64)/configure
- (cd $(VER64); \
- env - "CC=$(GCC)" "CFLAGS=-m64 $(LARGEFILES)" \
- "LDFLAGS=$(LDFLAGS)" \
- "PATH=$(DESTDIR)/usr/bin/:$(PATH)" \
- ./configure --prefix=/usr --with-threads \
- --without-python)
- cp mapfile $(VER64)/libxml2.syms
- patch -N $(VER64)/libtool < libtool.patch
+install: all
+ DESTDIR=$(DESTDIR) PATH=$(PATH) ksh93 ./install-libxml2 $(VER.32)
+ DESTDIR=$(DESTDIR) PATH=$(PATH) ksh93 ./install-libxml2-64 $(VER.64)
-$(VER)/configure: $(BVER).tar.gz
- mkdir -p tmp; gzip -dc $(BVER).tar.gz | (cd tmp; tar xopf -)
- mv tmp/$(BVER) $(VER); rmdir tmp
- touch $(VER)/configure
+test: test32 test64
-$(VER64)/configure: $(BVER).tar.gz
- mkdir -p tmp; gzip -dc $(BVER).tar.gz | (cd tmp; tar xopf -)
- mv tmp/$(BVER) $(VER64); rmdir tmp
- touch $(VER64)/configure
+test32: all
+ (cd $(VER.32); \
+ LD_LIBRARY_PATH=$(DESTDIR)/lib:$(DESTDIR)/usr/lib gmake tests)
-clean:
- -rm -rf $(VER) $(VER64) $(VER)strap $(VER64)strap $(BVER)strap-64
+test64: all
+ (cd $(VER.64); \
+ LD_LIBRARY_PATH_64=$(DESTDIR)/lib/64:$(DESTDIR)/usr/lib/64 \
+ gmake tests)
View
18,478 libxml/Patches/mapfile.diff
18,478 additions, 0 deletions not shown
View
6 libxml/install-libxml2-64
@@ -32,8 +32,8 @@ set -o errexit
VERS=${1}
PREFIX=${DESTDIR}/usr
-LIBDIR=${PREFIX}/lib/${MACH64} # MACH64 passed in by makefile
-ROOTLIBDIR=${DESTDIR}/lib/${MACH64}
+LIBDIR=${PREFIX}/lib/amd64
+ROOTLIBDIR=${DESTDIR}/lib/amd64
source ../install.subr
@@ -44,7 +44,7 @@ mkdir -p $ROOTLIBDIR
cd ${VERS}
_install D .libs/libxml2.so ${ROOTLIBDIR}/libxml2.so.2 555
-_install L ../../../lib/${MACH64}/libxml2.so.2 ${LIBDIR}/libxml2.so.2
+_install L ../../../lib/amd64/libxml2.so.2 ${LIBDIR}/libxml2.so.2
_install L libxml2.so.2 ${ROOTLIBDIR}/libxml2.so
_install L libxml2.so.2 ${LIBDIR}/libxml2.so
View
24 libxml/libtool.patch
@@ -1,24 +0,0 @@
---- libtool~ Wed Mar 7 22:45:42 2012
-+++ libtool Wed Mar 7 22:53:01 2012
-@@ -237,7 +237,7 @@
- finish_eval=""
-
- # Whether we should hardcode library paths into libraries.
--hardcode_into_libs=yes
-+hardcode_into_libs=no
-
- # Compile-time system search path for libraries.
- sys_lib_search_path_spec="/root/src/illumos-live/proto/usr/sfw/lib/gcc/i386-pc-solaris2.11/4.4.4/amd64 /root/src/illumos-live/proto/usr/sfw/lib/gcc /root/src/illumos-live/proto/usr/sfw/lib/amd64 /lib/amd64 /usr/lib/amd64"
-@@ -5101,6 +5101,12 @@
- esac
- continue
- ;;
-+
-+ -nodefaultlibs)
-+ allow_undefined=no
-+ compiler_flags="$compiler_flags $func_quote_for_eval_result"
-+ continue
-+ ;;
-
- -no-undefined)
- allow_undefined=no
Please sign in to comment.
Something went wrong with that request. Please try again.