hyanantha               Tue Oct 29 06:24:13 2002 EDT

  Added files:                 (Branch: PHP_4_2_0)
    /php4/netware       build.bat buildext.bat buildlib.bat buildsapi.bat 
                        common.mif env.c env.h geterrnoptr.c grp.h libpq-fe.h 
                        libpq-fs.h libpq.imp mktemp.c mktemp.h param.h 
                        php-nw.bat php4apache.mak php4apache2filter.mak 
                        php4cli.mak phplib.imp phplib.mak pipe.c pipe.h 
                        postgres_ext.h pwd.c pwd.h setbuild.bat start.c 
                        sysexits.h time_nw.c time_nw.h tsrm.mak wfile.c 
                        wfile.h zend.mak 
  Log:
  NetWare related files.
  
  
Index: php4/netware/build.bat
+++ php4/netware/build.bat
@echo off

cd ..\%1

if "%2" == "clean" make -f ..\netware\%1.mak clean
if "%2" == "/?" goto USAGE

if "%1" == "zend" call ..\netware\BisonFlexZend

REM Build command
make -f ..\netware\%1.mak
goto EXIT

:USAGE
 @echo on
 @echo Usage: build moduleName [clean]
 @echo clean - delete all object files and binaries before building

:EXIT
cd ..\netware
Index: php4/netware/buildext.bat
+++ php4/netware/buildext.bat
@echo off

cd ..\ext\%1

if "%2" == "clean" make -f %1.mak clean
if "%2" == "/?" goto USAGE

REM Build command
make -f %1.mak
goto EXIT

:USAGE
 @echo on
 @echo Usage: buildext extension_name [clean]
 @echo clean - delete all object files and binaries before building

:EXIT
cd ..\..\netware

Index: php4/netware/buildlib.bat
+++ php4/netware/buildlib.bat
@echo off

cd ..

if "%1" == "clean" make -f netware\phplib.mak clean
if "%1" == "/?" goto USAGE

REM Build command
make -f netware\phplib.mak
goto EXIT

:USAGE
 @echo on
 @echo Usage: buildlib [clean]
 @echo clean - delete all object files and binaries before building

:EXIT
cd netware
Index: php4/netware/buildsapi.bat
+++ php4/netware/buildsapi.bat
@echo off

cd ..\sapi\%1

if "%2" == "clean" make -f ..\..\netware\php4%1.mak clean
if "%2" == "/?" goto USAGE

REM Build command
make -f ..\..\netware\php4%1.mak
goto EXIT

:USAGE
 @echo on
 @echo Usage: buildsapi SAPI_Module_Name [clean]
 @echo clean - delete all object files and binaries before building

:EXIT
cd ..\..\netware

Index: php4/netware/common.mif
+++ php4/netware/common.mif
#
# common include file for PHP build
# include this in every make file
#

# Set following directories based on your setting

# Path to CodeWarrior installation
CW_PATH = P:/APPS/SCRIPT/SW/CW71-4

# NWSDK directories
ifndef SDK_DIR
SDK_DIR = R:/script/common/libc-internal
endif

# MPK related directory
ifndef MPK_DIR
MPK_DIR = p:/apps/script/mpk
endif

#ifndef CLIB_DIR
#CLIB_DIR = p:/apps/ndk0601/nwsdk
#endif

# Winsock stuff
WINSOCK_DIR = P:/APPS/script/sw/Winsock2

# LDAP stuff
LDAP_DIR = P:/APPS/script/sw/cldapsdk

# Apache directory
ifndef APACHE_DIR
APACHE_DIR = $(PROJECT_ROOT)/netware/apache_1.3.22/src
endif


# CW includes, libraries and tools
export MWCIncludes=$(CW_PATH)/include
export MWLibraries=$(CW_PATH)/lib

# Compiler and linker tools
CC = mwccnlm
LINK = mwldnlm

# Build type defaults to 'release'
ifndef BUILD
BUILD = release
endif
#BUILD = debug

OBJ_DIR = $(BUILD)
FINAL_DIR = $(BUILD)
MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map

ifndef STACK_SIZE
STACK_SIZE=65536
endif

ifndef COPYRIGHT
#COPYRIGHT = "Copyright (c) 1997-2002 The PHP Group. All Rights Reserved."
COPYRIGHT = "Copyright (c) 1999\, 2000 The PHP Group. All rights reserved."
endif

# Link flags
LD_FLAGS  = -stacksize $(STACK_SIZE) -type generic -zerobss
LD_FLAGS += -o $(BINARY) -map $(MAP_FILE) -nlmversion $(VMAJ),$(VMIN),$(VREV)

# Module details
LD_FLAGS += -desc $(MODULE_DESC)
LD_FLAGS += -copy $(COPYRIGHT)
LD_FLAGS += -screenname Default
LD_FLAGS += -threadname $(MODULE_NAME)__p


Index: php4/netware/env.c
+++ php4/netware/env.c

Index: php4/netware/env.h
+++ php4/netware/env.h

Index: php4/netware/geterrnoptr.c
+++ php4/netware/geterrnoptr.c

Index: php4/netware/grp.h
+++ php4/netware/grp.h

Index: php4/netware/libpq-fe.h
+++ php4/netware/libpq-fe.h

Index: php4/netware/libpq-fs.h
+++ php4/netware/libpq-fs.h

Index: php4/netware/libpq.imp
+++ php4/netware/libpq.imp

Index: php4/netware/mktemp.c
+++ php4/netware/mktemp.c

Index: php4/netware/mktemp.h
+++ php4/netware/mktemp.h
char* mktemp(char* templateStr);

Index: php4/netware/param.h
+++ php4/netware/param.h

Index: php4/netware/php-nw.bat
+++ php4/netware/php-nw.bat
@echo off

REM CodeWarrior stuff
set path=%path%;P:\APPS\SCRIPT\SW\CW71-4\BIN

REM Cygwin stuff
set path=%path%;R:\SCRIPT\PHP\CYGWIN\BIN
set CYGWIN=R:\SCRIPT\PHP\CYGWIN

set BUILD=release


Index: php4/netware/php4apache.mak
+++ php4/netware/php4apache.mak
# Temporarily here -- later may go into some batch file
# which will set this as an environment variable
PROJECT_ROOT = ../..

# Module details
MODULE_NAME = mod_php
MODULE_DESC = "PHP 4.x.x for NetWare - mod_php"
VMAJ = 0
VMIN = 90
VREV = 0

#include the common settings
include $(PROJECT_ROOT)/netware/common.mif

# Extensions of all input and output files
SUFFIXES:
SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d

# Source files
C_SRC = mod_php4.c \
        php_apache.c \
        sapi_apache.c

# Destination directories and files
OBJ_DIR = $(BUILD)
FINAL_DIR = $(BUILD)
MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map
OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC:.cpp=.obj) $(C_SRC:.c=.obj))
DEPDS  = $(addprefix $(OBJ_DIR)/,$(CPP_SRC:.cpp=.d) $(C_SRC:.c=.d))

