From e8732da7aae0558e5d24d7ba61d06de2545c8f37 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 10 Dec 2002 23:02:35 +0000 Subject: [PATCH] Added further options to configure script. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@173 e3e1d417-86f3-4887-817a-d78f3d33393f --- Makefile.in | 4 + README | 21 +++-- configure | 190 +++++++++++++++++++++++++++++--------------- configure.in | 52 +++++++++--- scripts/Makefile.in | 4 + src/Makefile.am | 8 +- src/Makefile.in | 12 ++- web/Makefile.am | 8 +- web/Makefile.in | 12 ++- 9 files changed, 209 insertions(+), 102 deletions(-) diff --git a/Makefile.in b/Makefile.in index 795a80034..26df33a3d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -58,6 +58,7 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ +CGI_PREFIX = @CGI_PREFIX@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ @@ -65,6 +66,9 @@ MYSQL_LIBS = @MYSQL_LIBS@ MYSQL_PREFIX = @MYSQL_PREFIX@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ bindir = @bindir@ AUTOMAKE_OPTIONS = gnu diff --git a/README b/README index 9d04521a8..21643f583 100644 --- a/README +++ b/README @@ -87,18 +87,17 @@ relative to the web root directory in zmcfg.h and where in full path terms in zmconfig.php. There are also several other paths in index.php but these can wait until later. -The next step is tocheck and/or edit the src/Makefile.in and web/Makefile.in -files and make sure that the WEBUSR and WEBGRP definitions near the top are -appropriate for the user associated with your web server, ie. apache or web -or whatever you've defined. In the web/makefile.in file there is also another -definition which is webdir which should be the directory you want to install -the PHP files to, and in src/Makefile.in there is a similar definition of -cgidir which is where your CGI files should go. This is a bit of a pain I -will admit so if anyone can tell me how to get this stuff put into the configure -script I would be most grateful. +So to continue, just type -So to continue, just type './configure --with-mysql=/usr' (or your MySQL install -path). Then just type 'make' and off you go. +./configure --with-webdir= --with-cgidir= --with-mysql= + +where --with-webdir is the directory to which you want to install the PHP files, +and --with-cgidir is the directory to which you want to install CGI files. +There are also two further arguments you can add if your web user and group +are not apache and apache. These are --with-webuser and --with-webgroup. Type +./configure --help for details. + +Then just type 'make' and off you go. I know what you are going to say next, it doesn't work. I hope it does but this is my first type with autoconf and quite honestly I haven't a clue what I'm diff --git a/configure b/configure index 1ae5c70fd..8f783475f 100755 --- a/configure +++ b/configure @@ -13,6 +13,14 @@ ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --with-mysql= prefix of MySQL installation. e.g. /usr/local or /usr" +ac_help="$ac_help + --with-webdir= prefix of web directory. e.g. /var/www/html or /www/vhtdocs/" +ac_help="$ac_help + --with-cgidir= prefix of cgi directory. e.g. /var/www/cgi-bin or /www/vhtdocs//cgi-bin" +ac_help="$ac_help + --with-webuser= username of web user. e.g. apache or web" +ac_help="$ac_help + --with-webgroup= groupname of web group. e.g. apache or web" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -554,7 +562,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:558: checking for a BSD compatible install" >&5 +echo "configure:566: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -607,7 +615,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:611: checking whether build environment is sane" >&5 +echo "configure:619: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -664,7 +672,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:668: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:676: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -710,7 +718,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:714: checking for working aclocal" >&5 +echo "configure:722: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -723,7 +731,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:727: checking for working autoconf" >&5 +echo "configure:735: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -736,7 +744,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:740: checking for working automake" >&5 +echo "configure:748: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -749,7 +757,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:753: checking for working autoheader" >&5 +echo "configure:761: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -762,7 +770,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:766: checking for working makeinfo" >&5 +echo "configure:774: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -779,7 +787,6 @@ fi -# Ask user for path to libmysqlclient stuff:. # Check whether --with-mysql or --without-mysql was given. if test "${with_mysql+set}" = set; then withval="$with_mysql" @@ -797,10 +804,68 @@ MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include" +# Ask user for path to web stuff:. +# Check whether --with-webdir or --without-webdir was given. +if test "${with_webdir+set}" = set; then + withval="$with_webdir" + WEB_PREFIX=$with_webdir +else + { echo "configure: error: You must call configure with the --with-webdir option. + This tells configure where to install PHP and web files and scripts. + e.g. --with-webdir=/var/www/html or --with-mysql=/www/vhtdocs/" 1>&2; exit 1; } + +fi + + + +# Ask user for path to cgi stuff:. +# Check whether --with-cgidir or --without-cgidir was given. +if test "${with_cgidir+set}" = set; then + withval="$with_cgidir" + CGI_PREFIX=$with_cgidir +else + { echo "configure: error: You must call configure with the --with-cgidir option. + This tells configure where to install cgi files and scripts. + e.g. --with-cgidir=/var/www/cgi-bin or --with-mysql=/www/vhtdocs//cgi-bin" 1>&2; exit 1; } + +fi + + + +WEB_USER=apache +# Ask user for web user name:. +# Check whether --with-webuser or --without-webuser was given. +if test "${with_webuser+set}" = set; then + withval="$with_webuser" + WEB_USER=$with_webuser +else + echo "configure: warning: You can call configure with the --with-webuser option. + This tells configure what the user name of the web user is if it is not the default of 'apache'. + e.g. --with-webuser=apache or --with-webuser=web" 1>&2 + +fi + + + +WEB_GROUP=apache +# Ask group for web group name:. +# Check whether --with-webgroup or --without-webgroup was given. +if test "${with_webgroup+set}" = set; then + withval="$with_webgroup" + WEB_GROUP=$with_webgroup +else + echo "configure: warning: You can call configure with the --with-webgroup option. + This tells configure what the group name of the web group is if it is not the default of 'apache'. + e.g. --with-webgroup=apache or --with-webgroup=web" 1>&2 + +fi + + + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:804: checking for $ac_word" >&5 +echo "configure:869: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -830,7 +895,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:834: checking for $ac_word" >&5 +echo "configure:899: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -881,7 +946,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:885: checking for $ac_word" >&5 +echo "configure:950: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -913,7 +978,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:917: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:982: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -924,12 +989,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 928 "configure" +#line 993 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -955,12 +1020,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:959: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1024: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:964: checking whether we are using GNU C" >&5 +echo "configure:1029: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -969,7 +1034,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -988,7 +1053,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:992: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1057: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1024,7 +1089,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1028: checking for $ac_word" >&5 +echo "configure:1093: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1056,7 +1121,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1060: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1125: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1067,12 +1132,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1071 "configure" +#line 1136 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1098,12 +1163,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1102: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1167: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1107: checking whether we are using GNU C++" >&5 +echo "configure:1172: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1112,7 +1177,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1131,7 +1196,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1135: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1200: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1172,7 +1237,7 @@ for ac_declaration in \ 'void exit (int);' do cat > conftest.$ac_ext < $ac_declaration @@ -1180,7 +1245,7 @@ int main() { exit (42); ; return 0; } EOF -if { (eval echo configure:1184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -1190,14 +1255,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* break else @@ -1225,7 +1290,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1229: checking for a BSD compatible install" >&5 +echo "configure:1294: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1278,7 +1343,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1282: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1347: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1306,7 +1371,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1310: checking how to run the C preprocessor" >&5 +echo "configure:1375: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1321,13 +1386,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1338,13 +1403,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1355,13 +1420,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1386,12 +1451,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1390: checking for ANSI C header files" >&5 +echo "configure:1455: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1399,7 +1464,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1416,7 +1481,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1434,7 +1499,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1455,7 +1520,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1466,7 +1531,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1499,7 +1564,7 @@ cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking for jpeg_start_compress in -ljpeg""... $ac_c" 1>&6 -echo "configure:1503: checking for jpeg_start_compress in -ljpeg" >&5 +echo "configure:1568: checking for jpeg_start_compress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_start_compress | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1507,7 +1572,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ljpeg $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1550,7 +1615,7 @@ else fi echo $ac_n "checking for compress in -lz""... $ac_c" 1>&6 -echo "configure:1554: checking for compress in -lz" >&5 +echo "configure:1619: checking for compress in -lz" >&5 ac_lib_var=`echo z'_'compress | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1558,7 +1623,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1601,7 +1666,7 @@ else fi echo $ac_n "checking for dlsym in -ldl""... $ac_c" 1>&6 -echo "configure:1605: checking for dlsym in -ldl" >&5 +echo "configure:1670: checking for dlsym in -ldl" >&5 ac_lib_var=`echo dl'_'dlsym | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1609,7 +1674,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1653,15 +1718,6 @@ fi #AC_CHECK_LIB(mysqlclient,mysql_init,,AC_MSG_ERROR(zm requires libmysqlclient.a)) -# Ask user for path to libmysqlclient stuff:. -#AC_ARG_WITH(webdir, - #[ --webdir= prefix of web installation. e.g. /var/www/html or /www/vhtdocs/site], - #[webdir=$webdir], - #AC_MSG_ERROR([You must call configure with the --webdir option. - #This tells configure where to put the web files. - #e.g. --webdir=/var/www/html or --webdir=/www/vhtdocs/site]) -#) -#AC_SUBST(webdir) trap '' 1 2 15 @@ -1811,6 +1867,10 @@ s%@SET_MAKE@%$SET_MAKE%g s%@MYSQL_PREFIX@%$MYSQL_PREFIX%g s%@MYSQL_LIBS@%$MYSQL_LIBS%g s%@MYSQL_CFLAGS@%$MYSQL_CFLAGS%g +s%@WEB_PREFIX@%$WEB_PREFIX%g +s%@CGI_PREFIX@%$CGI_PREFIX%g +s%@WEB_USER@%$WEB_USER%g +s%@WEB_GROUP@%$WEB_GROUP%g s%@CC@%$CC%g s%@CXX@%$CXX%g s%@CPP@%$CPP%g diff --git a/configure.in b/configure.in index 79b247b7e..78275b0ee 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,6 @@ AC_INIT(src/zm.h) AM_INIT_AUTOMAKE(zm,1.0.0) AM_CONFIG_HEADER(config.h) -# Ask user for path to libmysqlclient stuff:. AC_ARG_WITH(mysql, [ --with-mysql= prefix of MySQL installation. e.g. /usr/local or /usr], [MYSQL_PREFIX=$with_mysql], @@ -16,6 +15,48 @@ MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include" AC_SUBST(MYSQL_LIBS) AC_SUBST(MYSQL_CFLAGS) +# Ask user for path to web stuff:. +AC_ARG_WITH(webdir, + [ --with-webdir= prefix of web directory. e.g. /var/www/html or /www/vhtdocs/], + [WEB_PREFIX=$with_webdir], + AC_MSG_ERROR([You must call configure with the --with-webdir option. + This tells configure where to install PHP and web files and scripts. + e.g. --with-webdir=/var/www/html or --with-mysql=/www/vhtdocs/]) +) +AC_SUBST(WEB_PREFIX) + +# Ask user for path to cgi stuff:. +AC_ARG_WITH(cgidir, + [ --with-cgidir= prefix of cgi directory. e.g. /var/www/cgi-bin or /www/vhtdocs//cgi-bin], + [CGI_PREFIX=$with_cgidir], + AC_MSG_ERROR([You must call configure with the --with-cgidir option. + This tells configure where to install cgi files and scripts. + e.g. --with-cgidir=/var/www/cgi-bin or --with-mysql=/www/vhtdocs//cgi-bin]) +) +AC_SUBST(CGI_PREFIX) + +WEB_USER=apache +# Ask user for web user name:. +AC_ARG_WITH(webuser, + [ --with-webuser= username of web user. e.g. apache or web], + [WEB_USER=$with_webuser], + AC_MSG_WARN([You can call configure with the --with-webuser option. + This tells configure what the user name of the web user is if it is not the default of 'apache'. + e.g. --with-webuser=apache or --with-webuser=web]) +) +AC_SUBST(WEB_USER) + +WEB_GROUP=apache +# Ask group for web group name:. +AC_ARG_WITH(webgroup, + [ --with-webgroup= groupname of web group. e.g. apache or web], + [WEB_GROUP=$with_webgroup], + AC_MSG_WARN([You can call configure with the --with-webgroup option. + This tells configure what the group name of the web group is if it is not the default of 'apache'. + e.g. --with-webgroup=apache or --with-webgroup=web]) +) +AC_SUBST(WEB_GROUP) + AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL @@ -30,15 +71,6 @@ AC_CHECK_LIB(z,compress,,AC_MSG_ERROR(zm requires libz.a)) AC_CHECK_LIB(dl,dlsym,,AC_MSG_ERROR(zm requires libdl.a)) #AC_CHECK_LIB(mysqlclient,mysql_init,,AC_MSG_ERROR(zm requires libmysqlclient.a)) -# Ask user for path to libmysqlclient stuff:. -#AC_ARG_WITH(webdir, - #[ --webdir= prefix of web installation. e.g. /var/www/html or /www/vhtdocs/site], - #[webdir=$webdir], - #AC_MSG_ERROR([You must call configure with the --webdir option. - #This tells configure where to put the web files. - #e.g. --webdir=/var/www/html or --webdir=/www/vhtdocs/site]) -#) -#AC_SUBST(webdir) AC_SUBST(bindir) AC_OUTPUT(Makefile src/Makefile web/Makefile web/zmconfig.php scripts/Makefile scripts/zmdc.pl) diff --git a/scripts/Makefile.in b/scripts/Makefile.in index e436faa21..6bcfbd6a0 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -58,6 +58,7 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ +CGI_PREFIX = @CGI_PREFIX@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ @@ -65,6 +66,9 @@ MYSQL_LIBS = @MYSQL_LIBS@ MYSQL_PREFIX = @MYSQL_PREFIX@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ bindir = @bindir@ AUTOMAKE_OPTIONS = gnu diff --git a/src/Makefile.am b/src/Makefile.am index dd61ba160..b6a478859 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,11 +3,11 @@ AUTOMAKE_OPTIONS = gnu LDADD = @MYSQL_LIBS@ CPPFLAGS = @MYSQL_CFLAGS@ -# You need to set this to your CGI directory -cgidir = /var/www/cgi-bin +# This should be set to your CGI directory +cgidir = @CGI_PREFIX@ # And these to the user and group of your webserver -webuser = apache -webgroup = apache +webuser = @WEB_USER@ +webgroup = @WEB_GROUP@ cgi_PROGRAMS = zms bin_PROGRAMS = zmc zma zmu diff --git a/src/Makefile.in b/src/Makefile.in index 2b61b621d..ae9ff454d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -58,6 +58,7 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ +CGI_PREFIX = @CGI_PREFIX@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ @@ -65,6 +66,9 @@ MYSQL_LIBS = @MYSQL_LIBS@ MYSQL_PREFIX = @MYSQL_PREFIX@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ bindir = @bindir@ AUTOMAKE_OPTIONS = gnu @@ -72,11 +76,11 @@ AUTOMAKE_OPTIONS = gnu LDADD = @MYSQL_LIBS@ CPPFLAGS = @MYSQL_CFLAGS@ -# You need to set this to your CGI directory -cgidir = /var/www/cgi-bin +# This should be set to your CGI directory +cgidir = @CGI_PREFIX@ # And these to the user and group of your webserver -webuser = apache -webgroup = apache +webuser = @WEB_USER@ +webgroup = @WEB_GROUP@ cgi_PROGRAMS = zms bin_PROGRAMS = zmc zma zmu diff --git a/web/Makefile.am b/web/Makefile.am index d024e05de..4dbb84235 100644 --- a/web/Makefile.am +++ b/web/Makefile.am @@ -1,10 +1,10 @@ AUTOMAKE_OPTIONS = gnu -# You need to set this to your web directory -webdir = /var/www/html +# This should be set to your CGI directory +webdir = @WEB_PREFIX@ # And these to the user and group of your webserver -webuser = apache -webgroup = apache +webuser = @WEB_USER@ +webgroup = @WEB_GROUP@ web_DATA = zmactions.php zmconfig.php zmdb.php zmfilter.php zmfuncs.php zmhtml.php zm.php zmstyles.css zmwml.php diff --git a/web/Makefile.in b/web/Makefile.in index 4fe2ddfa8..4880114fd 100644 --- a/web/Makefile.in +++ b/web/Makefile.in @@ -58,6 +58,7 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ +CGI_PREFIX = @CGI_PREFIX@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ @@ -65,15 +66,18 @@ MYSQL_LIBS = @MYSQL_LIBS@ MYSQL_PREFIX = @MYSQL_PREFIX@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ bindir = @bindir@ AUTOMAKE_OPTIONS = gnu -# You need to set this to your web directory -webdir = /var/www/html +# This should be set to your CGI directory +webdir = @WEB_PREFIX@ # And these to the user and group of your webserver -webuser = apache -webgroup = apache +webuser = @WEB_USER@ +webgroup = @WEB_GROUP@ web_DATA = zmactions.php zmconfig.php zmdb.php zmfilter.php zmfuncs.php zmhtml.php zm.php zmstyles.css zmwml.php