--- GNUmakefile.orig	2009-05-14 07:36:05.000000000 +1000
+++ GNUmakefile	2018-04-20 21:01:25.000000000 +1000
@@ -99,10 +99,10 @@
 
 DO_SHARED=	1
 
-shlib_ext=	so.$(shlib_major).$(shlib_minor)
+shlib_ext=	dylib
 dlibrary=	lib$(libbase).$(shlib_ext)
-sharedobjargs= -shared
-sharedlibargs= -shared $(sobjs)
+sharedobjargs= 
+sharedlibargs= -dynamiclib $(sobjs) $(MP_CFLAGS) -compatibility_version 0.1 -current_version $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH) -install_name $(prefix)/lib/$(dlibrary) -L$(prefix)/lib -lssl -lcrypto -lexpat
 
 ifeq ($(arch),amd64)
 picargs=	-fPIC
@@ -116,7 +116,7 @@
 ifdef WIN32_PORT
 EXTRAINCS+=	-I$(srcdir)/ports/WIN32
 endif
-EXTRAINCS+=	-I$(prefix)/ssl/include -I/usr/kerberos/include  ${OTHERINCDIRS}
+EXTRAINCS+=	-I$(prefix)/ssl/include -I$(prefix)/include  ${OTHERINCDIRS}
 
 #
 # Below here should not need to be edited