# Binary file
ifndef BINARY
BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm
endif


# Compile flags
C_FLAGS  = -c -maxerrors 25 -msgstyle gcc
C_FLAGS += -wchar_t on -bool on
C_FLAGS += -processor Pentium -align 1
C_FLAGS += -w nounusedarg -msext on
C_FLAGS += -nostdinc
C_FLAGS += -DNETWARE -D__GNUC__
C_FLAGS += -DZTS
C_FLAGS += -DNLM_PLATFORM
C_FLAGS += -DN_PLAT_NLM -DNLM=1 -D__NO_MATH_OPS
C_FLAGS += -D__C9X_CMATH_INLINES_DEFINED -DAPACHE_OS_H -DNO_USE_SIGACTION -DMULTITHREAD
C_FLAGS += -DCLIB_STAT_PATCH
C_FLAGS += -DNEW_LIBC
#C_FLAGS  += -DUSE_WINSOCK_DIRECTLY=1
C_FLAGS += -I. -I- -I. -I../../netware -I$(SDK_DIR)/include     # ../../netware added 
for special SYS/STAT.H
C_FLAGS += -I$(MWCIncludes)
C_FLAGS += -I$(APACHE_DIR)/include -I$(APACHE_DIR)/os/netware
C_FLAGS += -I- -I../../main -I../../Zend -I../../TSRM -I../../ext/standard
C_FLAGS += -I../../ -I../../netware -I$(PROJECT_ROOT)/regex
C_FLAGS += -I$(WINSOCK_DIR)/include/nlm -I$(WINSOCK_DIR)/include


# Extra stuff based on debug / release builds
ifeq '$(BUILD)' 'debug'
        SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym
        C_FLAGS  += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym 
internal -DDEBUGGING -DDKFBPON
        C_FLAGS += -r -DZEND_DEBUG
        C_FLAGS += -exc cw
        LD_FLAGS += -sym on -sym codeview4 -sym internal -osym $(SYM_FILE) 
        LD_FLAGS += -msgstyle std
        export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib
else
        C_FLAGS  += -opt speed -inline on -inline smart -inline auto -sym off 
-DZEND_DEBUG=0
        C_FLAGS += -opt intrinsics
        C_FLAGS += -opt level=4
        LD_FLAGS += -sym off
        export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib
endif

# Dependencies
MODULE = LibC \
         phplib
IMPORT = @$(SDK_DIR)/imports/libc.imp            \
         @$(APACHE_DIR)/os/netware/apachecore.imp \
         @$(PROJECT_ROOT)/netware/phplib.imp
EXPORT = php4_module


# Virtual paths
vpath %.cpp .
vpath %.c .
vpath %.obj $(OBJ_DIR)


all: prebuild project

PHONY: all

prebuild:
        @if not exist $(OBJ_DIR) md $(OBJ_DIR)

project: $(BINARY) $(MESSAGE)
        @echo Build complete.


$(OBJ_DIR)/%.d: %.c
        @echo Building Dependencies for $(<F)
        @$(CC) -M $< $(C_FLAGS) -o $@

$(OBJ_DIR)/%.obj: %.c
        @echo Compiling $?...
        @$(CC) $< $(C_FLAGS) -o $@


$(BINARY): $(DEPDS) $(OBJECTS)
        @echo Import $(IMPORT) > $(basename $@).def
ifdef API
        @echo Import $(API) >> $(basename $@).def
endif
        @echo Module $(MODULE) >> $(basename $@).def
ifdef EXPORT
        @echo Export $(EXPORT) >> $(basename $@).def
endif
        @echo AutoUnload >> $(basename $@).def
ifeq '$(BUILD)' 'debug'
        @echo Debug >> $(basename $@).def
endif
        @echo Flag_On 0x00000008 >> $(basename $@).def
        @echo Start _lib_start >> $(basename $@).def
        @echo Exit _lib_stop >> $(basename $@).def

        @echo Linking $@...
        @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link
ifdef LIBRARY
        @echo $(LIBRARY) >> $(basename $@).link
endif
        @echo $(OBJECTS) $(APACHE_DIR)/os/netware/libpre.obj >> $(basename $@).link

        @$(LINK) @$(basename $@).link


PHONY: clean
clean: cleand cleanobj cleanbin

PHONY: cleand
cleand:
        @echo Deleting all dependency files...
        -@del "$(OBJ_DIR)\*.d"

PHONY: cleanobj
cleanobj:
        @echo Deleting all object files...
        -@del "$(OBJ_DIR)\*.obj"

PHONY: cleanbin
cleanbin:
        @echo Deleting binary files...
        -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm"
        @echo Deleting MAP, DEF files, etc....
        -@del "$(FINAL_DIR)\$(MODULE_NAME).map"
        -@del "$(FINAL_DIR)\$(MODULE_NAME).def"
        -@del "$(FINAL_DIR)\$(MODULE_NAME).link"
ifeq '$(BUILD)' 'debug'
        -@del $(FINAL_DIR)\$(MODULE_NAME).sym
endif

Index: php4/netware/php4apache2filter.mak
+++ php4/netware/php4apache2filter.mak

Index: php4/netware/php4cli.mak
+++ php4/netware/php4cli.mak

Index: php4/netware/phplib.imp
+++ php4/netware/phplib.imp
_array_init,
_convert_to_string,
_efree,
_emalloc,
_estrdup,
_estrndup,
_object_init,
_object_init_ex,
_persist_alloc,
_zend_get_parameters_array,
_zend_list_addref,
_zend_list_delete,
_zend_list_find,
_zval_copy_ctor,
_zval_dtor,
add_assoc_long_ex,
add_index_null,
add_index_long,
add_assoc_string_ex,
add_assoc_stringl_ex,
add_assoc_null_ex,
add_index_string,
add_index_stringl,
add_next_index_bool,
add_next_index_long,
add_next_index_string,
add_next_index_stringl,
add_property_long_ex,
add_property_string_ex,
compiler_globals_id,
convert_to_boolean,
convert_to_long,
core_globals_id,
display_ini_entries,
display_link_numbers,
empty_string,
executor_globals_id,
expand_filepath,
get_zend_version,
get_active_function_name,
highlight_file,
le_index_ptr,
module_registry,
open_file_for_scanning,
_object_and_properties_init,
php_addslashes,
php_execute_script,
php_fopen_primary_script,
php_handle_aborted_connection,
php_body_write,
php_end_ob_buffers,
php_get_current_user,
php_get_highlight_struct,
php_header,
php_header_write,
php_import_environment_variables,
php_info_print_table_end,
php_info_print_table_colspan_header,
php_info_print_table_header,
php_info_print_table_row,
php_info_print_table_start,
php_lint_script,
php_module_shutdown,
php_module_shutdown_for_exec,
php_module_shutdown_wrapper,
php_module_startup,
php_output_activate,
php_output_set_status,
php_output_startup,
php_print_info,
php_printf,
php_register_variable,
php_request_shutdown,
php_request_shutdown_for_exec,
php_request_startup,
php_strlcpy,
php_strtolower,
sapi_get_default_content_type,
sapi_globals_id,
sapi_shutdown,
sapi_startup,
ts_allocate_id,
ts_resource_ex,
tsrm_shutdown,
tsrm_startup,
virtual_fopen,
zend_alter_ini_entry,
zend_error,
zend_execute_scripts,
zend_fetch_resource,
zend_get_parameters_ex,
zend_hash_add_or_update,
zend_hash_apply,
zend_hash_apply_with_argument,
zend_hash_del_key_or_index,
zend_hash_destroy,
zend_hash_exists,
zend_hash_find,
zend_hash_get_current_key_ex,
zend_hash_get_current_data_ex,
zend_hash_index_find,
zend_hash_index_update_or_next_insert,
zend_hash_init,
zend_hash_internal_pointer_reset_ex
zend_hash_merge_ex,
zend_hash_move_forward_ex,
zend_hash_num_elements,
zend_highlight,
zend_ini_deactivate,
zend_ini_boolean_displayer_cb,
zend_list_insert,
zend_llist_add_element,
zend_llist_apply,
zend_llist_destroy,
zend_llist_init,
zend_load_extension,
zend_parse_parameters,
zend_printf,
zend_register_ini_entries,
zend_register_internal_class,
zend_register_list_destructors_ex,
zend_register_long_constant,
zend_register_resource,
zend_startup_module,
zend_standard_class_def,
zend_unregister_ini_entries,
zend_wrong_param_count,
OnUpdateInt,
OnUpdateString,
OnUpdateStringUnempty

