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>
|
|
|
|
%%%
|
|
|
|
%%%
|
2011-02-14 13:47:22 +01:00
|
|
|
%%% ejabberd, Copyright (C) 2002-2011 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-19 15:47:33 +01:00
|
|
|
%%%
|
2007-12-24 12:41:41 +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., 59 Temple Place, Suite 330, Boston, MA
|
|
|
|
%%% 02111-1307 USA
|
|
|
|
%%%
|
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").
|
|
|
|
|
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 ->
|
2007-12-01 17:06:24 +01:00
|
|
|
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 ->
|
2007-12-01 17:06:24 +01:00
|
|
|
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),
|
2004-04-27 22:28:23 +02:00
|
|
|
Version = "EJABBERD_VERSION = " ++ ?VERSION ++ "\n",
|
2007-12-01 17:06:24 +01:00
|
|
|
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 ++
|
2006-02-25 20:48:17 +01:00
|
|
|
ZlibDir ++
|
|
|
|
ZlibLib)),
|
2003-01-28 20:45:13 +01:00
|
|
|
halt().
|