2003-01-28 20:45:13 +01:00
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
%%% File : configure.erl
|
2007-12-24 12:41:41 +01:00
|
|
|
%%% Author : Alexey Shchepin <alexey@process-one.net>
|
2010-01-09 17:31:45 +01:00
|
|
|
%%% Purpose :
|
2007-12-24 12:41:41 +01:00
|
|
|
%%% Created : 27 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
|
|
|
%%%
|
|
|
|
%%%
|
2015-01-08 17:34:43 +01:00
|
|
|
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
2007-12-24 12:41:41 +01:00
|
|
|
%%%
|
|
|
|
%%% 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 2 of the
|
|
|
|
%%% License, 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.
|
2009-01-12 15:44:42 +01:00
|
|
|
%%%
|
2014-02-22 11:27:40 +01:00
|
|
|
%%% 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.,
|
|
|
|
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2007-12-24 12:41:41 +01:00
|
|
|
%%%
|
2003-01-28 20:45:13 +01:00
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
|
|
|
|
-module(configure).
|
2007-12-24 12:41:41 +01:00
|
|
|
-author('alexey@process-one.net').
|
2003-01-28 20:45:13 +01:00
|
|
|
|
|
|
|
-export([start/0]).
|
|
|
|
|
2004-04-15 21:55:38 +02:00
|
|
|
-include("ejabberd.hrl").
|
2013-04-08 11:12:54 +02:00
|
|
|
-include("logger.hrl").
|
2004-04-15 21:55:38 +02:00
|
|
|
|
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",
|
2007-12-01 17:06:24 +01:00
|
|
|
IconvDir = "ICONV_DIR = c:\\sdk\\GnuWin32\n",
|
|
|
|
IconvLib = "ICONV_LIB = $(ICONV_DIR)\\lib\\libiconv.lib\n",
|
|
|
|
ZlibDir = "ZLIB_DIR = c:\\sdk\\GnuWin32\n",
|
2006-02-25 20:48:17 +01:00
|
|
|
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 = "",
|
2007-12-01 17:06:24 +01:00
|
|
|
IconvDir = "ICONV_DIR = c:\\sdk\\GnuWin32\n",
|
|
|
|
IconvLib = "ICONV_LIB = $(ICONV_DIR)\\lib\\libiconv.lib\n",
|
|
|
|
ZlibDir = "ZLIB_DIR = c:\\sdk\\GnuWin32\n",
|
|
|
|
ZlibLib = "ZLIB_LIB = $(ZLIB_DIR)\\lib\\zlib.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",
|
2010-01-09 17:31:45 +01: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",
|
2008-06-18 23:33:48 +02:00
|
|
|
%% Load the ejabberd application description so that ?VERSION can read the vsn key
|
|
|
|
application:load(ejabberd),
|
2013-03-14 10:33:02 +01:00
|
|
|
Version = "EJABBERD_VERSION = " ++ binary_to_list(?VERSION) ++ "\n",
|
2007-12-01 17:06:24 +01:00
|
|
|
ExpatDir = "EXPAT_DIR = c:\\sdk\\Expat-2.0.0\n",
|
|
|
|
OpenSSLDir = "OPENSSL_DIR = c:\\sdk\\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
|
|
|
|
2010-01-09 17:31:45 +01:00
|
|
|
SSLDir = "SSLDIR = " ++ code:lib_dir(ssl) ++ "\n",
|
|
|
|
StdLibDir = "STDLIBDIR = " ++ code:lib_dir(stdlib) ++ "\n",
|
2004-04-27 22:28:23 +02:00
|
|
|
|
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().
|