Index: php4/netware/phplib.mak
+++ php4/netware/phplib.mak
# Temporarily here -- later may go into some batch file
# which will set this as an environment variable
PROJECT_ROOT = .

# Module details
MODULE_NAME = phplib
MODULE_DESC = "PHP 4.0.8 for NetWare (Beta) - PHP Library"
VMAJ = 0
VMIN = 60
VREV = 1

#include the common settings
include $(PROJECT_ROOT)/netware/common.mif


# Extensions of all input and output files
SUFFIXES:
SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d

# Source files
C_SRC = ext/bcmath/bcmath.c \
        ext/bcmath/libbcmath/src/add.c \
        ext/bcmath/libbcmath/src/compare.c \
        ext/bcmath/libbcmath/src/debug.c \
        ext/bcmath/libbcmath/src/div.c \
        ext/bcmath/libbcmath/src/divmod.c \
        ext/bcmath/libbcmath/src/doaddsub.c \
        ext/bcmath/libbcmath/src/init.c \
        ext/bcmath/libbcmath/src/int2num.c \
        ext/bcmath/libbcmath/src/nearzero.c \
        ext/bcmath/libbcmath/src/neg.c \
        ext/bcmath/libbcmath/src/num2long.c \
        ext/bcmath/libbcmath/src/num2str.c \
        ext/bcmath/libbcmath/src/outofmem.c \
        ext/bcmath/libbcmath/src/output.c \
        ext/bcmath/libbcmath/src/raise.c \
        ext/bcmath/libbcmath/src/raisemod.c \
        ext/bcmath/libbcmath/src/recmul.c \
        ext/bcmath/libbcmath/src/rmzero.c \
        ext/bcmath/libbcmath/src/rt.c \
        ext/bcmath/libbcmath/src/sqrt.c \
        ext/bcmath/libbcmath/src/str2num.c \
        ext/bcmath/libbcmath/src/sub.c \
        ext/bcmath/libbcmath/src/zero.c \
        ext/calendar/cal_unix.c \
        ext/calendar/calendar.c \
        ext/calendar/dow.c \
        ext/calendar/easter.c \
        ext/calendar/french.c \
        ext/calendar/gregor.c \
        ext/calendar/jewish.c \
        ext/calendar/julian.c \
        ext/ftp/ftp.c \
        ext/ftp/php_ftp.c \
        ext/mcal/php_mcal.c \
        ext/pcre/php_pcre.c \
        ext/pcre/pcrelib/chartables.c \
        ext/pcre/pcrelib/get.c \
        ext/pcre/pcrelib/maketables.c \
        ext/pcre/pcrelib/pcre.c \
        ext/pcre/pcrelib/study.c \
        ext/session/mod_files.c \
        ext/session/mod_user.c \
        ext/session/session.c \
        ext/snmp/snmp.c \
        ext/standard/array.c \
        ext/standard/assert.c \
        ext/standard/base64.c \
        ext/standard/basic_functions.c \
        ext/standard/browscap.c \
        ext/standard/crc32.c \
        ext/standard/credits.c \
        ext/standard/cyr_convert.c \
        ext/standard/datetime.c \
        ext/standard/dir.c \
        ext/standard/dl.c \
        ext/standard/dns.c \
        ext/standard/exec.c \
        ext/standard/file.c \
        ext/standard/filestat.c \
        ext/standard/flock_compat.c \
        ext/standard/formatted_print.c \
        ext/standard/fsock.c \
        ext/standard/ftp_fopen_wrapper.c \
        ext/standard/head.c \
        ext/standard/html.c \
        ext/standard/http_fopen_wrapper.c \
        ext/standard/image.c \
        ext/standard/incomplete_class.c \
        ext/standard/info.c \
        ext/standard/iptc.c \
        ext/standard/lcg.c \
        ext/standard/levenshtein.c \
        ext/standard/link.c \
        ext/standard/mail.c \
        ext/standard/math.c \
        ext/standard/md5.c \
        ext/standard/metaphone.c \
        ext/standard/microtime.c \
        ext/standard/pack.c \
        ext/standard/pageinfo.c \
        ext/standard/parsedate.c \
        ext/standard/php_fopen_wrapper.c \
        ext/standard/quot_print.c \
        ext/standard/rand.c \
        ext/standard/reg.c \
        ext/standard/scanf.c \
        ext/standard/soundex.c \
        ext/standard/string.c \
        ext/standard/strnatcmp.c \
        ext/standard/type.c \
        ext/standard/uniqid.c \
        ext/standard/url.c \
        ext/standard/url_scanner.c \
        ext/standard/url_scanner_ex.c \
        ext/standard/var.c \
        main/fopen_wrappers.c \
        main/internal_functions_nw.c \
        main/main.c \
        main/mergesort.c \
        main/network.c \
        main/output.c \
        main/php_content_types.c \
        main/php_ini.c \
        main/php_logos.c \
        main/php_open_temporary_file.c \
        main/php_ticks.c \
        main/php_variables.c \
        main/reentrancy.c \
        main/rfc1867.c \
        main/safe_mode.c \
        main/SAPI.c \
        main/snprintf.c \
        main/strlcat.c \
        main/strlcpy.c \
        netware/env.c \
        netware/geterrnoptr.c \
        netware/mktemp.c \
        netware/pipe.c \
        netware/pwd.c \
        netware/sendmail.c \
        netware/start.c \
        netware/wfile.c \
        regex/regcomp.c \
        regex/regerror.c \
        regex/regexec.c \
        regex/regfree.c \
