Skip to content

Commit

Permalink
Fix some build problems on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mheily committed Jun 15, 2016
1 parent 175fa98 commit 1e3ff67
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ vars.sh
*.a
*.o
*.log
*.swp
.vagrant/

depends.mk

Expand Down
10 changes: 6 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ Vagrant.configure("2") do |config|
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y gcc-5 g++-5 make
git clone https://github.com/mheily/jobd.git
cd jobd && CC=gcc-5 CXX=g++-5 ./configure
SHELL
end
20 changes: 14 additions & 6 deletions src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ check_header 'sys/limits.h'
check_header 'sys/event.h'
if [ $check_header_sys_event_h -eq 0 ] ; then
echo "building a local copy of libkqueue.. "
tar -C $TOPDIR/vendor -zxf $TOPDIR/vendor/libkqueue-2.0.4.tar.gz

make_define 'kqueue_dir' "$TOPDIR/vendor/libkqueue-2.0.4"
make_define 'kqueue_CFLAGS' "-I$kqueue_dir/include"
make_define 'kqueue_LDADD' '$kqueue_dir/.libs/libkqueue.a -lpthread -lrt'
make_define 'kqueue_DEPENDS' "$kqueue_dir/.libs/libkqueue.a"
make_depend "$kqueue_dir/.libs/libkqueue.a" \
"cd $kqueue_dir && ./configure && make"

tar -C $TOPDIR/vendor -zxf $TOPDIR/vendor/libkqueue-2.0.4.tar.gz
( set -x ; cd $kqueue_dir && test -e Makefile || ./configure )
custom_target "$kqueue_dir/.libs/libkqueue.a" " " \
"make -C $kqueue_dir"
else
make_define 'kqueue_CFLAGS' ''
make_define 'kqueue_LDADD' ''
Expand All @@ -52,14 +55,19 @@ if [ $check_header_ucl_h -eq 0 ] ; then
dwarf_options="-gdwarf-2 -gstrict-dwarf"
fi

make_define 'libucl_dir' "$TOPDIR/vendor/libucl-0.7.3"
ucldir="$TOPDIR/vendor/libucl-0.7.3"
make_define 'libucl_dir' "$ucldir"
make_define 'libucl_CFLAGS' "-I$libucl_dir/include"
make_define 'libucl_LDFLAGS' ""
make_define 'libucl_LDADD' "$libucl_dir/src/.libs/libucl.a"
make_define 'libucl_DEPENDS' "$libucl_dir/src/.libs/libucl.a"
tar -C $TOPDIR/vendor -zxf $TOPDIR/vendor/libucl-0.7.3.tar.gz
make_depend "$libucl_dir/src/.libs/libucl.a" \
"cd $libucl_dir && CFLAGS=\"$dwarf_options -g -O0\" ./configure && make"
( set -x ; cd $ucldir && test -e Makefile || CFLAGS="$dwarf_options -g -O2 -fPIC" ./configure )
wait

custom_target "$libucl_dir/src/.libs/libucl.a" " " \
"cd $libucl_dir && make"

else
# KLUDGE: assumes libucl is installed in /usr/local, like on FreeBSD
make_define 'libucl_CFLAGS' '-I /usr/local/include'
Expand Down
4 changes: 2 additions & 2 deletions src/jobd/configure
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ sbin_PROGRAMS=jobd

jobd_CXXFLAGS="-I../.. -I.. -I. -include ../../config.h -std=c++11 -Wall -Werror $VENDOR_CXXFLAGS"
jobd_LDFLAGS="-L/usr/lib -L/usr/local/lib -L../libjob/"
jobd_LDADD="$VENDOR_LDADD ../libjob/libjob.a"
jobd_LDADD="../libjob/libjob.a $VENDOR_LDADD"
jobd_SOURCES=`ls *.cpp *.c | tr '\n' ' '`
jobd_DEPENDS="$VENDOR_DEPENDS ../libjob/libjob.a"
jobd_DEPENDS="../libjob/libjob.a $VENDOR_DEPENDS"

uname=$(uname)
if [ "`uname`" = 'FreeBSD' ] ; then
Expand Down
1 change: 0 additions & 1 deletion src/libjob/configure
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ if [ -n "$manpage_generator" ] ; then
manpage 'job.5'
fi


write_makefile

0 comments on commit 1e3ff67

Please sign in to comment.