On Sat, 14 Dec 2002, Stas Bekman wrote: > [looks my original reply didn't make it through, trying again] > > Beau E. Cox wrote: > > Hi - > > > > I am posting this message informally - this is not > > critical (maybe not worth looking at); during > > the mp2 make install, mod_perl.so is copied to the > > apache2 tree (on my system) like this: > > > > cp mod_perl.so /usr/local/apache2/modules > > > > Now, if you haven't configured any apache2 modules > > (as I haven't for my test server), the subdirectory > > modules doesn't exist, so mod_perl.so is put into > > the apache2 tree as _file_ 'modules' under > > /usr/local/apache2. That's why I couldn't find it! > > [...] > > This is a known problem. I came up with this patch: > http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=103847596809386&w=2 > > But I'm afraid it's not portable and hence I couldn't commit it. Here is the > relevant snippet of the patch: > > install: > + test -d $(MODPERL_AP_LIBEXECDIR) || mkdir $(MODPERL_AP_LIBEXECDIR) > $(MODPERL_TEST_F) $(MODPERL_LIB_DSO) && \ > $(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_LIBEXECDIR) > > Any portability gurus know how to make this Makefile's line (the one with +) > portable? I think 'mkdir' is portable. What about 'test -d'?
On Win32, at least, 'test' isn't available. What about something like the following: perl -e "exit ! -d \"$(MODPERL_AP_LIBEXECDIR)\"" || mkdir $(...) (the \" may be needed if the directory contains spaces, as Win32 might). And if one is worried about the system mkdir availability, one can use perl -MExtUtils::Command -e mkpath directory -- best regards, randy