#        ext/standard/crypt.c \
#        ext/xml/xml.c \
#        ext/com/COM.c \
#        ext/com/conversion.c \
#        ext/ldap/ldap.c \
#        ext/odbc/php_odbc.c \
#        ext/snmp/winsnmp.c \
#        netware/winutil.c \
#        ext/mysql/php_mysql.c \
#        ext/standard/syslog.c \
#        netware/registry.c \
#        netware/time_nw.c \
#        netware/wsyslog.c
#        ext/xml/expat/xmlparse/hashtable.c \
#        ext/xml/expat/xmlparse/xmlparse.c \
#        ext/xml/expat/xmltok/xmlrole.c \
#        ext/xml/expat/xmltok/xmltok.c \
#        ext/xml/expat/xmltok/xmltok_impl.c \
#        ext/xml/expat/xmltok/xmltok_ns.c \
#        ext/wddx/wddx.c \
#        netware/readdir.c \


CPP_SRC_NODIR = $(notdir $(CPP_SRC))
C_SRC_NODIR = $(notdir $(C_SRC))
SRC_DIR = $(dir $(CPP_SRC) $(C_SRC))

# Library files
LIBRARY  = $(PROJECT_ROOT)/Zend/$(BUILD)/Zend.lib 
$(PROJECT_ROOT)/TSRM/$(BUILD)/TSRM.lib
LIBRARY += $(PROJECT_ROOT)/win32build/lib/resolv.lib
#LIBRARY += libmysql.lib

# Destination directories and files
OBJ_DIR = $(BUILD)
FINAL_DIR = $(BUILD)
MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map
OBJECTS  = $(join $(SRC_DIR), $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) 
$(C_SRC_NODIR:.c=.obj)))
DEPDS  = $(join $(SRC_DIR), $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) 
$(C_SRC_NODIR:.c=.d)))

# Binary file
ifndef BINARY
        BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm
endif

# Compile flags
C_FLAGS += -c -maxerrors 25 -msgstyle gcc
C_FLAGS += -wchar_t on -bool on
C_FLAGS += -processor Pentium
C_FLAGS += -nostdinc -nosyspath
C_FLAGS  += -DNETWARE -D__BIT_TYPES_DEFINED__ -DZTS
#C_FLAGS  += -DZEND_DEBUG
C_FLAGS  += -DPHP4DLLTS_EXPORTS -DPHP_EXPORTS -DLIBZEND_EXPORTS -DTSRM_EXPORTS 
-DSAPI_EXPORTS
C_FLAGS  += -DHAVE_SYS_TIME_H -DHAVE_STRUCT_FLOCK -DVIRTUAL_DIR -DHAVE_TZNAME
C_FLAGS  += -DHAVE_DLFCN_H -DHAVE_LIBDL
#C_FLAGS  += -DCOMPILE_DL_LDAP
C_FLAGS  += -DNEW_LIBC -DHAVE_ARPA_INET_H=1 -DHAVE_NETINET_IN_H=1 -DHAVE_INET_ATON=1
#C_FLAGS  += -DUSE_WINSOCK -DUSE_WINSOCK_DIRECTLY=1
C_FLAGS  += -I. -Imain -Inetware -Iregex -I./bindlib_w32 -IZend -ITSRM
C_FLAGS  += -Iext/standard -Iext/mcal -Iext/pcre -Iext/pcre/pcrelib
C_FLAGS  += -Iext/bcmath -Iext/bcmath/libbcmath/src
#C_FLAGS  += -Iext/ldap
C_FLAGS  += -Iext/xml -Iext/xml/expat/xmltok -Iext/xml/expat -Iext/xml/expat/xmlparse
C_FLAGS  += -Iext/odbc -Iext/session -Iext/ftp -Iext/wddx -Iext/calendar -Iext/snmp
#C_FLAGS  += -Iext/mysql -Iext/mysql/libmysql
#C_FLAGS  += -I- -Inetware -I$(SDK_DIR)/sdk -I$(MWCIncludes)    # netware added for 
special SYS/STAT.H : Venkat(6/2/02)
C_FLAGS  += -I- -Inetware -I$(SDK_DIR)/include -I$(MWCIncludes) # netware added for 
special SYS/STAT.H : Venkat(6/2/02)

C_FLAGS  += -I$(SDK_DIR)/include/winsock        # Added for socket calls : Ananth (16 
Aug 2002)

#C_FLAGS  += -I$(LDAP_DIR)/inc


# Extra stuff based on debug / release builds
ifeq '$(BUILD)' 'debug'
        SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym
        C_FLAGS  += -inline smart -sym on -sym codeview4 -sym internal -opt off -opt 
intrinsics 
        C_FLAGS += -D_DEBUG -DZEND_DEBUG=1  #-r
        LD_FLAGS += -sym codeview4 -sym internal -osym $(SYM_FILE) 
        export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib
else
        C_FLAGS  += -opt speed -inline on -inline auto -sym off -DZEND_DEBUG=0
        LD_FLAGS += -sym off
        export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib
endif

# Dependencies
MODULE = LibC
IMPORT = @$(SDK_DIR)/imports/libc.imp   \
         @$(SDK_DIR)/imports/ws2nlm.imp \
         @$(MPK_DIR)/import/mpkOrg.imp
EXPORT = @$(PROJECT_ROOT)/netware/phplib.imp
API = NXGetEnvCount \
      NXCopyEnv \
      OutputToScreen \
      bsd_fd_set


# Virtual paths
vpath %.cpp .
vpath %.c .
vpath %.obj $(OBJ_DIR)


all: prebuild project

PHONY: all

prebuild:
        @if not exist main\$(OBJ_DIR)                     md main\$(OBJ_DIR)
        @if not exist regex\$(OBJ_DIR)                    md regex\$(OBJ_DIR)
        @if not exist bindlib_w32\$(OBJ_DIR)              md bindlib_w32\$(OBJ_DIR)
        @if not exist netware\$(OBJ_DIR)                  md netware\$(OBJ_DIR)
        @if not exist ext\standard\$(OBJ_DIR)             md ext\standard\$(OBJ_DIR)
        @if not exist ext\bcmath\$(OBJ_DIR)               md ext\bcmath\$(OBJ_DIR)
        @if not exist ext\bcmath\libbcmath\src\$(OBJ_DIR) md 
ext\bcmath\libbcmath\src\$(OBJ_DIR)
        @if not exist ext\mcal\$(OBJ_DIR)                 md ext\mcal\$(OBJ_DIR)
        @if not exist ext\mysql\$(OBJ_DIR)                md ext\mysql\$(OBJ_DIR)
        @if not exist ext\mysql\libmysql\$(OBJ_DIR)       md 
