[Libevent-users] libevent 1.3b VPATH fix

Kelly Anderson kelly at slackwarelinux.kicks-ass.net
Sun Aug 19 19:17:42 EDT 2007


Hello,

I've attached a shell script which will fix some paths in the 
Makefile.am's.  This will allow VPATH to work so that you can build out 
of the source tree.  It's not an obtrusive change (usually doesn't take 
much to fix them).  It's kinda handy when you're building for multiple 
architectures.  You don't have to "make clean", just delete your build 
dir when your done.

cd builddir
../pathtosource/configure
make

Thanks!
-------------- next part --------------
#! /bin/bash

libeventVPATHPatcher() {
	# Fix paths that break VPATH

	if [[ ! -f 'Makefile.am.orig' ]]; then
		cp -p 'Makefile.am' 'Makefile.am.orig'
		ed 'Makefile.am' <<END
/-Icompat/
s#-Icompat#-I\$(srcdir)/compat#p
/make verify/
s#\$(srcdir)/##p
wq
END
	fi

	pushd 'sample'
	if [[ ! -f 'Makefile.am.orig' ]]; then
		cp -p 'Makefile.am' 'Makefile.am.orig'
		ed 'Makefile.am' <<END
/CPPFPLAGS/
.d
i
CPPFLAGS = -I\$(top_srcdir)
.
/CFLAGS/
.d
i
CFLAGS = -I\$(top_srcdir)/compat
.
wq
END
	fi
	popd

	pushd 'test'
	if [[ ! -f 'Makefile.am.orig' ]]; then
		cp -p 'Makefile.am' 'Makefile.am.orig'
		ed 'Makefile.am' <<END
/CPPFPLAGS =/
.d
i
CPPFLAGS = -I\$(top_srcdir)
.
/CFLAGS =/
.d
i
CFLAGS = -I\$(top_srcdir)/compat
.
/event_rpcgen.py/
s/..\/event_rpcgen.py/\$(top_srcdir)\/event_rpcgen.py/p
wq
END
	fi
	popd

	automake # generate new Makefile.in's
}

libeventVPATHPatcher


More information about the Libevent-users mailing list