-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.additional
73 lines (62 loc) · 2.46 KB
/
configure.additional
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
# tar-ustar causes us to try and use a tar that can deal with long path names.
AM_INIT_AUTOMAKE(tar-ustar)
AM_PROG_LIBTOOL
AC_CONFIG_MACRO_DIR([m4])
# platform type. There's rules about how derived variables that
# are used in Makefiles are named. We are going to evaluate PLATFORM_TYPE
# into a derived variable name down the line, so we'll try to mash down
# any but the most vanilla characters into underscores... underscores
# are valid in derived variable names.
PLATFORM_TYPE=`uname -s``uname -r`
PLATFORM_TYPE=`echo [${PLATFORM_TYPE//[^[:alnum:]]/_}]`
AC_MSG_NOTICE([ platform type: $PLATFORM_TYPE ])
AC_SUBST(PLATFORM_TYPE)
# precedence of where we look for stuff we need:
# - which(1) - if "which" finds something, use that.
# - look in the usual places, use the first one we find.
# - why don't you just tell me what movie you'd like to see?
#
USUAL_SUSPECTS=\
"/usr/bin/
/usr/sbin/
/usr/local/bin/
/usr/local/sbin/
/usr/local/apache2/bin/"
# locate whackyprog. whackyprog is some program we need if we are going
# to compile convenience library 3, similar to how you might need to
# find apxs if you were going to compile an apache module. The way
# the "locate whackyprog" block here works:
# if whackyprog can be found, it gets used.
# if whackyprog can't be found, configure errs with a suggestion
# about how to tell configure where whackyprog is. In this example
# it is possible to build some of the project without whackyprog.
AC_ARG_WITH([whackyprog],
AS_HELP_STRING([--with-whackyprog=/FULL/PATH/whackyprog],
[path to whackyprog executable, or "ignore" to avoid building \
convenience library 3]))
MY_WHACKYPROG="no"
which whackyprog &> /dev/null
if test "$?" == "0" ; then
MY_WHACKYPROG=`which whackyprog`
else
for candidate in $USUAL_SUSPECTS
do
AS_IF([test -x $candidate"whackyprog"],
[MY_WHACKYPROG=$candidate"whackyprog"])
done
fi
if test "x$with_whackyprog" != "x" ; then
MY_WHACKYPROG=$with_whackyprog
fi
if test "$MY_WHACKYPROG" = "no"; then
AC_MSG_ERROR([*** Use --with-whackyprog=/full/path/to/whackyprog or \
--with-whackyprog=ignore to avoid building convenience library 3.])
else
if test "$MY_WHACKYPROG" = "ignore"; then
AC_MSG_NOTICE([ notice: NOT BUILDING CONVENIENCE LIBRARY 3 ])
AM_CONDITIONAL(BUILD_CONVENIENCE_LIB_3, [test x"$MY_WHACKYPROG" = ignore])
else
AC_MSG_NOTICE([ using: $MY_WHACKYPROG ])
AM_CONDITIONAL(BUILD_CONVENIENCE_LIB_3, [test x"$MY_WHACKYPROG" != ignore])
fi
fi