apxs.bat で、VC 用のコンパイルオプションを使おうとしてるみたいですね。
同じようなはまり方をしている人が、ここに。
http://d.hatena.ne.jp/hhelibex/20110310/1299766831
(apxsは何をしてくれるかっていうと、pl覗けば分かるけど、コンパイラとリンカのオプションを設定して一度に実行してくれる。makeみたいなもん。デフォでclとlink使うようになってるから、bcc使いな人は手動でやった方が早そう)
http://blog.goo.ne.jp/yulali/e/ac2377eaac7d7049fb00bd55653c08e2
Configure.pl で、うまくやってくれそうな感じですけどね。
でも、先のはてなダイアリーでは、Configure.pl もやってるみたいだし...
とりあえず、「地力でコンパイルする」で終わってるので、もうちょっと検索。
こちらは、apxs のサンプルをコンパイルしている手順を書いているところです。
http://yyamazakiya.blogspot.jp/2011_07_01_archive.html
Apache の方に、インクルードパスとライブラリパスを通しておけば良い、という感じです。
gcc -mwindows -I C:\ApacheSoftware\Apache2.2\include -L C:\ApacheSoftware\Apache2.2\lib -c mod_hoge.c
...
続いて、.soファイルをつくります。以下のようなgccを実行してください。
gcc -mwindows -I C:\ApacheSoftware\Apache2.2\include -L C:\ApacheSoftware\Apache2.2\lib -shared -o mod_hoge.so mod_hoge.o -llibhttpd
http://yyamazakiya.blogspot.jp/2011_07_01_archive.html
-mwindows が付いてるってことは、cygwin の gcc ですかね。
MinGW なら -mwindows を外す感じになるでしょう。
ヘッダファイルが2つ(ap_config_auto.hとap_config_layout.h)ありませんと出ています。
そんなファイル確かにないし、、、
http://yyamazakiya.blogspot.jp/2011_07_01_archive.html
これは、Configure.pl をやってないから、という気がします。
んで、mod_evasive のソースをちょろっと見てみたんですが、syslog を使ってるので、Windows 環境でコンパイルが通らない気がします。
それに、メールでの通知に /bin/mail とか書いてあるので、コンパイルが通っても動かないような...
あ、/bin/mail は EmailNotify を使わなきゃ、良いだけの話か。
とりあえず、syslog を使わないようにすれば、コンパイル&リンクはできそうな感じ。
例えば、
...
#define LOG( A, ... )
想像で書いているところが多いのですが、参考になれば、と。
よろしくお願いいたします。
C:\Users\Administrator\Desktop\mod_evasive>"C:\Program Files\Apache Software Foundation\Apache2.2\bin\apxs.bat" -a -i -c mod_evasive20.c
C:/Perl/site/bin/gcc.exe /nologo /MD /W3 /O2 /D WIN32 /D _WINDOWS /D NDEBUG
-I"C:\PROGRA~1\APACHE~1\Apache2.2\include" /c /Fomod_evasive20.lo mod_evasive20
.c
gcc.exe: /nologo: No such file or directory
gcc.exe: /MD: No such file or directory
gcc.exe: /W3: No such file or directory
gcc.exe: /O2: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: WIN32: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: _WINDOWS: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: NDEBUG: No such file or directory
gcc.exe: /c: No such file or directory
gcc.exe: /Fomod_evasive20.lo: No such file or directory
mod_evasive20.c:24:24: sys/socket.h: No such file or directory
mod_evasive20.c:26:24: netinet/in.h: No such file or directory
mod_evasive20.c:27:23: arpa/inet.h: No such file or directory
mod_evasive20.c:32:20: syslog.h: No such file or directory
In file included from C:/PROGRA~1/APACHE~1/Apache2.2/include/httpd.h:43,
from mod_evasive20.c:35:
C:/PROGRA~1/APACHE~1/Apache2.2/include/ap_config.h:234:28: ap_config_auto.h: No
such file or directory
C:/PROGRA~1/APACHE~1/Apache2.2/include/ap_config.h:235:30: ap_config_layout.h: N
o such file or directory
mod_evasive20.c: In function `access_checker':
mod_evasive20.c:215: error: `LOG_PID' undeclared (first use in this function)
mod_evasive20.c:215: error: (Each undeclared identifier is reported only once
mod_evasive20.c:215: error: for each function it appears in.)
mod_evasive20.c:215: error: `LOG_DAEMON' undeclared (first use in this function)
mod_evasive20.c:215: error: `LOG_ALERT' undeclared (first use in this function)
apxs:Error: Command failed with rc=65536
.