]> granicus.if.org Git - php/commitdiff
NetWare related additions / changes to build mod_php
authorVenkat Raghavan S <rvenkat@php.net>
Fri, 31 May 2002 04:42:02 +0000 (04:42 +0000)
committerVenkat Raghavan S <rvenkat@php.net>
Fri, 31 May 2002 04:42:02 +0000 (04:42 +0000)
netware/buildsapi.bat [new file with mode: 0755]
netware/common.mif
netware/php4apache.mak [new file with mode: 0644]
netware/phplib.imp [new file with mode: 0644]
netware/pwd.h [new file with mode: 0644]

diff --git a/netware/buildsapi.bat b/netware/buildsapi.bat
new file mode 100755 (executable)
index 0000000..57498cb
--- /dev/null
@@ -0,0 +1,18 @@
+@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 7221661d0abd513e31ed1215610588aabfe5123f..d09026fd21c2f8954cde9ee67d99ea4185e6b24e 100644 (file)
@@ -30,7 +30,7 @@ LDAP_DIR = P:/APPS/script/sw/cldapsdk
 
 # Apache directory
 ifndef APACHE_DIR
-APACHE_DIR = $(PROJECT_ROOT)/netware/apache_1.3.22/src
+APACHE_DIR = P:/APPS/script/sw/Apache1.3.xSource
 endif
 
 
diff --git a/netware/php4apache.mak b/netware/php4apache.mak
new file mode 100644 (file)
index 0000000..0fb9778
--- /dev/null
@@ -0,0 +1,161 @@
+# 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
diff --git a/netware/phplib.imp b/netware/phplib.imp
new file mode 100644 (file)
index 0000000..3c20b8b
--- /dev/null
@@ -0,0 +1,130 @@
+_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
diff --git a/netware/pwd.h b/netware/pwd.h
new file mode 100644 (file)
index 0000000..2a6ee73
--- /dev/null
@@ -0,0 +1,49 @@
+/*  pwd.h - Try to approximate UN*X's getuser...() functions under MS-DOS.
+   Copyright (C) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+
+   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