ext\mysql\libmysql\$(OBJ_DIR)
        @if not exist ext\pcre\$(OBJ_DIR)                 md ext\pcre\$(OBJ_DIR)
        @if not exist ext\pcre\pcrelib\$(OBJ_DIR)         md 
ext\pcre\pcrelib\$(OBJ_DIR)
        @if not exist ext\odbc\$(OBJ_DIR)                 md ext\odbc\$(OBJ_DIR)
        @if not exist ext\xml\$(OBJ_DIR)                  md ext\xml\$(OBJ_DIR)
        @if not exist ext\xml\expat\xmlparse\$(OBJ_DIR)   md 
ext\xml\expat\xmlparse\$(OBJ_DIR)
        @if not exist ext\xml\expat\xmltok\$(OBJ_DIR)     md 
ext\xml\expat\xmltok\$(OBJ_DIR)
        @if not exist ext\session\$(OBJ_DIR)              md ext\session\$(OBJ_DIR)
        @if not exist ext\ftp\$(OBJ_DIR)                  md ext\ftp\$(OBJ_DIR)
#       @if not exist ext\ldap\$(OBJ_DIR)                 md ext\ldap\$(OBJ_DIR)
        @if not exist ext\wddx\$(OBJ_DIR)                 md ext\wddx\$(OBJ_DIR)
        @if not exist ext\calendar\$(OBJ_DIR)             md ext\calendar\$(OBJ_DIR)
        @if not exist ext\snmp\$(OBJ_DIR)                 md ext\snmp\$(OBJ_DIR)
        @if not exist $(FINAL_DIR)                        md $(FINAL_DIR)

project: $(BINARY) $(MESSAGE)
        @echo Build complete.

%.d: ../%.c
        @echo Building Dependencies for $(<F)
        @$(CC) -M $< $(C_FLAGS) -o $@
        
%.obj: ../%.c
        @echo Compiling $?...
# writing the flags to a file. Otherwise fails on win95 due too many characters in 
command line.
        @echo $(wordlist 1, 20, $(C_FLAGS)) > $(basename $(OBJ_DIR)\$(notdir $@)).cfg
        @echo $(wordlist 21, 40, $(C_FLAGS)) >> $(basename $(OBJ_DIR)\$(notdir $@)).cfg
        @echo $(wordlist 41, 60, $(C_FLAGS)) >> $(basename $(OBJ_DIR)\$(notdir $@)).cfg
        @echo $(wordlist 61, 80, $(C_FLAGS)) >> $(basename $(OBJ_DIR)\$(notdir $@)).cfg
        @$(CC) $< @$(basename $(OBJ_DIR)\$(notdir $@)).cfg -o $@ 
        @del $(basename $(OBJ_DIR)\$(notdir $@)).cfg
#       @$(CC) $< $(C_FLAGS) -o $@


#$(BINARY): $(DEPDS) $(OBJECTS) $(LIBRARY)
$(BINARY): $(OBJECTS) $(LIBRARY)
        @echo Import $(IMPORT) > $(basename $@).def
ifdef API
        @echo Import $(API) >> $(basename $@).def
endif
        @echo Module $(MODULE) >> $(basename $@).def
ifdef EXPORT
        @echo Export $(EXPORT) >> $(basename $@).def
endif
        @echo AutoUnload >> $(basename $@).def
ifeq '$(BUILD)' 'debug'
        @echo Debug >> $(basename $@).def
endif
        @echo Flag_On 0x00000008 >> $(basename $@).def
        @echo Start _NonAppStart >> $(basename $@).def
        @echo Exit _NonAppStop >> $(basename $@).def

        $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc
        @echo xdcdata $(basename $@).xdc >> $(basename $@).def

        @echo Linking $@...
        @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link
ifdef LIBRARY
        @echo $(LIBRARY) >> $(basename $@).link
endif
        @echo $(wordlist   1,  10, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist  11,  20, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist  21,  30, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist  31,  40, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist  41,  50, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist  51,  60, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist  61, 70, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 71, 80, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 81, 85, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 86, 90, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 91, 95, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 96, 100, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 101, 105, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 106, 110, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 111, 115, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 116, 120, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 121, 125, $(OBJECTS)) >> $(basename $@).link
        @echo $(wordlist 126, 127, $(OBJECTS)) >> $(basename $@).link
#       @echo $(wordlist 126, 134, $(OBJECTS)) >> $(basename $@).link

        @$(LINK) @$(basename $@).link


PHONY: clean
clean: cleand cleanobj cleanbin

PHONY: cleand
cleand:
        @echo Deleting all dependency files...
        -@del "main\$(OBJ_DIR)\*.d"
        -@del "regex\$(OBJ_DIR)\*.d"
        -@del "..\bindlib_w32\$(OBJ_DIR)\*.d"
        -@del "netware\$(OBJ_DIR)\*.d"
        -@del "ext\standard\$(OBJ_DIR)\*.d"
        -@del "ext\bcmath\$(OBJ_DIR)\*.d"
        -@del "ext\bcmath\libbcmath\src\$(OBJ_DIR)\*.d"
#       -@del "ext\ldap\$(OBJ_DIR)\*.d"
        -@del "ext\mcal\$(OBJ_DIR)\*.d"
        -@del "ext\mysql\$(OBJ_DIR)\*.d"
        -@del "ext\mysql\libmysql\$(OBJ_DIR)\*.d"
        -@del "ext\pcre\$(OBJ_DIR)\*.d"
        -@del "ext\pcre\pcrelib\$(OBJ_DIR)\*.d"
        -@del "ext\odbc\$(OBJ_DIR)\*.d"
        -@del "ext\xml\$(OBJ_DIR)\*.d"
        -@del "ext\xml\expat\xmlparse\$(OBJ_DIR)\*.d"
        -@del "ext\xml\expat\xmltok\$(OBJ_DIR)\*.d"
        -@del "ext\session\$(OBJ_DIR)\*.d"
        -@del "ext\ftp\$(OBJ_DIR)\*.d"
        -@del "ext\wddx\$(OBJ_DIR)\*.d"
        -@del "ext\calendar\$(OBJ_DIR)\*.d"
        -@del "ext\snmp\$(OBJ_DIR)\*.d"

PHONY: cleanobj
cleanobj:
        @echo Deleting all object files...
        -@del "main\$(OBJ_DIR)\*.obj"
        -@del "regex\$(OBJ_DIR)\*.obj"
        -@del "..\bindlib_w32\$(OBJ_DIR)\*.obj"
        -@del "netware\$(OBJ_DIR)\*.obj"
        -@del "ext\standard\$(OBJ_DIR)\*.obj"
        -@del "ext\bcmath\$(OBJ_DIR)\*.obj"
        -@del "ext\bcmath\libbcmath\src\$(OBJ_DIR)\*.obj"
