You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2007/12/16 23:27:36 UTC

svn commit: r604723 - in /httpd/mod_ftp/trunk: build/Makefile.apxs configure.apxs

Author: wrowe
Date: Sun Dec 16 14:27:34 2007
New Revision: 604723

URL: http://svn.apache.org/viewvc?rev=604723&view=rev
Log:
Configure-test, httpd/build/ style.


Added:
    httpd/mod_ftp/trunk/build/Makefile.apxs   (with props)
Modified:
    httpd/mod_ftp/trunk/configure.apxs

Added: httpd/mod_ftp/trunk/build/Makefile.apxs
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/build/Makefile.apxs?rev=604723&view=auto
==============================================================================
--- httpd/mod_ftp/trunk/build/Makefile.apxs (added)
+++ httpd/mod_ftp/trunk/build/Makefile.apxs Sun Dec 16 14:27:34 2007
@@ -0,0 +1,40 @@
+##
+##  Makefile.apx -- Build procedure for mod_ftp Apache module
+##
+##  Do not use this target; build from the mod_ftp dir root
+##
+ 
+# top_builddir and top_srcdir are misnomers, because build/*.mk
+# scripts expect it them be the parent of the build directory,
+# and fail to trust the installbuilddir.
+exp_installbuilddir=$(shell $(APXS) -q exp_installbuilddir)
+top_srcdir=$(installbuilddir)/..
+top_builddir=$(installbuilddir)/..
+
+ftp_builddir=..
+ftp_srcdir=..
+builddir=.
+srcdir=.
+
+CLEAN_TARGETS = conftest_fchmod.c conftest_arpa_ftp_h.c
+TARGETS       = conftest_fchmod   conftest_arpa_ftp_h
+
+PROGRAM_LDADD        = 
+PROGRAM_DEPENDENCIES = 
+
+include $(exp_installbuilddir)/rules.mk
+
+conftest_fchmod: conftest_fchmod.lo
+	$(LINK) conftest_fchmod.lo
+
+conftest_fchmod.c:
+	echo "#include <sys/types.h>" > $@
+	echo "#include <sys/stat.h>" >> $@
+	echo "int main() { return fchmod(2, 0644); }" >> $@
+
+conftest_arpa_ftp_h: conftest_arpa_ftp_h.lo
+	echo "success" > $@
+
+conftest_arpa_ftp_h.c:
+	echo "#include <arpa/ftp.h>" > $@
+

Propchange: httpd/mod_ftp/trunk/build/Makefile.apxs
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: httpd/mod_ftp/trunk/configure.apxs
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/configure.apxs?rev=604723&r1=604722&r2=604723&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/configure.apxs (original)
+++ httpd/mod_ftp/trunk/configure.apxs Sun Dec 16 14:27:34 2007
@@ -42,7 +42,7 @@
 exp_ftpdocsdir=`$APXS -q exp_datadir`/ftpdocs
 FTPPORT=21
 
-for i in Makefile modules/ftp/Makefile modules/ftp/modules.mk; do
+for i in Makefile build/Makefile modules/ftp/Makefile modules/ftp/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#;" \
@@ -61,10 +61,30 @@
 done
 
 touch .deps
+touch build/.deps
 touch modules/ftp/.deps
 
-sed -e "s/^#undef \(HAVE_FCHMOD\)/#define \1/;" \
-	< modules/ftp/ftp_config.h.in > modules/ftp/ftp_config.h
+cd build
+found_features=""
+
+if make local-clean conftest_arpa_ftp_h; then \
+  found_features="$found_features\|HAVE_ARPA_FTP_H"
+fi
+
+if make local-clean conftest_fchmod; then \
+  found_features="$found_features\|HAVE_FCHMOD"
+fi
+
+found_features="`echo \"$found_features\" | sed -e 's/^\\\\|//;'`"
+make local-distclean
+cd ..
+
+if test "x$found_features" = "x"; then \
+  cp modules/ftp/ftp_config.h.in modules/ftp/ftp_config.h; \
+else \
+  sed -e "s/^#undef \($found_features\)[ \t]*\$/#define \1/;" \
+	< modules/ftp/ftp_config.h.in > modules/ftp/ftp_config.h; \
+fi
 
 echo ""
 echo "Finished, run 'make' to compile mod_ftp"