Commit 4e60ef30 authored by Eric J. Korpela's avatar Eric J. Korpela


- STILL WORK TO BE DONE TO GET locale STUFF INSTALLED PROPERLY!!!
- Update to libtool 1.5.24
- build environment:  Major automake changes that I've been warning about
  for some time.
- Now uses libtool to build libraries.
- Builds separate boinc_fcgi and sched_fcgi libraries for use with 
  FCGI server components.
- New macro "BOINC_CHECK_LIB_WITH" that executes a "AC_CHECK_LIB" on
  a library only if --with-libname[=DIR] is specified on the configure
  command line.  This is to allow inclusion of libraries when the 
  ssl, gtk, wxWidgets, or other configuration is incorrect for static
  libraries.
- Added a lot of "--with-*" for some libraries that might be required for
  static builds.
- The sea directory has been moved to packages/generic.  Changes to sea
  and the associated scripts might be required to better make use of the
  staging mechanism and shared libraries.
- Fixed includes of boinc_fcgi.h in many files.
- Fixed places where FCGI_FILE needs to be used implicitly.
- Fixed missing define of _SC_PAGESIZE on hosts that define only
  _SC_PAGE_SIZE.
- Moved build of boinc_cmd (and source file) from lib to client



svn path=/trunk/boinc/; revision=16904
parent d93eb6da
......@@ -3,10 +3,14 @@
AUTOMAKE_OPTIONS = foreign
include Makefile.incl
## make sure rebuilding uses the right aclocal-switches
ACLOCAL_AMFLAGS = -I m4
API_SUBDIRS = api lib zip
if ENABLE_LIBRARIES
API_SUBDIRS = api lib zip
endif
if ENABLE_SERVER
SERVER_SUBDIRS = db test py sched apps tools samples/example_app
......@@ -16,7 +20,7 @@ if ENABLE_CLIENT
CLIENT_SUBDIRS = client client/scripts
endif
if BUILD_CLIENTGUI
if ENABLE_MANAGER
CLIENTGUI_SUBDIRS = clientgui clientgui/res locale
endif
......@@ -33,9 +37,11 @@ EXTRA_DIST = \
stripchart \
INSTALL
if INSTALL_HEADERS
pkginclude_HEADERS = \
config.h \
version.h
endif
# Add a stage target for staging a distribution
......
......@@ -3,6 +3,11 @@
# Note: MYSQL_CFLAGS and MYSQL_LIBS set by configure from mysql_config
# ignore any LIBS set by configure
LIBS=
LIBBOINC_VERSION = @LIBBOINC_VERSION@
MYSQL_LIBS = @MYSQL_LIBS@
MYSQL_CFLAGS = @MYSQL_CFLAGS@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
......@@ -10,6 +15,8 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
RSA_LIBS = -lcrypto
AM_LIBTOOLFLAGS =
AM_CPPFLAGS = \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/api \
......@@ -17,19 +24,36 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/client \
-I$(top_srcdir)/tools \
-I$(top_srcdir)/sched \
-I$(top_srcdir)/lib/mac
-I$(top_srcdir)/lib/mac \
$(PTHREAD_CFLAGS)
AM_CFLAGS =
AM_CXXFLAGS =
AM_LDFLAGS =
# dependencies to make sure libs gets compiled before
# programs linking to them:
LIBSCHED = $(top_builddir)/sched/libsched.a
LIBSCHED = $(top_builddir)/sched/libsched.la
$(LIBSCHED):
cd $(top_builddir)/sched; ${MAKE} libsched.a
LIBBOINC = $(top_builddir)/lib/libboinc.a
cd $(top_builddir)/sched; ${MAKE} libsched.la
LIBSCHED_FCGI = $(top_builddir)/sched/libsched_fcgi.la
$(LIBSCHED_FCGI):
cd $(top_builddir)/sched; ${MAKE} libsched_fcgi.la
LIBBOINC = $(top_builddir)/lib/libboinc.la
$(LIBBOINC):
cd $(top_builddir)/lib; ${MAKE} libboinc.a
LIBAPI = = $(top_builddir)/api/libboinc_api.a
cd $(top_builddir)/lib; ${MAKE} libboinc.la
LIBBOINC_FCGI = $(top_builddir)/lib/libboinc_fcgi.la
$(LIBBOINC_FCGI):
cd $(top_builddir)/lib; ${MAKE} libboinc_fcgi.la
LIBAPI = $(top_builddir)/api/libboinc_api.la
$(LIBAPI):
cd $(top_builddir)/api; ${MAKE} libboinc_api.a
cd $(top_builddir)/api; ${MAKE} libboinc_api.la
SERVERLIBS = $(LIBSCHED) $(LIBBOINC) $(MYSQL_LIBS) $(PTHREAD_LIBS) $(RSA_LIBS)
SERVERLIBS_FCGI = $(LIBSCHED_FCGI) $(LIBBOINC_FCGI) -lfcgi $(MYSQL_LIBS) $(PTHREAD_LIBS) $(RSA_LIBS)
APPLIBS = $(LIBAPI) $(LIBBOINC)
......@@ -3,8 +3,7 @@
include $(top_srcdir)/Makefile.incl
AM_CFLAGS = @GLUT_CFLAGS@
AM_LDFLAGS = @GLUT_LIBS@
if ENABLE_LIBRARIES
# stuff linked into both main app and graphics app
api_files= \
......@@ -31,30 +30,53 @@ endif
EXTRA_DIST = *.h
if BUILD_GRAPHICS_API
graphics_libs = \
libboinc_graphics2.a
else
graphics_libs =
AM_CFLAGS += @GLUT_CFLAGS@
endif
lib_LIBRARIES = libboinc_api.a $(graphics_libs)
libboinc_api_a_SOURCES = $(api_files)
libboinc_graphics2_a_SOURCES = $(graphics2_files)
libboinc_graphics2_a_CPPFLAGS = -I$(top_srcdir)/lib
lib_LTLIBRARIES = libboinc_api.la
libboinc_api_la_SOURCES = $(api_files)
libboinc_api_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
if BUILD_GRAPHICS_API
lib_LTLIBRARIES += libboinc_graphics2.la
libboinc_graphics2_la_SOURCES = $(graphics2_files)
libboinc_graphics2_la_CPPFLAGS = -I$(top_srcdir)/lib
libboinc_graphics2_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
endif #BUILD_GRAPHICS_API
if INSTALL_HEADERS
## install only headers that are meant for exporting the API !!
pkginclude_HEADERS = \
boinc_api.h \
graphics2.h \
gutil.h
endif ## INSTALL_HEADERS
if BUILD_STATIC_LIBS
all_local = libboinc_api.a
if BUILD_GRAPHICS_API
all_local += libboinc_graphics2.a
endif
endif
all-local: $(all_local)
libboinc_api.a: libboinc_api.la
rm -f libboinc_api.a
ln .libs/libboinc_api.a
libboinc_graphics2.a: libboinc_graphics2.la
rm -f libboinc_graphics2.a
ln .libs/libboinc_graphics2.a
endif ## ENABLE_LIBRARIES
.PHONY:
EXTRA_PROGRAMS = api_app api_test
api_app_SOURCES = api_app.cpp boinc_api.cpp ../lib/parse.cpp
api_test_SOURCES = boinc_api.cpp api_test.cpp ../lib/parse.cpp
api_app_SOURCES = api_app.cpp ../lib/parse.cpp
api_app_LDADD = $(LIBAPI)
api_test_SOURCES = api_test.cpp ../lib/parse.cpp
api_test_LDADD = $(LIBAPI)
......@@ -5,9 +5,17 @@ include $(top_srcdir)/Makefile.incl
bin_PROGRAMS = upper_case concat 1sec
LDADD = $(top_builddir)/api/libboinc_api.a $(LIBBOINC) $(PTHREAD_LIBS)
AM_CXXFLAGS = $(MYSQL_CFLAGS)
upper_case_SOURCES = upper_case.cpp
upper_case_CXXFLAGS = $(PTHREAD_CFLAGS)
upper_case_LDFLAGS = -static-libtool-libs
upper_case_LDADD = $(APPLIBS)
concat_SOURCES = concat.cpp
concat_CXXFLAGS = $(PTHREAD_CFLAGS)
concat_LDFLAGS = -static-libtool-libs
concat_LDADD = $(APPLIBS)
1sec_SOURCES = 1sec.cpp
1sec_CFLAGS = $(PTHREAD_CFLAGS)
1sec_LDFLAGS = -static-libtool-libs
1sec_LDADD = $(APPLIBS)
......@@ -280,3 +280,82 @@ David 13 Jan 2009
lib/
gui_rpc_client_ops.cpp
gui_rpc_client.h
Eric 13 Jan 2009
- STILL WORK TO BE DONE TO GET locale STUFF INSTALLED PROPERLY!!!
- Update to libtool 1.5.24
- build environment: Major automake changes that I've been warning about
for some time.
- Now uses libtool to build libraries.
- Builds separate boinc_fcgi and sched_fcgi libraries for use with
FCGI server components.
- New macro "BOINC_CHECK_LIB_WITH" that executes a "AC_CHECK_LIB" on
a library only if --with-libname[=DIR] is specified on the configure
command line. This is to allow inclusion of libraries when the
ssl, gtk, wxWidgets, or other configuration is incorrect for static
libraries.
- Added a lot of "--with-*" for some libraries that might be required for
static builds.
- The sea directory has been moved to packages/generic. Changes to sea
and the associated scripts might be required to better make use of the
staging mechanism and shared libraries.
- Fixed includes of boinc_fcgi.h in many files.
- Fixed places where FCGI_FILE needs to be used implicitly.
- Fixed missing define of _SC_PAGESIZE on hosts that define only
_SC_PAGE_SIZE.
- Moved build of boinc_cmd (and source file) from lib to client
ltmain.sh
config.guess
config.sub
Makefile.incl
m4/
sah_check_lib.m4
check_ssl.m4
boinc_gtk.m4 (new)
boinc_check_lib_with.m4 (new)
libcurl.m4
boinc_wxwidgets.m4
sea/ (moved to packages/generic/sea)
packages/ (new)
generic/ (new)
sea/ (new)
Makefile.am
client/
Makefile.am
hostinfo_unix.cpp
sched/
edf_sim.cpp
sched_shmem.h
sched_msgs.h
sched_msgs.cpp
sched_send.cpp
handle_resuest.cpp
file_upload_handler.cpp
main.cpp
sched_assign.cpp
Makefile.am
lib/
boinc_cmd.cpp (moved to client)
diagnostics.cpp
prefs.cpp
msg_log.h
cert_sig.cpp
Makefile.am
zip/
Makefile.am
samples/
example_app/
Makefile
api/
Makefile.am
clientgui/
Makefile.am
tools/
backend_lib.cpp
Makefile.am
doc/
manpages/
Makefile.am
......@@ -3,19 +3,23 @@
include $(top_srcdir)/Makefile.incl
# (for a while we used "-static -static-libgcc" on linux, but this is obsolete
# now)
#STATIC_FLAGS=@STATIC_FLAGS@
client-bin: @CLIENT_BIN_FILENAME@
if ENABLE_CLIENT_RELEASE
AM_LDFLAGS += -static-libtool-libs
endif
LIBS += @CLIENTLIBS@
LIBS += $(CLIENTLIBS)
if OS_DARWIN
LIBS += -framework IOKit -framework Foundation -framework ScreenSaver -framework Cocoa
endif
bin_PROGRAMS = boinc_client switcher
bin_PROGRAMS = boinc_client switcher boinccmd
boinccmd_SOURCES = boinc_cmd.cpp
boinccmd_DEPENDENCIES = $(LIBBOINC)
boinccmd_CPPFLAGS = $(AM_CPPFLAGS)
boinccmd_LDFLAGS = $(AM_LDFLAGS) -L../lib
boinccmd_LDADD = $(LIBBOINC) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS)
boinc_client_SOURCES = \
acct_mgr.cpp \
......@@ -61,25 +65,27 @@ boinc_client_SOURCES = \
whetstone.cpp \
work_fetch.cpp
boinc_client_DEPENDENCIES =
boinc_client_CPPFLAGS = -O3 -fomit-frame-pointer -fforce-addr -ffast-math $(AM_CPPFLAGS)
boinc_client_LDFLAGS = -static-libgcc
boinc_client_LDADD = $(LIBBOINC) $(PTHREAD_LIBS)
boinc_client_DEPENDENCIES = $(LIBBOINC)
boinc_client_CPPFLAGS = $(AM_CPPFLAGS)
boinc_client_LDFLAGS = $(AM_LDFLAGS) -L../lib
boinc_client_LDADD = $(LIBBOINC) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS)
boinc_clientdir = $(bindir)
boinc_client_DATA = ../curl/ca-bundle.crt
switcher_SOURCES = switcher.cpp
all-local: client-bin
## since we are using libtool we need some magic to get boinc and boinc_client
## to both be installed properly. The next two rules do that...
all-local: boinc
# make a hard link to the client name.
@CLIENT_BIN_FILENAME@: boinc_client
rm -f $@
rm -f $@.unmodified
cp $? $@.unmodified
@LN@ $? $@
@STRIP@ $@
boinc: boinc_client
rm -f boinc .libs/boinc
ln boinc_client boinc
if test -f .libs/boinc_client ; then ln .libs/boinc_client .libs/boinc ; fi
install-exec-hook:
rm -f $(DESTDIR)$(exec_prefix)/bin/boinc
ln $(DESTDIR)$(exec_prefix)/bin/boinc_client $(DESTDIR)$(exec_prefix)/bin/boinc
## these source files need to be specified because no rule uses them.
......@@ -87,7 +93,3 @@ EXTRA_DIST = *.h \
mac \
translation \
win
clean-local:
rm -f @CLIENT_BIN_FILENAME@
rm -f @CLIENT_BIN_FILENAME@.unmodified
......@@ -140,6 +140,11 @@ NXEventHandle gEventHandle = NULL;
#include <machine/cpuconf.h>
#endif
// Some OS define _SC_PAGE_SIZE instead of _SC_PAGESIZE
#if defined(_SC_PAGE_SIZE) && !defined(_SC_PAGESIZE)
#define _SC_PAGESIZE _SC_PAGE_SIZE
#endif
// The following is intended to be true both on Linux
// and Debian GNU/kFreeBSD (see trac #521)
//
......
......@@ -3,8 +3,9 @@
include $(top_srcdir)/Makefile.incl
LIBS += @CLIENTLIBS@
if ENABLE_CLIENT_RELEASE
AM_LDFLAGS += -static-libtool-libs
endif
if OS_DARWIN
LIBS += -framework IOKit -framework Foundation -framework ScreenSaver -framework Cocoa -framework Security
......@@ -21,11 +22,11 @@ else
mac_sources =
endif
bin_PROGRAMS = boinc_gui
bin_PROGRAMS = boincmgr
# keep the following alphabetic
boinc_gui_SOURCES = \
boincmgr_SOURCES = \
AccountInfoPage.cpp \
AccountManagerInfoPage.cpp \
AccountManagerProcessingPage.cpp \
......@@ -105,28 +106,13 @@ EXTRA_DIST = *.h \
../lib/error_numbers.h \
locale $(mac_headers)
boinc_gui_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) $(CLIENTGUIFLAGS)
boinc_gui_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(CLIENTGUIFLAGS)
boinc_gui_LDADD = $(LIBBOINC) $(CLIENTGUILIBS)
all-local: client_gui-bin
client_gui-bin: @CLIENT_GUI_BIN_FILENAME@
boincmgr_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) $(CLIENTGUIFLAGS)
boincmgr_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(CLIENTGUIFLAGS)
boincmgr_LDADD = $(LIBBOINC) $(CLIENTGUILIBS) $(BOINC_EXTRA_LIBS) $(CLIENTLIBS)
win_config.h: $(top_srcdir)/config.h
grep '#define.*BOINC.*VERSION' $^ > $@
version: win_config.h
# make a hard link to the client name.
@CLIENT_GUI_BIN_FILENAME@: boinc_gui
rm -f $@
rm -f $@.unmodified
cp $? $@.unmodified
@LN@ $? $@
@STRIP@ $@
clean-local:
rm -f @CLIENT_GUI_BIN_FILENAME@
rm -f @CLIENT_GUI_BIN_FILENAME@.unmodified
.PHONY: version
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -8,7 +8,7 @@ if ENABLE_CLIENT
CLIENT_MANS = boinc.1 boinccmd.1
endif
if BUILD_CLIENTGUI
if ENABLE_MANAGER
CLIENTGUI_MANS = boincmgr.1
endif
......@@ -18,7 +18,9 @@ endif
man_MANS = $(CLIENT_MANS) $(CLIENTGUI_MANS) $(SERVER_MANS)
%.1: %.xml
SUFFIXES = .xml .1
.xml.1:
$(DOCBOOK2X_MAN) $<
all-local: $(man_MANS)
......
......@@ -3,59 +3,23 @@
include $(top_srcdir)/Makefile.incl
#if HAVE_NSL
nslprogs=boinc_cmd$(EXEEXT)
#endif
bin_PROGRAMS =
bin_PROGRAMS = crypt_prog$(EXEEXT) $(nslprogs)
# Stuff needed for server builds goes here.
if ENABLE_SERVER
EXTRA_PROGRAMS = md5_test$(EXEEXT) shmem_test$(EXEEXT) msg_test$(EXEEXT)
bin_PROGRAMS += crypt_prog
all-local: client-bin
client-bin: @CLIENT_CMD_BIN_FILENAME@
boinc_cmd_SOURCES = \
boinc_cmd.cpp \
gui_rpc_client.h
boinc_cmd_LDADD = $(lib_LIBRARIES) $(PTHREAD_LIBS)
endif
# end of "if ENABLE_SERVER"
# make a hard link to the client name.
@CLIENT_CMD_BIN_FILENAME@: boinc_cmd$(EXEEXT)
rm -f $@
rm -f $@.unmodified
cp $? $@.unmodified
@LN@ $? $@
@STRIP@ $@
lib_LIBRARIES = libboinc.a
EXTRA_DIST = *.h *.cpp
if ENABLE_LIBRARIES
if OS_DARWIN
mac_sources = \
mac/dyld_gdb.h \
mac/mac_backtrace.cpp \
mac/mac_backtrace.h \
mac/QBacktrace.c \
mac/QBacktrace.h \
mac/QCrashReport.c \
mac/QCrashReport.h \
mac/QMachOImage.c \
mac/QMachOImage.h \
mac/QMachOImageList.c \
mac/QMachOImageList.h \
mac/QSymbols.c \
mac/QSymbols.h \
mac/QTaskMemory.c \
mac/QTaskMemory.h
else
mac_sources =
endif
libboinc_a_SOURCES = \
generic_sources = \
app_ipc.cpp \
base64.cpp \
boinc_fcgi.cpp \
cert_sig.cpp \
coproc.cpp \
crypt.cpp \
......@@ -81,12 +45,37 @@ libboinc_a_SOURCES = \
str_util.cpp \
util.cpp \
unix_util.cpp \
$(mac_sources)
synch.cpp
if OS_DARWIN
mac_sources = \
mac/mac_backtrace.cpp \
mac/QBacktrace.c \
mac/QCrashReport.c \
mac/QMachOImage.c \
mac/QMachOImageList.c \
mac/QSymbols.c \
mac/QTaskMemory.c
mac_headers = \
mac/dyld_gdb.h \
mac/mac_backtrace.h \
mac/QBacktrace.h \
mac/QCrashReport.h \
mac/QMachOImage.h \
mac/QMachOImageList.h \
mac/QSymbols.h \
mac/QTaskMemory.h
else
mac_sources =
mac_headers =
endif
if INSTALL_HEADERS
pkginclude_HEADERS = \
app_ipc.h \
boinc_win.h \
boinc_fcgi.h \
boinc_win.h \
common_defs.h \
coproc.h \
crypt.h \
......@@ -104,15 +93,62 @@ pkginclude_HEADERS = \
proxy_info.h \
std_fixes.h \
str_util.h \
util.h
md5_test_SOURCES = md5_test.cpp md5.c md5_file.cpp
shmem_test_SOURCES = shmem_test.cpp shmem.cpp
msg_test_SOURCES = msg_test.cpp msg_queue.cpp
crypt_prog_SOURCES = crypt_prog.cpp crypt.cpp md5.c md5_file.cpp filesys.cpp
crypt_prog_DEPENDENCIES =
crypt_prog_LDADD = $(lib_LIBRARIES) $(RSA_LIBS) $(PTHREAD_LIBS)
clean-local:
rm -f @CLIENT_CMD_BIN_FILENAME@
rm -f @CLIENT_CMD_BIN_FILENAME@.unmodified
synch.h \
util.h \
$(mac_headers)
endif
lib_LTLIBRARIES = libboinc.la
libboinc_la_SOURCES = $(generic_sources) $(mac_sources)
libboinc_la_CFLAGS = $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
libboinc_la_CXXFLAGS = $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
libboinc_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
libboinc_la_LIBADD =
if ENABLE_FCGI
lib_LTLIBRARIES += libboinc_fcgi.la
libboinc_fcgi_la_SOURCES = $(generic_sources) $(mac_sources)
libboinc_fcgi_la_CFLAGS = -D_USING_FCGI_ $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
libboinc_fcgi_la_CXXFLAGS = -D_USING_FCGI_ $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
libboinc_fcgi_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
libboinc_fcgi_la_LIBADD =
endif
# end of "if ENABLE_FCGI"
if BUILD_STATIC_LIBS
all_local = libboinc.a
if ENABLE_FCGI
all_local += libboinc_fcgi.a
endif
endif
all-local: $(all_local)
libboinc.a: libboinc.la
rm -f libboinc.a
ln .libs/libboinc.a
libboinc_fcgi.a: libboinc_fcgi.la
rm -f libboinc_fcgi.a
ln .libs/libboinc_fcgi.a
endif
# end of "if ENABLE_LIBRARIES"
EXTRA_PROGRAMS = md5_test shmem_test msg_test
EXTRA_DIST = *.h *.cpp
md5_test_SOURCES = md5_test.cpp
md5_test_CXXFLAGS = $(PTHREAD_CFLAGS)
md5_test_LDADD = $(LIBBOINC)
shmem_test_SOURCES = shmem_test.cpp
shmem_test_CXXFLAGS = $(PTHREAD_CFLAGS)
shmem_test_LDADD = $(LIBBOINC)
msg_test_SOURCES = msg_test.cpp
msg_test_CXXFLAGS = $(PTHREAD_CFLAGS)
msg_test_LDADD = $(LIBBOINC)
crypt_prog_SOURCES = crypt_prog.cpp
crypt_prog_CXXFLAGS = $(PTHREAD_CFLAGS)
crypt_prog_LDADD = $(LIBBOINC) $(SSL_LIBS)
......@@ -15,6 +15,12 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#include "config.h"
#ifdef _USING_FCGI_
#include "boinc_fcgi.h"
#else
#include <cstdio>
#endif
#include "miofile.h"
#include "error_numbers.h"
#include "cert_sig.h"
......@@ -127,10 +133,13 @@ int CERT_SIGS::parse_miofile_embed(MIOFILE &mf) {
}
int CERT_SIGS::parse_file(const char* filename) {
FILE* f;
int retval;
f = fopen(filename, "r");
#ifndef _USING_FCGI_
FILE *f = fopen(filename, "r");