@@ -128,7 +128,7 @@
 BASEINCS=	pd_base.h pd_io.h pd_mem.h pd_inet.h pd_poll.h pd_port.h pd_regex.h pd_string.h pd_sys.h pd_syslog.h pd_thread.h pd_time.h
 MAN=		libpdel.3 config/app_config.3 http/http_server.3 http/http_client.3 http/http_request.3 http/http_mime.3 http/http_response.3 http/http_servlet.3 http/http_xml.3 http/servlet/http_servlet_basicauth.3 http/servlet/http_servlet_cookieauth.3 http/servlet/http_servlet_file.3 http/servlet/http_servlet_redirect.3 http/servlet/http_servlet_tmpl.3 http/servlet/http_servlet_xml.3 http/servlet/http_servlet_xmlrpc.3 io/base64.3 io/boundary_fopen.3 io/count_fopen.3 io/timeout_fp.3 io/filter.3 io/string_fp.3 io/ssl_fp.3 net/domain_server.3 net/tcp_server.3 structs/structs.3 structs/structs_type.3 structs/structs_xml_input.3 structs/structs_xmlrpc.3 structs/type/structs_type_array.3 structs/type/structs_type_boolean.3 structs/type/structs_type_data.3 structs/type/structs_type_dnsname.3 structs/type/structs_type_ether.3 structs/type/structs_type_float.3 structs/type/structs_type_id.3 structs/type/structs_type_int.3 structs/type/structs_type_ip4.3 structs/type/structs_type_ip6.3 structs/type/structs_type_null.3 structs/type/structs_type_pointer.3 structs/type/structs_type_regex.3 structs/type/structs_type_string.3 structs/type/structs_type_struct.3 structs/type/structs_type_time.3 structs/type/structs_type_union.3 sys/alog.3 sys/logfile.3 tmpl/tmpl.3 util/ghash.3 util/gtree.3 util/mesg_port.3 util/paction.3 util/pevent.3 util/rsa_util_sign.3 util/string_enquote.3 util/tinfo.3 util/typed_mem.3
 MLINKS=		app_config.3 app_config_alog_subsystem.3 app_config.3 app_config_copy.3 app_config.3 app_config_curconf_subsystem.3 app_config.3 app_config_directory_subsystem.3 app_config.3 app_config_free.3 app_config.3 app_config_get.3 app_config.3 app_config_get_type.3 app_config.3 app_config_init.3 app_config.3 app_config_load.3 app_config.3 app_config_new.3 app_config.3 app_config_pidfile_subsystem.3 app_config.3 app_config_reload.3 app_config.3 app_config_set.3 app_config.3 app_config_shutting_down.3 app_config.3 app_config_uninit.3 http_server.3 http_server_start.3 http_server.3 http_server_stop.3 http_server.3 http_server_register_servlet.3 http_server.3 http_server_destroy_servlet.3 http_server.3 http_server_set_proxy_handler.3 http_client.3 http_client_close.3 http_client.3 http_client_connect.3 http_client.3 http_client_create.3 http_client.3 http_client_destroy.3 http_client.3 http_client_get_local_ip.3 http_client.3 http_client_get_local_port.3 http_client.3 http_client_get_reason.3 http_client.3 http_client_get_request.3 http_client.3 http_client_get_response.3 http_request.3 http_request_encode_basic_auth.3 http_request.3 http_request_file_upload.3 http_request.3 http_request_get_header.3 http_request.3 http_request_get_header_by_index.3 http_request.3 http_request_get_host.3 http_request.3 http_request_get_input.3 http_request.3 http_request_get_method.3 http_request.3 http_request_get_mime_multiparts.3 http_request.3 http_request_get_output.3 http_request.3 http_request_get_password.3 http_request.3 http_request_get_path.3 http_request.3 http_request_get_query_string.3 http_request.3 http_request_get_raw_socket.3 http_request.3 http_request_get_remote_ip.3 http_request.3 http_request_get_remote_port.3 http_request.3 http_request_get_ssl.3 http_request.3 http_request_get_uri.3 http_request.3 http_request_get_username.3 http_request.3 http_request_get_value.3 http_request.3 http_request_get_version.3 http_request.3 http_request_parse_time.3 http_request.3 http_request_read_mime_multipart.3 http_request.3 http_request_read_url_encoded_values.3 http_request.3 http_request_remove_header.3 http_request.3 http_request_send_headers.3 http_request.3 http_request_set_header.3 http_request.3 http_request_set_method.3 http_request.3 http_request_set_path.3 http_request.3 http_request_set_proxy.3 http_request.3 http_request_set_query_from_values.3 http_request.3 http_request_set_value.3 http_request.3 http_request_url_decode.3 http_request.3 http_request_url_encode.3 http_request.3 http_request_write_url_encoded_values.3 http_mime.3 http_mime_multipart_free.3 http_mime.3 http_mime_multipart_get_count.3 http_mime.3 http_mime_multipart_get_part.3 http_mime.3 http_mime_part_get_data.3 http_mime.3 http_mime_part_get_header.3 http_mime.3 http_mime_part_get_length.3 http_response.3 http_response_get_code.3 http_response.3 http_response_get_header.3 http_response.3 http_response_get_header_by_index.3 http_response.3 http_response_get_input.3 http_response.3 http_response_get_output.3 http_response.3 http_response_get_raw_socket.3 http_response.3 http_response_get_remote_ip.3 http_response.3 http_response_get_remote_port.3 http_response.3 http_response_get_ssl.3 http_response.3 http_response_guess_mime.3 http_response.3 http_response_no_body.3 http_response.3 http_response_num_headers.3 http_response.3 http_response_remove_header.3 http_response.3 http_response_send_basic_auth.3 http_response.3 http_response_send_error.3 http_response.3 http_response_send_headers.3 http_response.3 http_response_send_redirect.3 http_response.3 http_response_set_header.3 http_response.3 http_response_status_msg.3 http_xml.3 http_xml_send.3 http_xml.3 http_xml_send_xmlrpc.3 http_servlet_basicauth.3 http_servlet_basicauth_create.3 http_servlet_cookieauth.3 http_servlet_cookieauth_create.3 http_servlet_cookieauth.3 http_servlet_cookieauth_login.3 http_servlet_cookieauth.3 http_servlet_cookieauth_logout.3 http_servlet_cookieauth.3 http_servlet_cookieauth_user.3 http_servlet_file.3 http_servlet_file_create.3 http_servlet_file.3 http_servlet_file_serve.3 http_servlet_redirect.3 http_servlet_redirect_create.3 http_servlet_tmpl.3 http_servlet_tmpl_create.3 http_servlet_tmpl.3 http_servlet_tmpl_func_query.3 http_servlet_tmpl.3 http_servlet_tmpl_func_query_exists.3 http_servlet_tmpl.3 http_servlet_tmpl_func_query_string.3 http_servlet_tmpl.3 http_servlet_tmpl_func_get_header.3 http_servlet_tmpl.3 http_servlet_tmpl_func_set_header.3 http_servlet_tmpl.3 http_servlet_tmpl_func_remove_header.3 http_servlet_tmpl.3 http_servlet_tmpl_func_redirect.3 http_servlet_tmpl.3 http_servlet_tmpl_func_unbuffer.3 http_servlet_xml.3 http_servlet_xml_create.3 http_servlet_xmlrpc.3 http_servlet_xmlrpc_create.3 base64.3 b64_encoder_create.3 base64.3 b64_decoder_create.3 base64.3 b64_rfc2045_charset.3 timeout_fp.3 timeout_fdopen.3 filter.3 filter_read.3 filter.3 filter_write.3 filter.3 filter_end.3 filter.3 filter_convert.3 filter.3 filter_destroy.3 filter.3 filter_fopen.3 filter.3 filter_process.3 string_fp.3 string_buf_input.3 string_fp.3 string_buf_output.3 string_fp.3 string_buf_content.3 string_fp.3 string_buf_length.3 ssl_fp.3 ssl_fdopen.3 ssl_fp.3 ssl_log.3 domain_server.3 domain_connection_get_cookie.3 domain_server.3 domain_connection_get_fd.3 domain_server.3 domain_connection_get_fp.3 domain_server.3 domain_connection_get_peer.3 domain_server.3 domain_connection_get_server.3 domain_server.3 domain_server_get_cookie.3 domain_server.3 domain_server_start.3 domain_server.3 domain_server_stop.3 tcp_server.3 tcp_connection_get_cookie.3 tcp_server.3 tcp_connection_get_fd.3 tcp_server.3 tcp_connection_get_fp.3 tcp_server.3 tcp_connection_get_peer.3 tcp_server.3 tcp_connection_get_server.3 tcp_server.3 tcp_server_get_cookie.3 tcp_server.3 tcp_server_start.3 tcp_server.3 tcp_server_stop.3 structs.3 structs_equal.3 structs.3 structs_find.3 structs.3 structs_free.3 structs.3 structs_get.3 structs.3 structs_get_binary.3 structs.3 structs_get_string.3 structs.3 structs_init.3 structs.3 structs_reset.3 structs.3 structs_set.3 structs.3 structs_set_binary.3 structs.3 structs_set_string.3 structs.3 structs_traverse.3 structs_type.3 structs_ascii_copy.3 structs_type.3 structs_nothing_free.3 structs_type.3 structs_notsupp_ascify.3 structs_type.3 structs_notsupp_binify.3 structs_type.3 structs_notsupp_copy.3 structs_type.3 structs_notsupp_decode.3 structs_type.3 structs_notsupp_encode.3 structs_type.3 structs_notsupp_equal.3 structs_type.3 structs_notsupp_init.3 structs_type.3 structs_region_copy.3 structs_type.3 structs_region_decode.3 structs_type.3 structs_region_decode_netorder.3 structs_type.3 structs_region_encode.3 structs_type.3 structs_region_encode_netorder.3 structs_type.3 structs_region_equal.3 structs_type.3 structs_region_init.3 structs_xml_input.3 structs_xml_output.3 structs_xmlrpc.3 structs_struct2xmlrpc.3 structs_xmlrpc.3 structs_type_xmlrpc_array.3 structs_xmlrpc.3 structs_type_xmlrpc_compact_fault.3 structs_xmlrpc.3 structs_type_xmlrpc_fault.3 structs_xmlrpc.3 structs_type_xmlrpc_member.3 structs_xmlrpc.3 structs_type_xmlrpc_request.3 structs_xmlrpc.3 structs_type_xmlrpc_response.3 structs_xmlrpc.3 structs_type_xmlrpc_struct.3 structs_xmlrpc.3 structs_type_xmlrpc_value.3 structs_xmlrpc.3 structs_xmlrpc2struct.3 structs_xmlrpc.3 structs_xmlrpc_build_fault_response.3 structs_xmlrpc.3 structs_xmlrpc_build_request.3 structs_xmlrpc.3 structs_xmlrpc_build_response.3 structs_type_array.3 DEFINE_STRUCTS_ARRAY.3 structs_type_array.3 STRUCTS_ARRAY_TYPE.3 structs_type_array.3 STRUCTS_FIXEDARRAY_TYPE.3 structs_type_array.3 structs_array_delete.3 structs_type_array.3 structs_array_insert.3 structs_type_array.3 structs_array_length.3 structs_type_array.3 structs_array_prep.3 structs_type_array.3 structs_array_reset.3 structs_type_array.3 structs_type_fixedarray.3 structs_type_boolean.3 structs_type_boolean_char.3 structs_type_boolean.3 structs_type_boolean_int.3 structs_type_boolean.3 structs_type_boolean_char_01.3 structs_type_boolean.3 structs_type_boolean_int_01.3 structs_type_data.3 STRUCTS_DATA_TYPE.3 structs_type_data.3 STRUCTS_FIXEDDATA_TYPE.3 structs_type_data.3 structs_type_hexdata.3 structs_type_ether.3 structs_type_ether_nocolon.3 structs_type_float.3 structs_type_double.3 structs_type_id.3 STRUCTS_ID_TYPE.3 structs_type_int.3 structs_type_char.3 structs_type_int.3 structs_type_uchar.3 structs_type_int.3 structs_type_hchar.3 structs_type_int.3 structs_type_short.3 structs_type_int.3 structs_type_ushort.3 structs_type_int.3 structs_type_hshort.3 structs_type_int.3 structs_type_uint.3 structs_type_int.3 structs_type_hint.3 structs_type_int.3 structs_type_long.3 structs_type_int.3 structs_type_ulong.3 structs_type_int.3 structs_type_hlong.3 structs_type_int.3 structs_type_int8.3 structs_type_int.3 structs_type_uint8.3 structs_type_int.3 structs_type_hint8.3 structs_type_int.3 structs_type_int16.3 structs_type_int.3 structs_type_uint16.3 structs_type_int.3 structs_type_hint16.3 structs_type_int.3 structs_type_int32.3 structs_type_int.3 structs_type_uint32.3 structs_type_int.3 structs_type_hint32.3 structs_type_int.3 structs_type_int64.3 structs_type_int.3 structs_type_uint64.3 structs_type_int.3 structs_type_hint64.3 structs_type_pointer.3 STRUCTS_POINTER_TYPE.3 structs_type_regex.3 STRUCTS_REGEX_TYPE.3 structs_type_regex.3 structs_type_regex_icase.3 structs_type_string.3 STRUCTS_FIXEDSTRING_TYPE.3 structs_type_string.3 STRUCTS_STRING_TYPE.3 structs_type_string.3 structs_type_string_null.3 structs_type_struct.3 STRUCTS_STRUCT_FIELD.3 structs_type_struct.3 STRUCTS_STRUCT_FIELD2.3 structs_type_struct.3 STRUCTS_STRUCT_TYPE.3 structs_type_time.3 structs_type_time_abs.3 structs_type_time.3 structs_type_time_gmt.3 structs_type_time.3 structs_type_time_iso8601.3 structs_type_time.3 structs_type_time_local.3 structs_type_time.3 structs_type_time_rel.3 structs_type_union.3 DEFINE_STRUCTS_UNION.3 structs_type_union.3 STRUCTS_UNION_FIELD.3 structs_type_union.3 STRUCTS_UNION_TYPE.3 structs_type_union.3 structs_union_set.3 alog.3 alog_clear_history.3 alog.3 alog_configure.3 alog.3 alog_expand.3 alog.3 alog_facility.3 alog.3 alog_facility_name.3 alog.3 alog_get_history.3 alog.3 alog_set_channel.3 alog.3 alog_set_debug.3 alog.3 alog_severity.3 alog.3 alog_severity_name.3 alog.3 alog_shutdown.3 alog.3 valog.3 logfile.3 logfile_close.3 logfile.3 logfile_get.3 logfile.3 logfile_num_entries.3 logfile.3 logfile_open.3 logfile.3 logfile_put.3 logfile.3 logfile_sync.3 logfile.3 logfile_trim.3 base64.3 b64_encoder_create.3 tmpl.3 tmpl_create.3 tmpl.3 tmpl_ctx_create.3 tmpl.3 tmpl_ctx_destroy.3 tmpl.3 tmpl_ctx_reset.3 tmpl.3 tmpl_destroy.3 tmpl.3 tmpl_execute.3 tmpl.3 tmpl_execute_func.3 ghash.3 ghash_arg.3 ghash.3 ghash_create.3 ghash.3 ghash_destroy.3 ghash.3 ghash_dump.3 ghash.3 ghash_get.3 ghash.3 ghash_iter_create.3 ghash.3 ghash_iter_destroy.3 ghash.3 ghash_iter_has_next.3 ghash.3 ghash_iter_next.3 ghash.3 ghash_iter_remove.3 ghash.3 ghash_put.3 ghash.3 ghash_remove.3 ghash.3 ghash_size.3 ghash.3 ghash_walk_init.3 ghash.3 ghash_walk_next.3 gtree.3 gtree_arg.3 gtree.3 gtree_create.3 gtree.3 gtree_destroy.3 gtree.3 gtree_dump.3 gtree.3 gtree_first.3 gtree.3 gtree_get.3 gtree.3 gtree_last.3 gtree.3 gtree_next.3 gtree.3 gtree_prev.3 gtree.3 gtree_print.3 gtree.3 gtree_put.3 gtree.3 gtree_remove.3 gtree.3 gtree_size.3 gtree.3 gtree_traverse.3 mesg_port.3 mesg_port_create.3 mesg_port.3 mesg_port_destroy.3 mesg_port.3 mesg_port_get.3 mesg_port.3 mesg_port_put.3 mesg_port.3 mesg_port_qlen.3 paction.3 paction_start.3 paction.3 paction_cancel.3 pevent.3 pevent_ctx_create.3 pevent.3 pevent_ctx_destroy.3 pevent.3 pevent_ctx_count.3 pevent.3 pevent_register.3 pevent.3 pevent_unregister.3 rsa_util_sign.3 rsa_util_verify.3 rsa_util_sign.3 rsa_util_verify_priv.3 string_enquote.3 string_dequote.3 tinfo.3 TINFO_INIT.3 tinfo.3 tinfo_get.3 tinfo.3 tinfo_set.3 tinfo.3 tinfo_set_nocopy.3 typed_mem.3 ASPRINTF.3 typed_mem.3 CALLOC.3 typed_mem.3 FREE.3 typed_mem.3 MALLOC.3 typed_mem.3 REALLOC.3 typed_mem.3 REALLOCF.3 typed_mem.3 STRDUP.3 typed_mem.3 VASPRINTF.3 typed_mem.3 typed_mem_dump.3 typed_mem.3 typed_mem_enable.3 typed_mem.3 typed_mem_usage.3
-CFLAGS=		-O2 -fno-strict-aliasing -pipe -DPOSIX_MISTAKE -I$(srcdir) -I/usr/local/include -DTYPED_MEM_UNDEFINE_ORIGINALS -DBUILDING_PDEL=1 -O2 -Wall -Wcast-align -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-long-long -Wparentheses -Wpointer-arith -Wreturn-type -Wswitch -Wtrigraphs -Wuninitialized -Wunused -Wwrite-strings -g
+CFLAGS=		$(MP_CFLAGS) -fno-strict-aliasing -pipe -DPOSIX_MISTAKE -I$(srcdir) -DTYPED_MEM_UNDEFINE_ORIGINALS -DBUILDING_PDEL=1 -Wall -Wcast-align -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-long-long -Wparentheses -Wpointer-arith -Wreturn-type -Wswitch -Wtrigraphs -Wuninitialized -Wunused -Wwrite-strings -g
 SUBDIRS=	
 
 # Functional add-ons
