This repository has been archived by the owner on Jul 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.apxs
executable file
·124 lines (106 loc) · 4.25 KB
/
configure.apxs
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/sh
#
# configure.apxs --- build configuration script for creating mod_fcgid
# out of tree using the apxs utility and httpd build toolset
#
if test "$APXS" = ""; then
APXS=`which apxs 2>/dev/null`
fi;
if test "$APXS" = ""; then
echo $0 must be able to find apxs in your path,
echo or the environment variable APXS must provide the full path of APXS,
echo or you may specify it with:
echo
echo APXS=/path/to/apxs $0
echo
echo configuration failed
exit 1
fi
echo Configuring mod_fcgid for APXS in $APXS
# top_builddir and top_srcdir are a misnomers, because build/*.mk
# scripts expect them to be the parent of the build directory
# they fail to use the $installbuilddir path.
exp_installbuilddir=`$APXS -q exp_installbuilddir`
top_installbuilddir=`cd $exp_installbuilddir/..; pwd`
top_installbuilddir=`echo $exp_installbuilddir | sed -e "s#/[^/]*\\\$##;"`
builddir=`pwd`
srcdir=$builddir
fcgid_builddir=$builddir
fcgid_srcdir=$builddir
# prefix is the default @@ServerRoot@@, where libexecdir/sysconfdir may
# be relative (if it is not their prefix, the rel_ paths remain unchanged
rel_fix_prefix=`$APXS -q prefix`
rel_libexecdir=`$APXS -q exp_libexecdir | sed -e "s#^$rel_fix_prefix/##;"`
rel_sysconfdir=`$APXS -q exp_sysconfdir | sed -e "s#^$rel_fix_prefix/##;"`
rel_logfiledir=`$APXS -q exp_logfiledir | sed -e "s#^$rel_fix_prefix/##;"`
httpd_conffile=`$APXS -q exp_sysconfdir`/`$APXS -q progname`.conf
if test -z "$AWK"; then
AWK=`$APXS -q AWK`
fi
for i in Makefile build/Makefile modules/fcgid/Makefile modules/fcgid/modules.mk; do
l_r=`echo $i|sed -e "s#/*[^/]*\\\$##;s#^\(..*\)\\\$#/\1#"`
sed -e "s#^\(exp_installbuilddir\)=.*#\1=$exp_installbuilddir#;" \
-e "s#^\(include\) \$(exp_installbuilddir)#\1 $exp_installbuilddir#;" \
-e "s#^\(top_builddir\)=.*#\1=$top_installbuilddir#;" \
-e "s#^\(top_srcdir\)=.*#\1=$top_installbuilddir#;" \
-e "s#^\(fcgid_srcdir\)=.*#\1=$srcdir#;" \
-e "s#^\(fcgid_builddir\)=.*#\1=$builddir#;" \
-e "s#^\(srcdir\)=.*#\1=$srcdir$l_r#;" \
-e "s#^\(builddir\)=.*#\1=$builddir$l_r#;" \
-e "s#^\(rel_libexecdir\)=.*#\1=$rel_libexecdir#;" \
-e "s#^\(rel_sysconfdir\)=.*#\1=$rel_sysconfdir#;" \
-e "s#^\(rel_logfiledir\)=.*#\1=$rel_logfiledir#;" \
-e "s#^\(httpd_conffile\)=.*#\1=$httpd_conffile#;" \
-e "s#^\(awk\)=.*#\1=$AWK#;" \
< $i.apxs > $i
done
touch .deps
touch build/.deps
touch modules/fcgid/.deps
cd build
found_features=""
echo "Detecting features"
echo "Detecting features" > ../config.apxs.log
#test invocations follow the pattern;
#
#if make local-clean conftest_foofn >>../config.apxs.log 2>&1; then
# found_features="$found_features \
# -e \"s/^#undef \(HAVE_FOOFN\)[ \t]*/#define \1 1/;\""
#fi
if make local-clean conftest_sys_file_h >>../config.apxs.log 2>&1; then
found_features="$found_features \
-e \"s/^#undef \(HAVE_SYS_FILE_H\)[ \t]*/#define \1 1/;\""
fi
if make local-clean conftest_sys_mman_h >>../config.apxs.log 2>&1; then
found_features="$found_features \
-e \"s/^#undef \(HAVE_SYS_MMAN_H\)[ \t]*/#define \1 1/;\""
fi
if make local-clean conftest_sys_mutex_h >>../config.apxs.log 2>&1; then
found_features="$found_features \
-e \"s/^#undef \(HAVE_SYS_MUTEX_H\)[ \t]*/#define \1 1/;\""
fi
if make local-clean conftest_sys_shm_h >>../config.apxs.log 2>&1; then
found_features="$found_features \
-e \"s/^#undef \(HAVE_SYS_SHM_H\)[ \t]*/#define \1 1/;\""
fi
make local-distclean >>../config.apxs.log 2>&1
cd ..
if test "x$found_features" = "x"; then
cp modules/fcgid/fcgid_config.h.in modules/fcgid/fcgid_config.h
else
eval sed "$found_features" < modules/fcgid/fcgid_config.h.in \
> modules/fcgid/fcgid_config.h
fi
echo ""
echo "Finished, run 'make' to compile mod_fcgid"
echo ""
echo "Run 'make install' to install mod_fcgid"
echo ""
#echo "The manual pages fcgid/index.html and mod/mod_fcgid.html"
#echo "will be installed to help get you started."
#echo
#echo "The conf/extra/httpd-fcgid.conf will be installed as an example"
#echo "for you to work from. In your configuration file,"
#echo " `$APXS -q exp_sysconfdir`/`$APXS -q progname`.conf"
#echo "uncomment the line '#Include conf/extra/httpd-fcgid.conf'"
#echo "to activate this example mod_fcgid configuration."