Revision
81252
Author
cal@macports.org
Date
2011-07-28 01:32:37 -0700 (Thu, 28 Jul 2011)

Log Message

rev-upgrade: src/machista1.0 needs SWIG, these changes locate it
However, Lion does no longer ship SWIG, so we have to expect users without it
Also, Swig 2.x available from MacPorts generates code that doesn't compile warnings-free, which is why this Makefile suggests using Swig 1.x

Modified Paths

Added Paths

Diff

Modified: branches/gsoc11-rev-upgrade/base/configure.ac (81251 => 81252)


--- branches/gsoc11-rev-upgrade/base/configure.ac	2011-07-28 08:13:40 UTC (rev 81251)
+++ branches/gsoc11-rev-upgrade/base/configure.ac	2011-07-28 08:32:37 UTC (rev 81252)
@@ -124,6 +124,7 @@
 AC_PATH_PROG(PAX, [pax], [])
 AC_PATH_PROG(XAR, [xar], [])
 AC_PATH_PROG(OPEN, [open], [])
+AC_PATH_PROG(SWIG, [swig], [$PATH:/usr/local/bin])
 
 # Define some precious variables allowing user to override PATH for some programs
 AC_ARG_VAR(MTREE, [path to mtree command])
@@ -140,6 +141,7 @@
 AC_ARG_VAR(BZIP2, [path to bzip2 command])
 AC_ARG_VAR(XAR, [path to xar command])
 AC_ARG_VAR(OPEN, [path to open command])
+AC_ARG_VAR(SWIG, [path to swig command])
 
 MP_SED_EXTENDED_REGEXP
 MP_TAR_FAST_READ
@@ -362,6 +364,7 @@
 	doc/pubkeys.conf
 	portmgr/freebsd/Makefile
 	src/Makefile
+	src/machista1.0/Makefile
 	src/macports1.0/macports_autoconf.tcl
 	src/port1.0/port_autoconf.tcl
 	src/registry2.0/registry_autoconf.tcl

Copied: branches/gsoc11-rev-upgrade/base/src/machista1.0/Makefile.in (from rev 81176, branches/gsoc11-rev-upgrade/base/src/machista1.0/Makefile) (0 => 81252)


--- branches/gsoc11-rev-upgrade/base/src/machista1.0/Makefile.in	                        (rev 0)
+++ branches/gsoc11-rev-upgrade/base/src/machista1.0/Makefile.in	2011-07-28 08:32:37 UTC (rev 81252)
@@ -0,0 +1,52 @@
+OBJS= 		libmachista.o hashmap.o machista_wrap.o
+SHLIB_NAME= machista${SHLIB_SUFFIX}
+INSTALLDIR=	${DESTDIR}${datadir}/macports/Tcl/machista1.0
+
+SWIG         = @SWIG@
+SWIG_FLAGS   = -tcl8 -pkgversion 1.0 -namespace
+SWIG_LDFLAGS = -ltcl
+
+SWIG_IFACE = machista.i
+SWIG_SRCS  = ${SWIG_IFACE:%.i=%_wrap.c}
+SWIG_OBJS  = ${SWIG_SRCS:%.c=%.o}
+
+TESTS = ./tests/libmachista-test
+
+include ../../Mk/macports.autoconf.mk
+include ../../Mk/macports.tea.mk
+
+CFLAGS+= -fPIC -std=c99 -pedantic
+
+${SWIG_SRCS}:: ${SWIG_IFACE}
+ifdef SWIG
+	${SWIG} ${SWIG_FLAGS} $<
+else
+	@echo "Building ${SWIG_SRCS} requires swig, which you apparently did not have installed when configuring MacPorts." >&2
+	@echo "Please install swig and re-run configure" >&2
+	@echo "I recommend installing SWIG 1.x in /usr/local, because as of this writing SWIG 2.x-generated code does not compile warning-free" >&2
+	@echo "If you checked out from svn you can also run svn revert in base/src/machista1.0 to get rid of this error" >&2
+	@exit 1
+endif
+
+${SWIG_OBJS}:: ${SWIG_SRCS}
+
+${PKG_INDEX}:: ${SWIG_SHLIB}
+	$(SILENT) ../pkg_mkindex.sh $< || ( rm -rf $@ && exit 1 )
+
+clean::
+	rm -f ${SWIG_OBJS} ${PKG_INDEX}
+ifdef SWIG
+	rm -f ${SWIG_SRCS}
+else
+	@echo "Not cleaning SWIG-generated sources, because you have configured MacPorts without SWIG." >&2
+endif
+	rm -f ${TESTS}
+	rm -rf ${TESTS:%=%.dSYM}
+
+test:: ${TESTS}
+	${TESTS}
+
+# FIXME: This is broken
+tests/libmachista-test: tests/libmachista-test.c libmachista.h libmachista$(SHLIB_SUFFIX)
+	$(CC) $(CFLAGS) -D_POSIX_SOURCE -o $@ -I. -L. -lmachista $<
+

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/port_autoconf.tcl.in (81251 => 81252)


--- branches/gsoc11-rev-upgrade/base/src/port1.0/port_autoconf.tcl.in	2011-07-28 08:13:40 UTC (rev 81251)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/port_autoconf.tcl.in	2011-07-28 08:32:37 UTC (rev 81252)
@@ -66,6 +66,7 @@
 	variable tar_path "@TAR@"
 	variable tar_q "@TAR_Q@"
 	variable hdiutil_path "@HDIUTIL@"
+	variable swig_path "@SIWG@"
 	variable have_launchd "@HAVE_LAUNCHD@"
 	variable launchctl_path "@LAUNCHCTL@"
 	variable install_command "@INSTALL@"