"Fossies" - the Fresh Open Source Software Archive 
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 #!/bin/sh
2 #
3 # configure.apxs --- build configuration script for creating mod_ftp
4 # out of tree using the apxs utility and httpd build toolset
5 #
6 if test "$APXS" = ""; then
7 APXS=`which apxs 2>/dev/null`
8 fi;
9
10 if test "$APXS" = ""; then
11 echo $0 must be able to find apxs in your path,
12 echo or the environment variable APXS must provide the full path of APXS,
13 echo or you may specify it with:
14 echo
15 echo APXS=/path/to/apxs $0
16 echo
17 echo configuration failed
18 exit 1
19 fi
20
21 echo Configuring mod_ftp for APXS in $APXS
22
23 # top_builddir and top_srcdir are a misnomers, because build/*.mk
24 # scripts expect them to be the parent of the build directory
25 # they fail to use the $installbuilddir path.
26 exp_installbuilddir=`$APXS -q exp_installbuilddir`
27 top_installbuilddir=`cd $exp_installbuilddir/..; pwd`
28 top_installbuilddir=`echo $exp_installbuilddir | sed -e "s#/[^/]*\\\$##;"`
29
30 builddir=`pwd`
31 srcdir=$builddir
32 ftp_builddir=$builddir
33 ftp_srcdir=$builddir
34
35 # prefix is the default @@ServerRoot@@, where libexecdir/sysconfdir may
36 # be relative (if it is not their prefix, the rel_ paths remain unchanged
37 rel_fix_prefix=`$APXS -q prefix`
38 rel_libexecdir=`$APXS -q exp_libexecdir | sed -e "s#^$rel_fix_prefix/##;"`
39 rel_sysconfdir=`$APXS -q exp_sysconfdir | sed -e "s#^$rel_fix_prefix/##;"`
40 rel_logfiledir=`$APXS -q exp_logfiledir | sed -e "s#^$rel_fix_prefix/##;"`
41 httpd_conffile=`$APXS -q exp_sysconfdir`/`$APXS -q progname`.conf
42
43 exp_ftpdocsdir=`$APXS -q exp_datadir`/ftpdocs
44 FTPPORT=21
45
46 for i in Makefile build/Makefile modules/ftp/Makefile modules/ftp/modules.mk; do
47 l_r=`echo $i|sed -e "s#/*[^/]*\\\$##;s#^\(..*\)\\\$#/\1#"`
48 sed -e "s#^\(exp_installbuilddir\)=.*#\1=$exp_installbuilddir#;" \
49 -e "s#^\(include\) \$(exp_installbuilddir)#\1 $exp_installbuilddir#;" \
50 -e "s#^\(top_builddir\)=.*#\1=$top_installbuilddir#;" \
51 -e "s#^\(top_srcdir\)=.*#\1=$top_installbuilddir#;" \
52 -e "s#^\(ftp_srcdir\)=.*#\1=$srcdir#;" \
53 -e "s#^\(ftp_builddir\)=.*#\1=$builddir#;" \
54 -e "s#^\(srcdir\)=.*#\1=$srcdir$l_r#;" \
55 -e "s#^\(builddir\)=.*#\1=$builddir$l_r#;" \
56 -e "s#^\(rel_libexecdir\)=.*#\1=$rel_libexecdir#;" \
57 -e "s#^\(rel_sysconfdir\)=.*#\1=$rel_sysconfdir#;" \
58 -e "s#^\(rel_logfiledir\)=.*#\1=$rel_logfiledir#;" \
59 -e "s#^\(httpd_conffile\)=.*#\1=$httpd_conffile#;" \
60 -e "s#^\(exp_ftpdocsdir\)=.*#\1=$exp_ftpdocsdir#;" \
61 -e "s#^\(FTPPORT\)=.*#\1=$FTPPORT#;" \
62 < $i.apxs > $i
63 done
64
65 touch .deps
66 touch build/.deps
67 touch modules/ftp/.deps
68
69 cd build
70 found_features=""
71 echo "Detecting features"
72 echo "Detecting features" > ../config.apxs.log
73
74 if make local-clean conftest_fchmod >>../config.apxs.log 2>&1; then
75 found_features="$found_features \
76 -e \"s/^#undef \(HAVE_FCHMOD\)[ \t]*/#define \1 1/;\""
77 fi
78
79 if make local-clean conftest_arpa_ftp_h >>../config.apxs.log 2>&1; then
80 found_features="$found_features \
81 -e \"s/^#undef \(HAVE_ARPA_FTP_H\)[ \t]*/#define \1 1/;\""
82 fi
83
84 if make local-clean conftest_netinet_ip_h >>../config.apxs.log 2>&1; then
85 found_features="$found_features \
86 -e \"s/^#undef \(HAVE_NETINET_IP_H\)[ \t]*/#define \1 1/;\""
87
88 if make local-clean conftest_SOL_IP >>../config.apxs.log 2>&1; then
89 found_features="$found_features \
90 -e \"s/^#undef \(HAVE_SOL_IP\)[ \t]*/#define \1 1/;\""
91 fi
92 fi
93
94 if make local-clean conftest_sys_stat_h >>../config.apxs.log 2>&1; then
95 found_features="$found_features \
96 -e \"s/^#undef \(HAVE_SYS_STAT_H\)[ \t]*/#define \1 1/;\""
97 fi
98
99 if make conftest_struct_msghdr_msg_control >>../config.apxs.log 2>&1; then
100 found_features="$found_features \
101 -e \"s/^#undef \(HAVE_STRUCT_MSGHDR_MSG_CONTROL\)[ \t]*/#define \1 1/;\""
102 fi
103
104 if make conftest_struct_msghdr_msg_accrights >>../config.apxs.log 2>&1; then
105 found_features="$found_features \
106 -e \"s/^#undef \(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS\)[ \t]*/#define \1 1/;\""
107 fi
108
109 make local-distclean >>../config.apxs.log 2>&1
110 cd ..
111
112 if test "x$found_features" = "x"; then
113 cp modules/ftp/ftp_config.h.in modules/ftp/ftp_config.h
114 else
115 found_features="`echo \"$found_features\" | sed -e '#s*/#*\\$/#g;'`"
116 eval sed $found_features < modules/ftp/ftp_config.h.in \
117 > modules/ftp/ftp_config.h
118 fi
119
120 echo ""
121 echo "Finished, run 'make' to compile mod_ftp"
122 echo ""
123 echo "Run 'make FTPPORT=8021 install' to install mod_ftp"
124 echo "(The default FTPPORT is $FTPPORT if not specified)"
125 echo ""
126 echo "The manual pages ftp/index.html and mod/mod_ftp.html"
127 echo "will be installed to help get you started."
128 echo
129 echo "The conf/extra/ftpd.conf will be installed as an example"
130 echo "for you to work from. In your configuration file,"
131 echo " `$APXS -q exp_sysconfdir`/`$APXS -q progname`.conf"
132 echo "uncomment the line '#Include conf/extra/ftpd.conf'"
133 echo "to activate this example mod_ftp configuration."
134