-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
100 lines (88 loc) · 3.6 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/sh
#
# Copyright (c) 2016 Mark Heily <mark@heily.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
. ./config.sub
package 'relaunchd' '0.3.2'
getopt "--help" "echo TODO"
check_header 'sys/limits.h'
check_header 'ucl.h'
if [ $check_header_ucl_h -eq 0 ] ; then
echo "building a local copy of libucl.. "
# KLUDGE: OpenBSD does not support -gstrict-dwarf
if [ `uname` = 'OpenBSD' ] ; then
dwarf_options="-gdwarf-2"
else
dwarf_options="-gdwarf-2 -gstrict-dwarf"
fi
make_define 'libucl_dir' "`pwd`/vendor/libucl-0.7.3"
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 vendor -zxf ./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"
else
# KLUDGE: assumes libucl is installed in /usr/local, like on FreeBSD
make_define 'libucl_CFLAGS' '-I /usr/local/include'
make_define 'libucl_LDFLAGS' '-L /usr/local/lib'
make_define 'libucl_LDADD' '-lucl'
make_define 'libucl_DEPENDS' ''
fi
check_header 'sys/event.h'
if [ $check_header_sys_event_h -eq 0 ] ; then
echo "building a local copy of libkqueue.. "
tar -C vendor -zxf ./vendor/libkqueue-2.0.3.tar.gz
make_define 'kqueue_dir' "`pwd`/vendor/libkqueue-2.0.3"
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"
else
make_define 'kqueue_CFLAGS' ''
make_define 'kqueue_LDADD' ''
make_define 'kqueue_DEPENDS' ''
fi
SUBDIRS="src test"
get_install_directory 'pkgconfdir' 'Package configuration' "${sysconfdir}/launchd"
create_subdirectory 'pkgconfdir' 'agents' 'daemons'
get_install_directory 'pkgdatadir' 'Package data' "${datadir}/launchd"
create_subdirectory 'pkgdatadir' 'agents' 'daemons'
test -d /var/db && default_statedir=/var/db/launchd || default_statedir=/var/lib/launchd
get_install_directory 'pkgstatedir' 'Package state directory' $default_statedir
get_install_directory 'cachedir' 'Cache directory' '/var/cache/launchd'
for manpage in vendor/NextBSD/man/*.[0-9]
do
manpage $manpage
done
uname=$(uname)
if [ $uname = 'FreeBSD' ] ; then
rc_script 'launchd' 'rc.FreeBSD'
elif [ `uname` = 'Linux' ] ; then
rc_script 'launchd' 'rc.Linux'
else
echo "**WARNING** Unable to determine the correct rc script to install"
fi
# Copy manifests for supported operating systems
# DISABLED - not all of these are working, plus they should be distributed
# via a separate mechanism
#
#if [ -e /usr/local/etc/pcbsd.conf ] ; then
# copy_directory 'manifests/pcbsd/agents' "${install_directory__pkgdatadir}/agents"
# copy_directory 'manifests/pcbsd/daemons' "${install_directory__pkgdatadir}/daemons"
#fi
write_makefile