#       -@del "ext\ldap\$(OBJ_DIR)\*.obj"
        -@del "ext\mcal\$(OBJ_DIR)\*.obj"
        -@del "ext\mysql\$(OBJ_DIR)\*.obj"
        -@del "ext\mysql\libmysql\$(OBJ_DIR)\*.obj"
        -@del "ext\pcre\$(OBJ_DIR)\*.obj"
        -@del "ext\pcre\pcrelib\$(OBJ_DIR)\*.obj"
        -@del "ext\odbc\$(OBJ_DIR)\*.obj"
        -@del "ext\xml\$(OBJ_DIR)\*.obj"
        -@del "ext\xml\expat\xmlparse\$(OBJ_DIR)\*.obj"
        -@del "ext\xml\expat\xmltok\$(OBJ_DIR)\*.obj"
        -@del "ext\session\$(OBJ_DIR)\*.obj"
        -@del "ext\ftp\$(OBJ_DIR)\*.obj"
        -@del "ext\wddx\$(OBJ_DIR)\*.obj"
        -@del "ext\calendar\$(OBJ_DIR)\*.obj"
        -@del "ext\snmp\$(OBJ_DIR)\*.obj"

PHONY: cleanbin
cleanbin:
        @echo Deleting binary files...
        -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm"
        @echo Deleting MAP, DEF files, etc....
        -@del "$(FINAL_DIR)\$(MODULE_NAME).map"
        -@del "$(FINAL_DIR)\$(MODULE_NAME).def"
        -@del "$(FINAL_DIR)\$(MODULE_NAME).link"
ifeq '$(BUILD)' 'debug'
        -@del $(FINAL_DIR)\$(MODULE_NAME).sym
endif

Index: php4/netware/pipe.c
+++ php4/netware/pipe.c

Index: php4/netware/pipe.h
+++ php4/netware/pipe.h

Index: php4/netware/postgres_ext.h
+++ php4/netware/postgres_ext.h

Index: php4/netware/pwd.c
+++ php4/netware/pwd.c

Index: php4/netware/pwd.h
+++ php4/netware/pwd.h
/*  pwd.h - Try to approximate UN*X's getuser...() functions under MS-DOS.
   Copyright (C) 1990 by Thorsten Ohl, [EMAIL PROTECTED]

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 1, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

 */

/* This 'implementation' is conjectured from the use of this functions in
   the RCS and BASH distributions.  Of course these functions don't do too
   much useful things under MS-DOS, but using them avoids many "#ifdef
   MSDOS" in ported UN*X code ...  */

#ifndef PWD_H
#define PWD_H

/*
    Not available in LibC / SDK header or CodeWarrior header files; so taking from 
Winsock
    definitions, which should be OK
*/
typedef unsigned int DWORD;

struct passwd {
        char *pw_name;                          /* user name */
        char *pw_passwd;                        /* encrypted password */
        int pw_uid;                                     /* user uid */
        int pw_gid;                                     /* user gid */
        char *pw_comment;                       /* comment */
        char *pw_gecos;                         /* Honeywell login info */
        char *pw_dir;                           /* home directory */
        char *pw_shell;                         /* default shell */
};

extern struct passwd *getpwuid(int);
extern struct passwd *getpwnam(char *name);
extern char *getlogin(void);

#endif

Index: php4/netware/setbuild.bat
+++ php4/netware/setbuild.bat
@echo off

if "%1" == "/?" goto USAGE

if "%1" == "d" set BUILD=debug
if "%1" == "r" set BUILD=release

if "%2" == "1" set APACHE_VER=1.3
if "%2" == "2" set APACHE_VER=2

goto EXIT

:USAGE
 @echo on
 @echo Usage: setbuild d|r 1|2
 @echo set build type as 'debug' or 'release'
 @echo set Web Server as Apache 1.3.x or Apache 2.0.x

:EXIT
Index: php4/netware/start.c
+++ php4/netware/start.c
/*=============================================================================
=  CodeWarrior Stationery for Creating a NetWare Executable with NKS/LibC
=
=  Copyright (C) Unpublished Work of Novell, Inc. All Rights Reserved.
=
=  This work is an unpublished work and contains confidential, proprietary and
=  trade  secret information of Novell, Inc. Access to this work is restricted
=  to (i) Novell, Inc. employees who have a need to know how to perform  tasks
=  within  the scope of their assignments and (ii) entities other than Novell,
=  Inc. who have entered into appropriate license agreements. No part of  this
=  work may be used, practiced, performed, copied, distributed, revised, modi-
=  fied, translated, abridged, condensed, expanded, collected, compiled, link-
=  ed,  recast,  transformed  or  adapted without the prior written consent of
=  Novell, Inc. Any use or exploitation of  this  work  without  authorization
=  could subject the perpetrator to criminal and civil liability.
=
=  CodeWarrior is a trademark of Metrowerks Corporation, a Motorola Company.
=  NetWare is a trademark of Novell, Inc.
=
=  When this file is used to instantiate real source code in the CodeWarrior
=  IDE, this copyright notice should be removed and replaced with a different
=  copyright indicating ownership by the developer. Novell assumes no
=  liability for how this sample code is used or modified by any developer.
===============================================================================
*/
#include <library.h>
#include <netware.h>
#include <nks/synch.h>

void                    *gLibHandle = (void *) NULL;
rtag_t          gAllocTag = (rtag_t) NULL;
NXMutex_t       *gLibLock = (NXMutex_t *) NULL;
int gLibId=0;

int DisposeLibraryData( void    *data)
{

        return 0;
}


int _NonAppStart
(
        void                    *NLMHandle,
        void                    *errorScreen,
        const char      *cmdLine,
        const char      *loadDirPath,
        size_t          uninitializedDataLength,
        void                    *NLMFileHandle,
        int                     (*readRoutineP)( int conn, void *fileHandle, size_t 
offset,
                                                                size_t nbytes, size_t 
*bytesRead, void *buffer ),
        size_t          customDataOffset,
        size_t          customDataSize,
        int                     messageCount,
        const char      **messages
)
{
        NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0);

#pragma unused(cmdLine)
#pragma unused(loadDirPath)
#pragma unused(uninitializedDataLength)
#pragma unused(NLMFileHandle)
#pragma unused(readRoutineP)
#pragma unused(customDataOffset)
#pragma unused(customDataSize)
#pragma unused(messageCount)
#pragma unused(messages)

/*
** Here we process our command line, post errors (to the error screen),
** perform initializations and anything else we need to do before being able
** to accept calls into us. If we succeed, we return non-zero and the NetWare
** Loader will leave us up, otherwise we fail to load and get dumped.
*/
//      gAllocTag = AllocateResourceTag(NLMHandle,
//                                                              "<library-name> memory 
allocations", AllocSignature);

//      if (!gAllocTag)
//      {
//              OutputToScreen(errorScreen, "Unable to allocate resource tag for "
//                                                                                     
 "library memory allocations.\n");
