2003-01-28 20:45:13 +01:00
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
%%% File : configure.erl
|
|
|
|
%%% Author : Alexey Shchepin <alexey@sevcom.net>
|
|
|
|
%%% Purpose :
|
|
|
|
%%% Created : 27 Jan 2003 by Alexey Shchepin <alexey@sevcom.net>
|
|
|
|
%%% Id : $Id$
|
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
|
|
|
|
-module(configure).
|
|
|
|
-author('alexey@sevcom.net').
|
|
|
|
-vsn('$Revision$ ').
|
|
|
|
|
|
|
|
-export([start/0]).
|
|
|
|
|
2004-04-15 21:55:38 +02:00
|
|
|
-include("ejabberd.hrl").
|
|
|
|
|
2003-01-28 20:45:13 +01:00
|
|
|
start() ->
|
2004-04-27 22:28:23 +02:00
|
|
|
Static = case os:getenv("arg") of
|
|
|
|
false ->
|
|
|
|
false;
|
|
|
|
"static" ->
|
|
|
|
true;
|
|
|
|
_ ->
|
|
|
|
false
|
|
|
|
end,
|
|
|
|
case Static of
|
|
|
|
true ->
|
|
|
|
ExpatLib = "EXPAT_LIB = $(EXPAT_DIR)\\StaticLibs\\libexpatMT.lib\n",
|
|
|
|
ExpatFlag = "EXPAT_FLAG = -DXML_STATIC\n",
|
|
|
|
IconvDir = "ICONV_DIR = c:\\progra~1\\libiconv-1.9.1-static\n",
|
2006-02-25 20:48:17 +01:00
|
|
|
IconvLib = "ICONV_LIB = $(ICONV_DIR)\\lib\\iconv.lib\n",
|
|
|
|
ZlibDir = "ZLIB_DIR = c:\\progra~1\\zlib-1.2.3\n",
|
|
|
|
ZlibLib = "ZLIB_LIB = $(ZLIB_DIR)\\lib\\zlib.lib\n";
|
2004-04-27 22:28:23 +02:00
|
|
|
false ->
|
|
|
|
ExpatLib = "EXPAT_LIB = $(EXPAT_DIR)\\Libs\\libexpat.lib\n",
|
|
|
|
ExpatFlag = "",
|
|
|
|
IconvDir = "ICONV_DIR = c:\\progra~1\\libiconv-1.9.1\n",
|
2006-02-25 20:48:17 +01:00
|
|
|
IconvLib = "ICONV_LIB = $(ICONV_DIR)\\lib\\iconv.lib\n",
|
|
|
|
ZlibDir = "ZLIB_DIR = c:\\progra~1\\zlib-1.2.3\n",
|
|
|
|
ZlibLib = "ZLIB_LIB = $(ZLIB_DIR)\\lib\\zlib1.lib\n"
|
2004-04-27 22:28:23 +02:00
|
|
|
end,
|
|
|
|
|
2005-12-22 14:35:54 +01:00
|
|
|
EVersion = "ERLANG_VERSION = " ++ erlang:system_info(version) ++ "\n",
|
2004-04-27 22:28:23 +02:00
|
|
|
EIDirS = "EI_DIR = " ++ code:lib_dir("erl_interface") ++ "\n",
|
2003-07-13 11:00:01 +02:00
|
|
|
RootDirS = "ERLANG_DIR = " ++ code:root_dir() ++ "\n",
|
2004-04-27 22:28:23 +02:00
|
|
|
Version = "EJABBERD_VERSION = " ++ ?VERSION ++ "\n",
|
|
|
|
ExpatDir = "EXPAT_DIR = c:\\progra~1\\expat-1.95.7\n",
|
2004-08-22 23:54:14 +02:00
|
|
|
OpenSSLDir = "OPENSSL_DIR = c:\\progra~1\\OpenSSL\n",
|
2006-09-03 17:15:46 +02:00
|
|
|
DBType = "DBTYPE = generic\n", %% 'generic' or 'mssql'
|
2004-04-27 22:28:23 +02:00
|
|
|
|
|
|
|
SSLDir = "SSLDIR = " ++ code:lib_dir("ssl") ++ "\n",
|
|
|
|
StdLibDir = "STDLIBDIR = " ++ code:lib_dir("stdlib") ++ "\n",
|
|
|
|
|
2004-04-15 21:55:38 +02:00
|
|
|
file:write_file("Makefile.inc",
|
2006-02-25 20:48:17 +01:00
|
|
|
list_to_binary(EVersion ++
|
|
|
|
EIDirS ++
|
2004-04-27 22:28:23 +02:00
|
|
|
RootDirS ++
|
|
|
|
Version ++
|
|
|
|
SSLDir ++
|
|
|
|
StdLibDir ++
|
2004-08-22 23:54:14 +02:00
|
|
|
OpenSSLDir ++
|
2006-09-03 17:15:46 +02:00
|
|
|
DBType ++
|
2004-04-27 22:28:23 +02:00
|
|
|
ExpatDir ++
|
|
|
|
ExpatLib ++
|
|
|
|
ExpatFlag ++
|
|
|
|
IconvDir ++
|
2006-02-25 20:48:17 +01:00
|
|
|
IconvLib ++
|
|
|
|
ZlibDir ++
|
|
|
|
ZlibLib)),
|
2003-01-28 20:45:13 +01:00
|
|
|
halt().
|
|
|
|
|
|
|
|
|