Viewing Apache apxs compiler flags


If you have used apxs to build an Apache module, you may have wondered where apxs got the linker and compiler options since they are not embedded in the apxs Perl script? The linker and compiler flags are generated by the apr-config and apu-config scripts, which contain platform specific options that are assigned at Apache build time. These options can be viewed by running apr-config or apu-config with one or more options:

$ apr-config --cppflags --cflags -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations

The Apache build system is super interesting, and I love the fact that you can easily add modules to an existing Apache installation.

This article was posted by Matty on 2006-06-10 11:01:00 -0400 -0400