//              return -1;
//      }

        gLibId = register_library(DisposeLibraryData);

        if (gLibId < -1)
        {
                OutputToScreen(errorScreen, "Unable to register library with 
kernel.\n");
                return -1;
        }

        gLibHandle = NLMHandle;

        gLibLock = NXMutexAlloc(0, 0, &liblock);

        if (!gLibLock)
        {
                OutputToScreen(errorScreen, "Unable to allocate library data lock.\n");
                return -1;
        }

        return 0;
}


void _NonAppStop( void )
{
/*
** Here we clean up any resources we allocated. Resource tags is a big part
** of what we created, but NetWare doesn't ask us to free those.
*/
        (void) unregister_library(gLibId);
        NXMutexFree(gLibLock);
}

int  _NonAppCheckUnload( void )
{
/*
** This function cannot be the first in the file for if the file is linked
** first, then the check-unload function's offset will be nlmname.nlm+0
** which is how to tell that there isn't one. When the check function is
** first in the linked objects, it is ambiguous. For this reason, we will
** put it inside this file after the stop function.
**
** Here we check to see if it's alright to ourselves to be unloaded. If not,
** we return a non-zero value. Right now, there isn't any reason not to allow
** it.
*/
        return 0;
}

Index: php4/netware/sysexits.h
+++ php4/netware/sysexits.h

Index: php4/netware/time_nw.c
+++ php4/netware/time_nw.c

Index: php4/netware/time_nw.h
+++ php4/netware/time_nw.h

Index: php4/netware/tsrm.mak
+++ php4/netware/tsrm.mak
# Temporarily here -- later may go into some batch file
# which will set this as an environment variable
PROJECT_ROOT = ..

# Module details
MODULE_NAME = TSRM

#MODULE_ROOT = $(PROJECT_ROOT)\\$(MODULE_NAME)

#include the common settings
include $(PROJECT_ROOT)/netware/common.mif

# Extensions of all input and output files
SUFFIXES:
SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d

# Source files
CPP_SRC = 
C_SRC = TSRM.c \
        tsrm_strtok_r.c \
        tsrm_virtual_cwd.c \
        tsrm_nw.c

# Destination directories and files
OBJ_DIR = $(BUILD)
FINAL_DIR = $(BUILD)
OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC:.cpp=.obj) $(C_SRC:.c=.obj))
DEPDS  = $(addprefix $(OBJ_DIR)/,$(CPP_SRC:.cpp=.d) $(C_SRC:.c=.d))

# Binary file
ifndef BINARY
        BINARY=$(FINAL_DIR)\$(MODULE_NAME).lib
endif

# Compile flags
#C_FLAGS   = -c -maxerrors 25 -processor Pentium -align packed
#C_FLAGS  += -w on -cpp_exceptions on -wchar_t off -bool on
#C_FLAGS  += -msgstyle gcc -ext obj -ARM on -msext off -ansi off -nostdinc
C_FLAGS  = -c -maxerrors 25 -msgstyle gcc
C_FLAGS += -wchar_t on -bool on
C_FLAGS += -processor Pentium -align 1
#C_FLAGS += -r
C_FLAGS += -nostdinc
#C_FLAGS +=  -ext obj
#C_FLAGS  += -DNLM_PLATFORM -D__GNUC__ -DTSRM_EXPORTS -D_LIB
C_FLAGS  += -DZTS -DNETWARE -DHAVE_DIRENT_H
C_FLAGS  += -DNEW_LIBC
#C_FLAGS  += -DUSE_PIPE_OPEN
C_FLAGS  += -DUSE_MKFIFO
C_FLAGS  += -DCLIB_STAT_PATCH -DUSE_MPK
#C_FLAGS  += -I. -I- -I../netware -I$(SDK_DIR)/sdk      # ../netware added for special 
SYS/STAT.H : Venkat(6/2/02)
C_FLAGS  += -I. -I- -I../netware -I$(SDK_DIR)/include   # ../netware added for special 
SYS/STAT.H : Venkat(6/2/02)
C_FLAGS  += -I$(MPK_DIR)/include1
C_FLAGS  += -I$(MWCIncludes)

# Link flags
LD_FLAGS  = -type library
LD_FLAGS += -o $(BINARY)

# Extra stuff based on debug / release builds
ifeq '$(BUILD)' 'debug'
        C_FLAGS  += -inline smart -sym on -sym codeview4 -sym internal -opt off -opt 
intrinsics -DTSRM_DEBUG=1
        LD_FLAGS += -sym codeview4 -sym internal
        export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib
else
        C_FLAGS  += -opt speed -inline smart -inline auto -sym off -DTSRM_DEBUG=0
        LD_FLAGS += -sym off
        export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib
endif

# Virtual paths
vpath %.cpp .
vpath %.c .
vpath %.obj $(OBJ_DIR)


all: prebuild project

PHONY: all

prebuild:
        @if not exist $(OBJ_DIR) md $(OBJ_DIR)

project: $(BINARY) $(MESSAGE)
        @echo Build complete.

$(OBJ_DIR)/%.d: %.c
        @echo Building Dependencies for $(<F)
        @$(CC) -M $< $(C_FLAGS) -o $@

$(OBJ_DIR)/%.d: %.cpp
        @echo Building Dependencies for $(<F)
        @$(CC) -M $< $(C_FLAGS) -o $@

$(OBJ_DIR)/%.obj: %.cpp
        @echo Compiling $?...
        @$(CC) $< $(C_FLAGS) -o $@
        
$(OBJ_DIR)/%.obj: %.c
        @echo Compiling $?...
        @$(CC) $< $(C_FLAGS) -o $@

$(BINARY): $(DEPDS) $(OBJECTS)
        @echo Linking $@...
        @$(LINK) $(LD_FLAGS) $(OBJECTS)


PHONY: clean
clean: cleand cleanobj cleanbin

PHONY: cleand
cleand:
        @echo Deleting all dependency files...
        -@del "$(OBJ_DIR)\*.d"

PHONY: cleanobj
cleanobj:
        @echo Deleting all object files...
        -@del "$(OBJ_DIR)\*.obj"

PHONY: cleanbin
cleanbin:
        @echo Deleting binary files...
        -@del "$(FINAL_DIR)\$(MODULE_NAME).lib"

Index: php4/netware/wfile.c
+++ php4/netware/wfile.c

Index: php4/netware/wfile.h
+++ php4/netware/wfile.h

Index: php4/netware/zend.mak
+++ php4/netware/zend.mak
# Temporarily here -- later may go into some batch file
# which will set this as an environment variable
PROJECT_ROOT = ..

# Module details
MODULE_NAME = ZEND

#MODULE_ROOT = $(PROJECT_ROOT)\\$(MODULE_NAME)

#include the common settings
include $(PROJECT_ROOT)/netware/common.mif

# Extensions of all input and output files
SUFFIXES:
SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d

# Source files
##CC_SRC = zend_ini_scanner_cc.cc \
##         zend_language_scanner_cc.cc

##CPP_SRC = zend_ini_scanner.cpp \
##          zend_language_scanner.cpp

