summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexey Shchepin <alexey@process-one.net>2004-04-15 19:55:38 +0000
committerAlexey Shchepin <alexey@process-one.net>2004-04-15 19:55:38 +0000
commitb542249f115761b97d21d9528d6100aaa84ea9d7 (patch)
tree41cd148ea5944fd53193f2ae93c271ae29ff1a19 /src
parent* src/idna.erl: Support for IDNA (RFC3490) (diff)
* src/ejabberd.erl: Added searching of files in code:priv_lib
(thanks to Sergei Golovan) * src/translate.erl: Likewise * src/ejabberd_app.erl: Added "log_path" configuration parameter (thanks to Sergei Golovan) * src/**/Makefile.win32: Updated (thanks to Sergei Golovan) * src/**/*.c: Updated (thanks to Sergei Golovan) * src/configure.erl: Added writing of version to Makefile.inc (thanks to Sergei Golovan) * doc/guide.tex: Updated link to expat (thanks to Sergei Golovan) SVN Revision: 223
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.win3291
-rw-r--r--src/configure.erl6
-rw-r--r--src/ejabberd.erl7
-rw-r--r--src/ejabberd_app.erl18
-rw-r--r--src/eldap/Makefile.win325
-rw-r--r--src/expat_erl.c5
-rw-r--r--src/mod_irc/Makefile.win3235
-rw-r--r--src/mod_irc/iconv_erl.c5
-rw-r--r--src/stringprep/Makefile.win3237
-rw-r--r--src/stringprep/stringprep_drv.c5
-rw-r--r--src/translate.erl18
11 files changed, 142 insertions, 90 deletions
diff --git a/src/Makefile.win32 b/src/Makefile.win32
index dff7f215..567d202f 100644
--- a/src/Makefile.win32
+++ b/src/Makefile.win32
@@ -1,9 +1,64 @@
include Makefile.inc
-EXPAT_DIR="c:\progra~1\expat-1.95.6"
+EXPAT_DIR="c:\progra~1\expat-1.95.7"
-ALL : expat_erl.dll compile-beam all-recursive
+ALL : build
+
+REL=..\release
+EREL=$(REL)\ejabberd-$(EJABBERD_VERSION)
+EBIN_DIR=$(EREL)\ebin
+MSGS_DIR=$(EREL)\msgs
+SRC_DIR=$(EREL)\src
+PRIV_DIR=$(EREL)\priv
+SO_DIR=$(PRIV_DIR)\lib
+DOC_DIR=$(EREL)\doc
+
+release_clean :
+ if exist $(REL) rd /s /q $(REL)
+
+
+release : build release_clean
+ mkdir $(REL)
+ mkdir $(EREL)
+ mkdir $(EBIN_DIR)
+ copy *.beam $(EBIN_DIR)
+ copy *.app $(EBIN_DIR)
+ mkdir $(PRIV_DIR)
+ mkdir $(SO_DIR)
+ copy *.dll $(SO_DIR)
+ mkdir $(MSGS_DIR)
+ copy msgs\*.msg $(MSGS_DIR)
+ mkdir $(SRC_DIR)
+ copy *.app $(SRC_DIR)
+ copy *.erl $(SRC_DIR)
+ copy *.hrl $(SRC_DIR)
+ copy *.c $(SRC_DIR)
+ mkdir $(SRC_DIR)\eldap
+ copy eldap\eldap.* $(SRC_DIR)\eldap
+ copy eldap\ELDAPv3.asn $(SRC_DIR)\eldap
+ mkdir $(SRC_DIR)\mod_irc
+ copy mod_irc\*.erl $(SRC_DIR)\mod_irc
+ copy mod_irc\*.c $(SRC_DIR)\mod_irc
+ mkdir $(SRC_DIR)\mod_muc
+ copy mod_muc\*.erl $(SRC_DIR)\mod_muc
+ mkdir $(SRC_DIR)\mod_pubsub
+ copy mod_pubsub\*.erl $(SRC_DIR)\mod_pubsub
+ mkdir $(SRC_DIR)\stringprep
+ copy stringprep\*.erl $(SRC_DIR)\stringprep
+ copy stringprep\*.c $(SRC_DIR)\stringprep
+ copy stringprep\*.tcl $(SRC_DIR)\stringprep
+ mkdir $(SRC_DIR)\web
+ copy web\*.erl $(SRC_DIR)\web
+ mkdir $(DOC_DIR)
+ copy ..\doc\*.html $(DOC_DIR)
+ copy ..\doc\*.png $(DOC_DIR)
+
+SOURCE = expat_erl.c
+OBJECT = expat_erl.o
+DLL = expat_erl.dll
+
+build : $(DLL) compile-beam all-recursive
all-recursive :
cd eldap
@@ -26,12 +81,10 @@ compile-beam :
CLEAN : clean-recursive clean-local
clean-local :
- -@erase expat_erl.obj
- -@erase vc60.idb
- -@erase expat_erl.dll
+ -@erase $(OBJECT)
+ -@erase $(DLL)
-@erase expat_erl.exp
-@erase expat_erl.lib
- -@erase expat_erl.pch
-@erase *.beam
clean-recursive :
@@ -49,24 +102,18 @@ clean-recursive :
nmake -nologo -f Makefile.win32 clean
cd ..
-CPP=cl.exe
-CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "$(ERLANG_DIR)\usr\include" /I "$(EI_DIR)\include" /I "$(EXPAT_DIR)\source\lib" /D "__WIN32__" /D "WIN32" /D "NDEBUG" /D "_USRDLL" /D "_MBCS" /Fpexpat_erl.pch /YX /FD /c
-
-.c.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
+distclean : release_clean clean
+ -@erase Makefile.inc
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib "$(EI_DIR)\lib\ei.lib" "$(EI_DIR)\lib\erl_interface.lib" "$(EXPAT_DIR)\libs\libexpat.lib" /nologo /subsystem:console /dll /pdb:none /machine:I386 /out:expat_erl.dll /nodefaultlib:libcmt
-LINK32_OBJS=expat_erl.obj
+CC=cl.exe
+CC_FLAGS=-nologo -D__WIN32__ -DWIN32 -DWINDOWS -D_WIN32 -DNT -MD -Ox -I"$(ERLANG_DIR)\usr\include" -I"$(EI_DIR)\include" -I"$(EXPAT_DIR)\source\lib"
-expat_erl.dll : $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
+LD=link.exe
+LD_FLAGS=-release -nologo -incremental:no -dll "$(EI_DIR)\lib\ei_md.lib" "$(EI_DIR)\lib\erl_interface_md.lib" "$(EXPAT_DIR)\libs\libexpat.lib" MSVCRT.LIB kernel32.lib advapi32.lib gdi32.lib user32.lib comctl32.lib comdlg32.lib shell32.lib
-SOURCE=expat_erl.c
+$(DLL) : $(OBJECT)
+ $(LD) $(LD_FLAGS) -out:$(DLL) $(OBJECT)
-expat_erl.obj : $(SOURCE)
+$(OBJECT) : $(SOURCE)
+ $(CC) $(CC_FLAGS) -c -Fo$(OBJECT) $(SOURCE)
diff --git a/src/configure.erl b/src/configure.erl
index fecc19c6..7bb0d278 100644
--- a/src/configure.erl
+++ b/src/configure.erl
@@ -12,10 +12,14 @@
-export([start/0]).
+-include("ejabberd.hrl").
+
start() ->
EIDirS = "EI_DIR = " ++ code:lib_dir("erl_interface") ++ "\n",
RootDirS = "ERLANG_DIR = " ++ code:root_dir() ++ "\n",
- file:write_file("Makefile.inc", list_to_binary(EIDirS ++ RootDirS)),
+ Version = "EJABBERD_VERSION = " ++ ?VERSION ++ "\n",
+ file:write_file("Makefile.inc",
+ list_to_binary(EIDirS ++ RootDirS ++ Version)),
halt().
diff --git a/src/ejabberd.erl b/src/ejabberd.erl
index 3a5c19c6..fd6e48e0 100644
--- a/src/ejabberd.erl
+++ b/src/ejabberd.erl
@@ -23,7 +23,12 @@ stop() ->
get_so_path() ->
case os:getenv("EJABBERD_SO_PATH") of
false ->
- ".";
+ case code:priv_dir(ejabberd) of
+ {error, _} ->
+ ".";
+ Path ->
+ filename:join([Path, "lib"])
+ end;
Path ->
Path
end.
diff --git a/src/ejabberd_app.erl b/src/ejabberd_app.erl
index 02d3d0f7..26b29f4b 100644
--- a/src/ejabberd_app.erl
+++ b/src/ejabberd_app.erl
@@ -51,12 +51,18 @@ init() ->
register(ejabberd, self()),
%erlang:system_flag(fullsweep_after, 0),
%error_logger:logfile({open, ?LOG_PATH}),
- LogPath = case os:getenv("EJABBERD_LOG_PATH") of
- false ->
- ?LOG_PATH;
- Path ->
- Path
- end,
+ LogPath =
+ case application:get_env(log_path) of
+ {ok, Path} ->
+ Path;
+ undefined ->
+ case os:getenv("EJABBERD_LOG_PATH") of
+ false ->
+ ?LOG_PATH;
+ Path ->
+ Path
+ end
+ end,
error_logger:add_report_handler(ejabberd_logger_h, LogPath),
%timer:apply_interval(3600000, ?MODULE, dump_ports, []),
ok = erl_ddll:load_driver(ejabberd:get_so_path(), expat_erl),
diff --git a/src/eldap/Makefile.win32 b/src/eldap/Makefile.win32
index bcffb01c..6feda635 100644
--- a/src/eldap/Makefile.win32
+++ b/src/eldap/Makefile.win32
@@ -11,7 +11,10 @@ OBJS = \
ALL : $(OBJS)
CLEAN :
- -@erase ELDAPv3.asn1db ELDAPv3.erl ELDAPv3.hrl
+ -@erase ELDAPv3.asn1db
+ -@erase ELDAPv3.erl
+ -@erase ELDAPv3.hrl
+ -@erase ELDAPv3.beam
-@erase $(OBJS)
ELDAPv3.erl : ELDAPv3.asn
diff --git a/src/expat_erl.c b/src/expat_erl.c
index 237295a9..2df857d8 100644
--- a/src/expat_erl.c
+++ b/src/expat_erl.c
@@ -243,12 +243,9 @@ ErlDrvEntry expat_driver_entry = {
NULL /* F_PTR outputv, reserved */
};
-#ifdef WIN32
-__declspec(dllexport)
-#endif
DRIVER_INIT(expat_erl) /* must match name in driver_entry */
{
- return &expat_driver_entry;
+ return &expat_driver_entry;
}
diff --git a/src/mod_irc/Makefile.win32 b/src/mod_irc/Makefile.win32
index c87bb286..f348be8d 100644
--- a/src/mod_irc/Makefile.win32
+++ b/src/mod_irc/Makefile.win32
@@ -11,15 +11,17 @@ OBJS = \
$(OUTDIR)\mod_irc.beam \
$(OUTDIR)\mod_irc_connection.beam
-ALL : $(OUTDIR)\iconv_erl.dll $(OBJS)
+SOURCE = iconv_erl.c
+OBJECT = iconv_erl.o
+DLL = $(OUTDIR)\iconv_erl.dll
+
+ALL : $(DLL) $(OBJS)
CLEAN :
- -@erase $(OUTDIR)\iconv_erl.dll
+ -@erase $(DLL)
-@erase $(OUTDIR)\iconv_erl.exp
-@erase $(OUTDIR)\iconv_erl.lib
- -@erase iconv_erl.obj
- -@erase iconv_erl.pch
- -@erase vc60.idb
+ -@erase $(OBJECT)
-@erase $(OBJS)
$(OUTDIR)\iconv.beam : iconv.erl
@@ -31,22 +33,15 @@ $(OUTDIR)\mod_irc.beam : mod_irc.erl
$(OUTDIR)\mod_irc_connection.beam : mod_irc_connection.erl
erlc -W $(EFLAGS) -o $(OUTDIR) mod_irc_connection.erl
-CPP=cl.exe
-CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "$(ERLANG_DIR)\usr\include" /I "$(EI_DIR)\include" /I "$(GNUWIN_DIR)\include" /D "__WIN32__" /D "WIN32" /D "NDEBUG" /D "_USRDLL" /D "_MBCS" /Fpiconv_erl.pch /YX /FD /c
-
-.c.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
+CC=cl.exe
+CC_FLAGS=-nologo -D__WIN32__ -DWIN32 -DWINDOWS -D_WIN32 -DNT -MD -Ox -I"$(ERLANG_DIR)\usr\include" -I"$(EI_DIR)\include" -I"$(GNUWIN_DIR)\include"
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib "$(EI_DIR)\lib\ei.lib" "$(EI_DIR)\lib\erl_interface.lib" "$(GNUWIN_DIR)\lib\libiconv.lib" /nologo /subsystem:console /dll /pdb:none /machine:I386 /out:$(OUTDIR)\iconv_erl.dll /nodefaultlib:libcmt
-LINK32_OBJS=iconv_erl.obj
+LD=link.exe
+LD_FLAGS=-release -nologo -incremental:no -dll "$(EI_DIR)\lib\ei_md.lib" "$(EI_DIR)\lib\erl_interface_md.lib" "$(GNUWIN_DIR)\lib\libiconv.lib" MSVCRT.LIB kernel32.lib advapi32.lib gdi32.lib user32.lib comctl32.lib comdlg32.lib shell32.lib
-$(OUTDIR)\iconv_erl.dll : $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
+$(DLL) : $(OBJECT)
+ $(LD) $(LD_FLAGS) -out:$(DLL) $(OBJECT)
-iconv_erl.obj : iconv_erl.c
+$(OBJECT) : $(SOURCE)
+ $(CC) $(CC_FLAGS) -c -Fo$(OBJECT) $(SOURCE)
diff --git a/src/mod_irc/iconv_erl.c b/src/mod_irc/iconv_erl.c
index 923f5cc6..5e986c01 100644
--- a/src/mod_irc/iconv_erl.c
+++ b/src/mod_irc/iconv_erl.c
@@ -105,12 +105,9 @@ ErlDrvEntry iconv_driver_entry = {
NULL /* F_PTR outputv, reserved */
};
-#ifdef WIN32
-__declspec(dllexport)
-#endif
DRIVER_INIT(iconv_erl) /* must match name in driver_entry */
{
- return &iconv_driver_entry;
+ return &iconv_driver_entry;
}
diff --git a/src/stringprep/Makefile.win32 b/src/stringprep/Makefile.win32
index 4f46efda..37e806a1 100644
--- a/src/stringprep/Makefile.win32
+++ b/src/stringprep/Makefile.win32
@@ -4,37 +4,32 @@ include ..\Makefile.inc
OUTDIR = ..
EFLAGS = -I .. -pz ..
-ALL : $(OUTDIR)\stringprep_drv.dll $(OUTDIR)\stringprep.beam
+SOURCE = stringprep_drv.c
+AUXIL = uni_data.c uni_norm.c
+OBJECT = stringprep_drv.o
+DLL = $(OUTDIR)\stringprep_drv.dll
+
+ALL : $(DLL) $(OUTDIR)\stringprep.beam
CLEAN :
- -@erase $(OUTDIR)\stringprep_drv.dll
+ -@erase $(DLL)
-@erase $(OUTDIR)\stringprep_drv.exp
-@erase $(OUTDIR)\stringprep_drv.lib
- -@erase stringprep_drv.obj
- -@erase stringprep_drv.pch
- -@erase vc60.idb
+ -@erase $(OBJECT)
-@erase $(OUTDIR)\stringprep.beam
$(OUTDIR)\stringprep.beam : stringprep.erl
erlc -W $(EFLAGS) -o $(OUTDIR) stringprep.erl
-CPP=cl.exe
-CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "$(ERLANG_DIR)\usr\include" /I "$(EI_DIR)\include" /D "__WIN32__" /D "WIN32" /D "NDEBUG" /D "_USRDLL" /D "_MBCS" /Fpstringprep_drv.pch /YX /FD /c
-
-.c.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib "$(EI_DIR)\lib\ei.lib" "$(EI_DIR)\lib\erl_interface.lib" /nologo /subsystem:console /dll /pdb:none /machine:I386 /out:$(OUTDIR)\stringprep_drv.dll /nodefaultlib:libcmt
+CC=cl.exe
+CC_FLAGS=-nologo -D__WIN32__ -DWIN32 -DWINDOWS -D_WIN32 -DNT -MD -Ox -I"$(ERLANG_DIR)\usr\include" -I"$(EI_DIR)\include"
-LINK32_OBJS=stringprep_drv.obj
+LD=link.exe
+LD_FLAGS=-release -nologo -incremental:no -dll "$(EI_DIR)\lib\ei_md.lib" "$(EI_DIR)\lib\erl_interface_md.lib" MSVCRT.LIB kernel32.lib advapi32.lib gdi32.lib user32.lib comctl32.lib comdlg32.lib shell32.lib
-$(OUTDIR)\stringprep_drv.dll : $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
+$(DLL) : $(OBJECT)
+ $(LD) $(LD_FLAGS) -out:$(DLL) $(OBJECT)
-stringprep_drv.obj : stringprep_drv.c
+$(OBJECT) : $(SOURCE) $(AUXIL)
+ $(CC) $(CC_FLAGS) -c -Fo$(OBJECT) $(SOURCE)
diff --git a/src/stringprep/stringprep_drv.c b/src/stringprep/stringprep_drv.c
index 2ae83be8..0f6826d9 100644
--- a/src/stringprep/stringprep_drv.c
+++ b/src/stringprep/stringprep_drv.c
@@ -325,11 +325,8 @@ ErlDrvEntry stringprep_driver_entry = {
NULL /* F_PTR outputv, reserved */
};
-#ifdef WIN32
-__declspec(dllexport)
-#endif
DRIVER_INIT(stringprep_erl) /* must match name in driver_entry */
{
- return &stringprep_driver_entry;
+ return &stringprep_driver_entry;
}
diff --git a/src/translate.erl b/src/translate.erl
index 63507c8c..2e7f8722 100644
--- a/src/translate.erl
+++ b/src/translate.erl
@@ -18,12 +18,18 @@
start() ->
ets:new(translations, [named_table, public]),
- Dir = case os:getenv("EJABBERD_MSGS_PATH") of
- false ->
- ?MSGS_DIR;
- Path ->
- Path
- end,
+ Dir =
+ case os:getenv("EJABBERD_MSGS_PATH") of
+ false ->
+ case code:lib_dir(ejabberd) of
+ {error, _} ->
+ ?MSGS_DIR;
+ Path ->
+ filename:join([Path, "msgs"])
+ end;
+ Path ->
+ Path
+ end,
load_dir(Dir),
ok.