C_SRC = zend.c \
        zend_alloc.c \
        zend_API.c \
        zend_builtin_functions.c \
        zend_compile.c \
        zend_constants.c \
        zend_dynamic_array.c \
        zend_execute.c \
        zend_execute_API.c \
        zend_extensions.c \
        zend_hash.c \
        zend_highlight.c \
        zend_indent.c \
        zend_ini.c \
        zend_list.c \
        zend_llist.c \
        zend_opcode.c \
        zend_operators.c \
        zend_ptr_stack.c \
        zend_qsort.c \
        zend_sprintf.c \
        zend_stack.c \
        zend_static_allocator.c \
        zend_variables.c \
        zend_ini_parser.c \
        zend_ini_scanner.c \
        zend_language_parser.c \
        zend_language_scanner.c


# Destination directories and files
OBJ_DIR = $(BUILD)
FINAL_DIR = $(BUILD)
OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC:.cpp=.obj) $(C_SRC:.c=.obj))
DEPDS  = $(addprefix $(OBJ_DIR)/,$(CPP_SRC:.cpp=.d) $(C_SRC:.c=.d))

# Binary file
ifndef BINARY
        BINARY=$(FINAL_DIR)\$(MODULE_NAME).lib
endif


# Compile flags

#C_FLAGS = -c -maxerrors 25 -processor Pentium -align packed
#C_FLAGS += -msgstyle gcc -ext obj -ARM on
#C_FLAGS += -cpp_exceptions on -wchar_t off -bool on -w on -ansi off -nostdinc 
-nosyspath
C_FLAGS  = -c -maxerrors 25 -msgstyle std
C_FLAGS += -wchar_t on -bool on
C_FLAGS += -processor Pentium -align 1
#C_FLAGS += -r
C_FLAGS += -nostdinc
#C_FLAGS += -nosyspath -ext obj
C_FLAGS += -D__C9X_CMATH_INLINES_DEFINED
C_FLAGS += -DNETWARE -DZTS
C_FLAGS += -DCLIB_STAT_PATCH
C_FLAGS += -DTHREAD_SWITCH
#C_FLAGS += -I. -I- -I../netware -I$(SDK_DIR)/sdk       # ../netware added for special 
SYS/STAT.H : Venkat(6/2/02)
C_FLAGS += -I. -I- -I../netware -I$(SDK_DIR)/include    # ../netware added for special 
SYS/STAT.H : Venkat(6/2/02)
C_FLAGS += -I$(MWCIncludes)

#C_FLAGS  += -lang c++ -prefix NLM_PREFIX.H
#C_FLAGS  += -ext obj -msext on -r -RTTI on

# Link flags
LD_FLAGS  = -type library
LD_FLAGS += -o $(BINARY)
#LDFLAGS += -zerobss -nofail -msgstyle gcc -nostderr


# Extra stuff based on debug / release builds
ifeq '$(BUILD)' 'debug'
        C_FLAGS  += -DZEND_DEBUG
        C_FLAGS  += -inline smart -sym on -sym codeview4 -sym internal -opt off -opt 
intrinsics
        LD_FLAGS += -sym codeview4 -sym internal
        export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib
else
        C_FLAGS  += -opt speed -inline on -inline auto -sym off
        LD_FLAGS += -sym off
        export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib
endif


# Virtual paths
vpath %.cpp .
vpath %.c .
vpath %.obj $(OBJ_DIR)


all: prebuild project

PHONY: all

prebuild:
        @if not exist $(OBJ_DIR) md $(OBJ_DIR)

project: $(BINARY) $(MESSAGE)
        @echo Build complete.


##zend_ini_parser.c zend_ini_parser.h : zend_ini_parser.y
##      @bison --output=$@ -v -d -p ini_ zend_ini_parser.y

##zend_ini_scanner.c : zend_ini_scanner.l
##      @flex -i -Pini_ -o$@ zend_ini_scanner.l

##zend_language_parser.c zend_language_parser.h : zend_language_parser.y
##      @bison --output=$@ -v -d -p zend zend_language_parser.y

##zend_language_scanner.c : zend_language_scanner.l
##      @flex -i -Pzend -o$@ zend_language_scanner.l


#zend_ini_scanner.cpp : zend_ini_scanner.l
#       @flex -+ -B -i -Sflex.skl -Pini_ -o$@ zend_ini_scanner.l

#zend_language_scanner.cpp : zend_language_scanner.l
#       @flex -+ -B -i -Sflex.skl -Pzend -o$@ zend_language_scanner.l


#$(OBJ_DIR)/%.d: %.cpp
#       @echo Building Dependencies for $(<F)
#       @$(CC) -M $< $(C_FLAGS) -o $@

$(OBJ_DIR)/%.d: %.c
        @echo Building Dependencies for $(<F)
        @$(CC) -M $< $(C_FLAGS) -o $@

#$(OBJ_DIR)/%.d: %.cc
#       @echo Building Dependencies for $(<F)
#       @$(CC) -M $< $(C_FLAGS) -o $@

#$(OBJ_DIR)/%.obj: %.cpp
#       @echo Compiling $?...
#       @$(CC) $< $(C_FLAGS) -o $@
        
$(OBJ_DIR)/%.obj: %.c
        @echo Compiling $?...
        @$(CC) $< $(C_FLAGS) -o $@

#$(OBJ_DIR)/%.obj: %.cc
#       @echo Compiling $?...
#       @$(CC) $< $(C_FLAGS) -o $@


$(BINARY): $(DEPDS) $(OBJECTS)
        @echo Linking $@...
        @$(LINK) $(LD_FLAGS) $(OBJECTS)


PHONY: clean
clean: cleansrc cleand cleanobj cleanbin

PHONY: cleansrc
cleansrc:
        @echo Deleting all generated source files...
        -@del "zend_ini_parser.c"
        -@del "zend_ini_parser.h"
        -@del "zend_ini_scanner.c"
        -@del "zend_language_parser.c"
        -@del "zend_language_parser.h"
        -@del "zend_language_scanner.c"
        -@del "zend_ini_parser.output"
        -@del "zend_language_parser.output"

#       -@del "zend_ini_scanner.cpp"
#       -@del "zend_language_scanner.cpp"


PHONY: cleand
cleand:
        @echo Deleting all dependency files...
        -@del "$(OBJ_DIR)\*.d"

PHONY: cleanobj
cleanobj:
        @echo Deleting all object files...
        -@del "$(OBJ_DIR)\*.obj"

PHONY: cleanbin
cleanbin:
        @echo Deleting binary files...
        -@del "$(FINAL_DIR)\$(MODULE_NAME).lib"
#       @echo Deleting MAP, DEF files, etc....
#       -@del "$(FINAL_DIR)\$(MODULE_NAME).map"
#       -@del "$(FINAL_DIR)\$(MODULE_NAME).def"
#       -@del "$(FINAL_DIR)\$(MODULE_NAME).link"
#ifeq '$(BUILD)' 'debug'
#       -@del $(FINAL_DIR)\$(MODULE_NAME).sym
#endif

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to