diff options
Diffstat (limited to '')
90 files changed, 37745 insertions, 0 deletions
diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/AUTHORS?rev=1.1&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/AUTHORS?rev=1.1&content-type=text/plain/index.html new file mode 100644 index 00000000..7fd550bd --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/AUTHORS?rev=1.1&content-type=text/plain/index.html @@ -0,0 +1,7 @@ +Nevrax Team : + + Daniel Miller + Vianney Lecroart + Olivier Cado + Cedric Valignat + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.1 b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.1 new file mode 100644 index 00000000..bfa87d2e --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.1 @@ -0,0 +1,89 @@ +NEVRAX NeL Network Services Howto +23/01/2001 cado@nevrax.com +$Id: HOWTO,v 1.1 2001/04/18 13:54:25 valignat Exp $ +---------- + +The NEVRAX NeL Network Services is made up of one unique login service, one or +several shards (aka game servers), and a few utility services. +In this document, we'll assume you want to run your login service +and one shard on the same machine. + +You can't launch more than one shard on a computer. + +Services are compiled in debug mode by default. + +Once you have compiled the servers, you should have the following files +(shown in Unix naming scheme, for Windows add ".exe") in a single +directory (let's call it homedir/bin): +naming_service -> used to find a specific service by its name +log_service -> centralized logger for all services +time_service -> centralized time reference manager +login_service -> centralized user account manager for all shards +(admin_executor_service -> collects system stats +(agent_service -> agent message router + + +1. In the working directory (e.g. homedir), create the following files +(don't type the lines beginning with "-") + +-- ns.cfg -- +Host = "hostname_of_your_machine_where_naming_service_will_run"; +Port = 50000; +------------ +(This file is used by all services) + +-- ls.txt -- +Shards = { + "hostname_of_your_machine_where_game_service_will_run", "Name of the shard as it will appear on the client" +}; +------------ +(This file is used by login_service) + + +2. Launch the servers. +Here is a sample batch file, where you can find the right ordering : + +-- starts -- +nohup ~/bin/naming_service >/dev/null +nohup ~/bin/log_service >/dev/null +nohup ~/bin/time_service >/dev/null +nohup ~/bin/login_service >/dev/null +echo "Active services:" +ps -edf | grep _service | grep -v grep +echo "End services" +------------ + +3. To connect a client to your new shard, set +LSHost = "hostname_of_your_machine_where_login_service_runs"; +in its client.cfg +and create ns.cfg with the same contents as for the servers. +Then launch the client and enjoy :-) + + +4. The services create/modify the following config or log files: +- unitime.cfg (time_service) + Contains the time reference +- ls.txt (login_service) + Every time a new user (not registered before) logs in, its login + and password are saved into ls.txt +- ls.log (login_service) + Every time someone logs in, its configuration information is + saved into ls.log +- logs.log (very big especially if you have compiled the servers + with NL_DEBUG defined) (log_service) + Contains all debug information sent by the services. + + +5. How to shutdown the services +Here is a sample batch file: + +-- kills -- +kill -INT `ps -edf | grep bin/login_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/time_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/log_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/naming_service | grep -v grep | tr -s " " | cut -d' ' -f2` +-- kills -- + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.1&content-type=text/plain&only_with_tag=MAIN/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.1&content-type=text/plain&only_with_tag=MAIN/index.html new file mode 100644 index 00000000..bfa87d2e --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.1&content-type=text/plain&only_with_tag=MAIN/index.html @@ -0,0 +1,89 @@ +NEVRAX NeL Network Services Howto +23/01/2001 cado@nevrax.com +$Id: HOWTO,v 1.1 2001/04/18 13:54:25 valignat Exp $ +---------- + +The NEVRAX NeL Network Services is made up of one unique login service, one or +several shards (aka game servers), and a few utility services. +In this document, we'll assume you want to run your login service +and one shard on the same machine. + +You can't launch more than one shard on a computer. + +Services are compiled in debug mode by default. + +Once you have compiled the servers, you should have the following files +(shown in Unix naming scheme, for Windows add ".exe") in a single +directory (let's call it homedir/bin): +naming_service -> used to find a specific service by its name +log_service -> centralized logger for all services +time_service -> centralized time reference manager +login_service -> centralized user account manager for all shards +(admin_executor_service -> collects system stats +(agent_service -> agent message router + + +1. In the working directory (e.g. homedir), create the following files +(don't type the lines beginning with "-") + +-- ns.cfg -- +Host = "hostname_of_your_machine_where_naming_service_will_run"; +Port = 50000; +------------ +(This file is used by all services) + +-- ls.txt -- +Shards = { + "hostname_of_your_machine_where_game_service_will_run", "Name of the shard as it will appear on the client" +}; +------------ +(This file is used by login_service) + + +2. Launch the servers. +Here is a sample batch file, where you can find the right ordering : + +-- starts -- +nohup ~/bin/naming_service >/dev/null +nohup ~/bin/log_service >/dev/null +nohup ~/bin/time_service >/dev/null +nohup ~/bin/login_service >/dev/null +echo "Active services:" +ps -edf | grep _service | grep -v grep +echo "End services" +------------ + +3. To connect a client to your new shard, set +LSHost = "hostname_of_your_machine_where_login_service_runs"; +in its client.cfg +and create ns.cfg with the same contents as for the servers. +Then launch the client and enjoy :-) + + +4. The services create/modify the following config or log files: +- unitime.cfg (time_service) + Contains the time reference +- ls.txt (login_service) + Every time a new user (not registered before) logs in, its login + and password are saved into ls.txt +- ls.log (login_service) + Every time someone logs in, its configuration information is + saved into ls.log +- logs.log (very big especially if you have compiled the servers + with NL_DEBUG defined) (log_service) + Contains all debug information sent by the services. + + +5. How to shutdown the services +Here is a sample batch file: + +-- kills -- +kill -INT `ps -edf | grep bin/login_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/time_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/log_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/naming_service | grep -v grep | tr -s " " | cut -d' ' -f2` +-- kills -- + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.1&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.1&content-type=text/plain/index.html new file mode 100644 index 00000000..bfa87d2e --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.1&content-type=text/plain/index.html @@ -0,0 +1,89 @@ +NEVRAX NeL Network Services Howto +23/01/2001 cado@nevrax.com +$Id: HOWTO,v 1.1 2001/04/18 13:54:25 valignat Exp $ +---------- + +The NEVRAX NeL Network Services is made up of one unique login service, one or +several shards (aka game servers), and a few utility services. +In this document, we'll assume you want to run your login service +and one shard on the same machine. + +You can't launch more than one shard on a computer. + +Services are compiled in debug mode by default. + +Once you have compiled the servers, you should have the following files +(shown in Unix naming scheme, for Windows add ".exe") in a single +directory (let's call it homedir/bin): +naming_service -> used to find a specific service by its name +log_service -> centralized logger for all services +time_service -> centralized time reference manager +login_service -> centralized user account manager for all shards +(admin_executor_service -> collects system stats +(agent_service -> agent message router + + +1. In the working directory (e.g. homedir), create the following files +(don't type the lines beginning with "-") + +-- ns.cfg -- +Host = "hostname_of_your_machine_where_naming_service_will_run"; +Port = 50000; +------------ +(This file is used by all services) + +-- ls.txt -- +Shards = { + "hostname_of_your_machine_where_game_service_will_run", "Name of the shard as it will appear on the client" +}; +------------ +(This file is used by login_service) + + +2. Launch the servers. +Here is a sample batch file, where you can find the right ordering : + +-- starts -- +nohup ~/bin/naming_service >/dev/null +nohup ~/bin/log_service >/dev/null +nohup ~/bin/time_service >/dev/null +nohup ~/bin/login_service >/dev/null +echo "Active services:" +ps -edf | grep _service | grep -v grep +echo "End services" +------------ + +3. To connect a client to your new shard, set +LSHost = "hostname_of_your_machine_where_login_service_runs"; +in its client.cfg +and create ns.cfg with the same contents as for the servers. +Then launch the client and enjoy :-) + + +4. The services create/modify the following config or log files: +- unitime.cfg (time_service) + Contains the time reference +- ls.txt (login_service) + Every time a new user (not registered before) logs in, its login + and password are saved into ls.txt +- ls.log (login_service) + Every time someone logs in, its configuration information is + saved into ls.log +- logs.log (very big especially if you have compiled the servers + with NL_DEBUG defined) (log_service) + Contains all debug information sent by the services. + + +5. How to shutdown the services +Here is a sample batch file: + +-- kills -- +kill -INT `ps -edf | grep bin/login_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/time_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/log_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/naming_service | grep -v grep | tr -s " " | cut -d' ' -f2` +-- kills -- + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2 b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2 new file mode 100644 index 00000000..22919b26 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2 @@ -0,0 +1,87 @@ +NEVRAX NeL Network Services Howto +23/01/2001 cado@nevrax.com +$Id: HOWTO,v 1.2 2001/10/04 15:49:12 lecroart Exp $ +---------- + +The NEVRAX NeL Network Services is made up of one unique login service, one or +several shards (aka game servers), and a few utility services. +In this document, we'll assume you want to run your login service +and one shard on the same machine. + +You can't launch more than one shard on a computer. + +Services are compiled in debug mode by default. + +Once you have compiled the servers, you should have the following files +(shown in Unix naming scheme, for Windows add ".exe") in a single +directory (let's call it homedir/bin): +naming_service -> used to find a specific service by its name +time_service -> centralized time reference manager +login_service -> centralized user account manager for all shards +(admin_executor_service -> collects system stats +(agent_service -> agent message router + + +1. In the working directory (e.g. homedir), create the following files +(don't type the lines beginning with "-") + +-- ns.cfg -- +Host = "hostname_of_your_machine_where_naming_service_will_run"; +Port = 50000; +------------ +(This file is used by all services) + +-- ls.txt -- +Shards = { + "hostname_of_your_machine_where_game_service_will_run", "Name of the shard as it will appear on the client" +}; +------------ +(This file is used by login_service) + + +2. Launch the servers. +Here is a sample batch file, where you can find the right ordering : + +-- starts -- +nohup ~/bin/naming_service >/dev/null +nohup ~/bin/time_service >/dev/null +nohup ~/bin/login_service >/dev/null +echo "Active services:" +ps -edf | grep _service | grep -v grep +echo "End services" +------------ + +3. To connect a client to your new shard, set +LSHost = "hostname_of_your_machine_where_login_service_runs"; +in its client.cfg +and create ns.cfg with the same contents as for the servers. +Then launch the client and enjoy :-) + + +4. The services create/modify the following config or log files: +- unitime.cfg (time_service) + Contains the time reference +- ls.txt (login_service) + Every time a new user (not registered before) logs in, its login + and password are saved into ls.txt +- ls.log (login_service) + Every time someone logs in, its configuration information is + saved into ls.log +- log.log (very big especially if you have compiled the servers + with NL_DEBUG defined) + Contains all debug information sent by the services. + + +5. How to shutdown the services +Here is a sample batch file: + +-- kills -- +kill -INT `ps -edf | grep bin/login_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/time_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/log_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/naming_service | grep -v grep | tr -s " " | cut -d' ' -f2` +-- kills -- + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2&content-type=text/plain&only_with_tag=HEAD/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2&content-type=text/plain&only_with_tag=HEAD/index.html new file mode 100644 index 00000000..22919b26 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2&content-type=text/plain&only_with_tag=HEAD/index.html @@ -0,0 +1,87 @@ +NEVRAX NeL Network Services Howto +23/01/2001 cado@nevrax.com +$Id: HOWTO,v 1.2 2001/10/04 15:49:12 lecroart Exp $ +---------- + +The NEVRAX NeL Network Services is made up of one unique login service, one or +several shards (aka game servers), and a few utility services. +In this document, we'll assume you want to run your login service +and one shard on the same machine. + +You can't launch more than one shard on a computer. + +Services are compiled in debug mode by default. + +Once you have compiled the servers, you should have the following files +(shown in Unix naming scheme, for Windows add ".exe") in a single +directory (let's call it homedir/bin): +naming_service -> used to find a specific service by its name +time_service -> centralized time reference manager +login_service -> centralized user account manager for all shards +(admin_executor_service -> collects system stats +(agent_service -> agent message router + + +1. In the working directory (e.g. homedir), create the following files +(don't type the lines beginning with "-") + +-- ns.cfg -- +Host = "hostname_of_your_machine_where_naming_service_will_run"; +Port = 50000; +------------ +(This file is used by all services) + +-- ls.txt -- +Shards = { + "hostname_of_your_machine_where_game_service_will_run", "Name of the shard as it will appear on the client" +}; +------------ +(This file is used by login_service) + + +2. Launch the servers. +Here is a sample batch file, where you can find the right ordering : + +-- starts -- +nohup ~/bin/naming_service >/dev/null +nohup ~/bin/time_service >/dev/null +nohup ~/bin/login_service >/dev/null +echo "Active services:" +ps -edf | grep _service | grep -v grep +echo "End services" +------------ + +3. To connect a client to your new shard, set +LSHost = "hostname_of_your_machine_where_login_service_runs"; +in its client.cfg +and create ns.cfg with the same contents as for the servers. +Then launch the client and enjoy :-) + + +4. The services create/modify the following config or log files: +- unitime.cfg (time_service) + Contains the time reference +- ls.txt (login_service) + Every time a new user (not registered before) logs in, its login + and password are saved into ls.txt +- ls.log (login_service) + Every time someone logs in, its configuration information is + saved into ls.log +- log.log (very big especially if you have compiled the servers + with NL_DEBUG defined) + Contains all debug information sent by the services. + + +5. How to shutdown the services +Here is a sample batch file: + +-- kills -- +kill -INT `ps -edf | grep bin/login_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/time_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/log_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/naming_service | grep -v grep | tr -s " " | cut -d' ' -f2` +-- kills -- + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2&content-type=text/plain&sortby=date&only_with_tag=MAIN/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2&content-type=text/plain&sortby=date&only_with_tag=MAIN/index.html new file mode 100644 index 00000000..22919b26 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2&content-type=text/plain&sortby=date&only_with_tag=MAIN/index.html @@ -0,0 +1,87 @@ +NEVRAX NeL Network Services Howto +23/01/2001 cado@nevrax.com +$Id: HOWTO,v 1.2 2001/10/04 15:49:12 lecroart Exp $ +---------- + +The NEVRAX NeL Network Services is made up of one unique login service, one or +several shards (aka game servers), and a few utility services. +In this document, we'll assume you want to run your login service +and one shard on the same machine. + +You can't launch more than one shard on a computer. + +Services are compiled in debug mode by default. + +Once you have compiled the servers, you should have the following files +(shown in Unix naming scheme, for Windows add ".exe") in a single +directory (let's call it homedir/bin): +naming_service -> used to find a specific service by its name +time_service -> centralized time reference manager +login_service -> centralized user account manager for all shards +(admin_executor_service -> collects system stats +(agent_service -> agent message router + + +1. In the working directory (e.g. homedir), create the following files +(don't type the lines beginning with "-") + +-- ns.cfg -- +Host = "hostname_of_your_machine_where_naming_service_will_run"; +Port = 50000; +------------ +(This file is used by all services) + +-- ls.txt -- +Shards = { + "hostname_of_your_machine_where_game_service_will_run", "Name of the shard as it will appear on the client" +}; +------------ +(This file is used by login_service) + + +2. Launch the servers. +Here is a sample batch file, where you can find the right ordering : + +-- starts -- +nohup ~/bin/naming_service >/dev/null +nohup ~/bin/time_service >/dev/null +nohup ~/bin/login_service >/dev/null +echo "Active services:" +ps -edf | grep _service | grep -v grep +echo "End services" +------------ + +3. To connect a client to your new shard, set +LSHost = "hostname_of_your_machine_where_login_service_runs"; +in its client.cfg +and create ns.cfg with the same contents as for the servers. +Then launch the client and enjoy :-) + + +4. The services create/modify the following config or log files: +- unitime.cfg (time_service) + Contains the time reference +- ls.txt (login_service) + Every time a new user (not registered before) logs in, its login + and password are saved into ls.txt +- ls.log (login_service) + Every time someone logs in, its configuration information is + saved into ls.log +- log.log (very big especially if you have compiled the servers + with NL_DEBUG defined) + Contains all debug information sent by the services. + + +5. How to shutdown the services +Here is a sample batch file: + +-- kills -- +kill -INT `ps -edf | grep bin/login_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/time_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/log_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/naming_service | grep -v grep | tr -s " " | cut -d' ' -f2` +-- kills -- + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2&content-type=text/plain/index.html new file mode 100644 index 00000000..22919b26 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/HOWTO?rev=1.2&content-type=text/plain/index.html @@ -0,0 +1,87 @@ +NEVRAX NeL Network Services Howto +23/01/2001 cado@nevrax.com +$Id: HOWTO,v 1.2 2001/10/04 15:49:12 lecroart Exp $ +---------- + +The NEVRAX NeL Network Services is made up of one unique login service, one or +several shards (aka game servers), and a few utility services. +In this document, we'll assume you want to run your login service +and one shard on the same machine. + +You can't launch more than one shard on a computer. + +Services are compiled in debug mode by default. + +Once you have compiled the servers, you should have the following files +(shown in Unix naming scheme, for Windows add ".exe") in a single +directory (let's call it homedir/bin): +naming_service -> used to find a specific service by its name +time_service -> centralized time reference manager +login_service -> centralized user account manager for all shards +(admin_executor_service -> collects system stats +(agent_service -> agent message router + + +1. In the working directory (e.g. homedir), create the following files +(don't type the lines beginning with "-") + +-- ns.cfg -- +Host = "hostname_of_your_machine_where_naming_service_will_run"; +Port = 50000; +------------ +(This file is used by all services) + +-- ls.txt -- +Shards = { + "hostname_of_your_machine_where_game_service_will_run", "Name of the shard as it will appear on the client" +}; +------------ +(This file is used by login_service) + + +2. Launch the servers. +Here is a sample batch file, where you can find the right ordering : + +-- starts -- +nohup ~/bin/naming_service >/dev/null +nohup ~/bin/time_service >/dev/null +nohup ~/bin/login_service >/dev/null +echo "Active services:" +ps -edf | grep _service | grep -v grep +echo "End services" +------------ + +3. To connect a client to your new shard, set +LSHost = "hostname_of_your_machine_where_login_service_runs"; +in its client.cfg +and create ns.cfg with the same contents as for the servers. +Then launch the client and enjoy :-) + + +4. The services create/modify the following config or log files: +- unitime.cfg (time_service) + Contains the time reference +- ls.txt (login_service) + Every time a new user (not registered before) logs in, its login + and password are saved into ls.txt +- ls.log (login_service) + Every time someone logs in, its configuration information is + saved into ls.log +- log.log (very big especially if you have compiled the servers + with NL_DEBUG defined) + Contains all debug information sent by the services. + + +5. How to shutdown the services +Here is a sample batch file: + +-- kills -- +kill -INT `ps -edf | grep bin/login_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/time_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/log_service | grep -v grep | tr -s " " | cut -d' ' -f2` +sleep 1 +kill -INT `ps -edf | grep bin/naming_service | grep -v grep | tr -s " " | cut -d' ' -f2` +-- kills -- + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/INSTALL?rev=1.1 b/cvs/cvsweb.cgi/~checkout~/code/nelns/INSTALL?rev=1.1 new file mode 100644 index 00000000..3c5a0b8d --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/INSTALL?rev=1.1 @@ -0,0 +1,90 @@ + +If you find any bugs use the Nevrax Bug Tracking System : + + <URL:http://www.nevrax.org/bugs/> + +If you need any help contact us on the NeL mailing-list : + + <URL:http://www.nevrax.org/mail/> + + +Requirements +============ + + The NEVRAX NeL Network Services need the following library : + + - STLPort 4.0 <URL:http://www.stlport.org/> + - NeL <URL:http://www.nevrax.org/> + + +Compilation +=========== + + 1. Windows compilation + ---------------------- + + The compilation on Windows has been done only with Visual C++ 6.0 SP4. + + Set up Visual C++ to find the STLPort libraries. This is done in the + [Tools -> Options -> Directories] menu : + + - Add the STLPort include directory to the "Library Files" category. + ex: D:/stlport-4.0/stlport + + - Add the STLPort library directory to the "Library Files" category. + ex: D:/stlport-4.0/lib + + Open the workspace file "services.dsw" (in the menu [File -> Workspace]). + + Setup Visual C++ to find the NeL include and library files : + + - Add the NEL include directory to the "Library Files" category. + ex: D:/prefix/include + + - Add the STLPort library directory to the "Library Files" category. + ex: D:/prefix/lib + + + 2. GNU/Linux compilation + ------------------------ + + In the case that you need to rebuild the "configure" script and/or the + "Makefile.in" files, execute the "bootstrap" script in the server + directory : + + % ./bootstrap + + In the server directory do : + + % ./configure --with-stlport=<Path_to_the_stlport_headers_files> + + % make + + The "configure" script must be call with the "--with-stlport" option. + This option permit to override the default STL headers. + + To pass additional arguments to the C++ compiler, use the command line : + + % CXXFLAGS=-pipe ./configure --with-stlport=<STLPort_headers_path> + + To get the complete list of arguments of the "configure" script use the + following command : + + % ./configure --help + + +Installation +============ + + 1. Windows installation + ----------------------- + + Not done yet. + + + 2. GNU/Linux installation + -------------------------- + + % make install + + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?content-type=text/plain&rev=1.1&sortby=author b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?content-type=text/plain&rev=1.1&sortby=author new file mode 100644 index 00000000..8515a7af --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?content-type=text/plain&rev=1.1&sortby=author @@ -0,0 +1,22 @@ +# +# $Id: Makefile.am,v 1.1 2001/04/18 13:54:25 valignat Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in configure config.guess missing \ + config.sub ltconfig aclocal.m4 config.h.in \ + install-sh mkinstalldirs + +SUBDIRS = login_service \ + log_service \ + naming_service \ + time_service \ + agent_service \ + admin_executor_service + + +dist-hook: + cp -pr $(srcdir)/bootstrap $(distdir) + + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.2&content-type=text/plain&sortby=date/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.2&content-type=text/plain&sortby=date/index.html new file mode 100644 index 00000000..274cde8d --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.2&content-type=text/plain&sortby=date/index.html @@ -0,0 +1,24 @@ +# +# $Id: Makefile.am,v 1.2 2001/05/02 12:36:39 lecroart Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in configure config.guess missing \ + config.sub ltconfig aclocal.m4 config.h.in \ + install-sh mkinstalldirs + +SUBDIRS = login_service \ + log_service \ + naming_service \ + time_service \ + agent_service \ + admin_executor_service \ + admin_service \ + welcome_service \ + + +dist-hook: + cp -pr $(srcdir)/bootstrap $(distdir) + + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.2&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.2&content-type=text/plain/index.html new file mode 100644 index 00000000..22329e8b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.2&content-type=text/plain/index.html @@ -0,0 +1,23 @@ +# +# $Id: Makefile.am,v 1.4 2001/06/18 14:04:46 valignat Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in configure config.guess missing \ + config.sub ltconfig aclocal.m4 config.h.in \ + install-sh mkinstalldirs + +SUBDIRS = login_service \ + log_service \ + naming_service \ + time_service \ + admin_executor_service \ + admin_service \ + welcome_service + + +dist-hook: + cp -pr $(srcdir)/bootstrap $(distdir) + + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.3&content-type=text/plain&sortby=author/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.3&content-type=text/plain&sortby=author/index.html new file mode 100644 index 00000000..e5fdd541 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.3&content-type=text/plain&sortby=author/index.html @@ -0,0 +1,24 @@ +# +# $Id: Makefile.am,v 1.3 2001/05/03 13:19:12 lecroart Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in configure config.guess missing \ + config.sub ltconfig aclocal.m4 config.h.in \ + install-sh mkinstalldirs + +SUBDIRS = login_service \ + log_service \ + naming_service \ + time_service \ + admin_executor_service \ + admin_service \ + welcome_service \ + agent_service + + +dist-hook: + cp -pr $(srcdir)/bootstrap $(distdir) + + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.3&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.3&content-type=text/plain/index.html new file mode 100644 index 00000000..22329e8b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.3&content-type=text/plain/index.html @@ -0,0 +1,23 @@ +# +# $Id: Makefile.am,v 1.4 2001/06/18 14:04:46 valignat Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in configure config.guess missing \ + config.sub ltconfig aclocal.m4 config.h.in \ + install-sh mkinstalldirs + +SUBDIRS = login_service \ + log_service \ + naming_service \ + time_service \ + admin_executor_service \ + admin_service \ + welcome_service + + +dist-hook: + cp -pr $(srcdir)/bootstrap $(distdir) + + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.4&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.4&content-type=text/plain/index.html new file mode 100644 index 00000000..22329e8b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.4&content-type=text/plain/index.html @@ -0,0 +1,23 @@ +# +# $Id: Makefile.am,v 1.4 2001/06/18 14:04:46 valignat Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in configure config.guess missing \ + config.sub ltconfig aclocal.m4 config.h.in \ + install-sh mkinstalldirs + +SUBDIRS = login_service \ + log_service \ + naming_service \ + time_service \ + admin_executor_service \ + admin_service \ + welcome_service + + +dist-hook: + cp -pr $(srcdir)/bootstrap $(distdir) + + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.6&content-type=text/plain&sortby=rev/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.6&content-type=text/plain&sortby=rev/index.html new file mode 100644 index 00000000..1a8753a2 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.6&content-type=text/plain&sortby=rev/index.html @@ -0,0 +1,21 @@ +# +# $Id: Makefile.am,v 1.6 2002/03/19 17:42:48 valignat Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in configure config.guess missing \ + config.sub ltconfig aclocal.m4 config.h.in \ + install-sh mkinstalldirs + +EXTRA_DIST = acconfig.h services.dsw bootstrap doc + +SUBDIRS = login_service \ + naming_service \ + admin_executor_service \ + admin_service \ + welcome_service + +dist-hook: + find $(distdir) -name CVS -print | xargs rm -fr + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.7&content-type=text/plain&sortby=date/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.7&content-type=text/plain&sortby=date/index.html new file mode 100644 index 00000000..ba5c4f73 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.7&content-type=text/plain&sortby=date/index.html @@ -0,0 +1,38 @@ +# +# $Id: Makefile.am,v 1.7 2002/04/10 07:33:07 lecroart Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in configure config.guess missing \ + config.sub ltconfig aclocal.m4 config.h.in \ + install-sh mkinstalldirs + +EXTRA_DIST = acconfig.h services.dsw bootstrap doc + +SUBDIRS = login_service \ + naming_service \ + admin_executor_service \ + admin_service \ + welcome_service + +dist-hook: + find $(distdir) -name CVS -print | xargs rm -fr + +install-data-hook: + mkdir -p ${DESTDIR}${pkglocalstatedir} + mkdir -p ${DESTDIR}${logdir} + mkdir -p ${DESTDIR}${pkgsysconfdir} +# +# Do not override existing config files +# + for service in admin admin_executor login naming welcome ; \ + do \ + test -f ${DESTDIR}${pkgsysconfdir}/$${service}_service.cfg || cp ${srcdir}/$${service}_service/$${service}_service.cfg ${DESTDIR}${pkgsysconfdir} ; \ + done + +uninstall-local: + for service in admin admin_executor login naming welcome ; \ + do \ + rm -f ${DESTDIR}${pkgsysconfdir}/$${service}_service.cfg ; \ + done + +# End of Makefile.am diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.8&content-type=text/plain&sortby=date/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.8&content-type=text/plain&sortby=date/index.html new file mode 100644 index 00000000..8a10601e --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/Makefile.am?rev=1.8&content-type=text/plain&sortby=date/index.html @@ -0,0 +1,41 @@ +# +# $Id: Makefile.am,v 1.8 2002/05/03 08:11:14 lecroart Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in configure config.guess missing \ + config.sub ltconfig aclocal.m4 config.h.in \ + install-sh mkinstalldirs + +EXTRA_DIST = acconfig.h services.dsw bootstrap doc + +SUBDIRS = login_service \ + naming_service \ + admin_executor_service \ + admin_service \ + welcome_service + +dist-hook: + find $(distdir) -name CVS -print | xargs rm -fr + +install-data-hook: + mkdir -p ${DESTDIR}${pkglocalstatedir} + mkdir -p ${DESTDIR}${logdir} + mkdir -p ${DESTDIR}${pkgsysconfdir} +# +# Do not override existing config files +# + for service in admin admin_executor login naming welcome ; \ + do \ + test -f ${DESTDIR}${pkgsysconfdir}/$${service}_service.cfg || cp ${srcdir}/$${service}_service/$${service}_service.cfg ${DESTDIR}${pkgsysconfdir} ; \ + done + test -f ${DESTDIR}${pkgsysconfdir}/common.cfg || cp ${srcdir}/admin_service/common.cfg ${DESTDIR}${pkgsysconfdir} + + +uninstall-local: + for service in admin admin_executor login naming welcome ; \ + do \ + rm -f ${DESTDIR}${pkgsysconfdir}/$${service}_service.cfg ; \ + done + rm -f ${DESTDIR}${pkgsysconfdir}/common.cfg + +# End of Makefile.am diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/NEWS?rev=1.1&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/NEWS?rev=1.1&content-type=text/plain/index.html new file mode 100644 index 00000000..496a72d3 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/NEWS?rev=1.1&content-type=text/plain/index.html @@ -0,0 +1,6 @@ + +No news, good news ... + +Currently, this file exist to get rid of an Automake error. The content of +that file will be what it should be at the next release. + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.1&content-type=text/plain&only_with_tag=MAIN/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.1&content-type=text/plain&only_with_tag=MAIN/index.html new file mode 100644 index 00000000..ac12141b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.1&content-type=text/plain&only_with_tag=MAIN/index.html @@ -0,0 +1,7 @@ +We would like to thanks these peoples : + +Loic Dachary <loic@senga.org> + for the configure srcipt improvement and advices. + +And all users ... + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.1&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.1&content-type=text/plain/index.html new file mode 100644 index 00000000..ac12141b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.1&content-type=text/plain/index.html @@ -0,0 +1,7 @@ +We would like to thanks these peoples : + +Loic Dachary <loic@senga.org> + for the configure srcipt improvement and advices. + +And all users ... + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.2&content-type=text/plain&only_with_tag=MAIN/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.2&content-type=text/plain&only_with_tag=MAIN/index.html new file mode 100644 index 00000000..63f551c8 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.2&content-type=text/plain&only_with_tag=MAIN/index.html @@ -0,0 +1,7 @@ +We would like to thanks these peoples : + +Loic Dachary <loic@senga.org> + for the configure script improvement and advices. + +And all users ... + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.2&content-type=text/plain&sortby=rev/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.2&content-type=text/plain&sortby=rev/index.html new file mode 100644 index 00000000..63f551c8 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/THANKS?rev=1.2&content-type=text/plain&sortby=rev/index.html @@ -0,0 +1,7 @@ +We would like to thanks these peoples : + +Loic Dachary <loic@senga.org> + for the configure script improvement and advices. + +And all users ... + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acconfig.h?rev=1.1&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acconfig.h?rev=1.1&content-type=text/plain/index.html new file mode 100644 index 00000000..7ec73dc8 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acconfig.h?rev=1.1&content-type=text/plain/index.html @@ -0,0 +1,17 @@ + + +/* + * Configuration files directory path + */ +#undef NELNS_CONFIG + +/* + * Log files directory path + */ +#undef NELNS_LOGS + +/* + * Local state files directory path + */ +#undef NELNS_STATE + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.1&content-type=text/plain&only_with_tag=MAIN/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.1&content-type=text/plain&only_with_tag=MAIN/index.html new file mode 100644 index 00000000..84166845 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.1&content-type=text/plain&only_with_tag=MAIN/index.html @@ -0,0 +1,1068 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.1 2002/01/07 16:09:52 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIB variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +dnl NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIB="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIB="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIB="$OPENAL_LIB -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIB" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIB) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" = "no" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.1&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.1&content-type=text/plain/index.html new file mode 100644 index 00000000..84166845 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.1&content-type=text/plain/index.html @@ -0,0 +1,1068 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.1 2002/01/07 16:09:52 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIB variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +dnl NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIB="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIB="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIB="$OPENAL_LIB -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIB" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIB) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" = "no" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.10 b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.10 new file mode 100644 index 00000000..cd93eb5c --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.10 @@ -0,0 +1,1049 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.10 2002/03/21 10:54:37 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.10&content-type=text/plain&sortby=author/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.10&content-type=text/plain&sortby=author/index.html new file mode 100644 index 00000000..cd93eb5c --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.10&content-type=text/plain&sortby=author/index.html @@ -0,0 +1,1049 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.10 2002/03/21 10:54:37 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.11 b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.11 new file mode 100644 index 00000000..49d5b40b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.11 @@ -0,0 +1,1049 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.11 2002/03/26 14:37:45 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.11&content-type=text/plain&only_with_tag=MAIN/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.11&content-type=text/plain&only_with_tag=MAIN/index.html new file mode 100644 index 00000000..49d5b40b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.11&content-type=text/plain&only_with_tag=MAIN/index.html @@ -0,0 +1,1049 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.11 2002/03/26 14:37:45 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.11&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.11&content-type=text/plain/index.html new file mode 100644 index 00000000..49d5b40b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.11&content-type=text/plain/index.html @@ -0,0 +1,1049 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.11 2002/03/26 14:37:45 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.12 b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.12 new file mode 100644 index 00000000..9184a376 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.12 @@ -0,0 +1,1049 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.12 2002/03/29 10:19:10 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/include]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.12&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.12&content-type=text/plain/index.html new file mode 100644 index 00000000..9184a376 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.12&content-type=text/plain/index.html @@ -0,0 +1,1049 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.12 2002/03/29 10:19:10 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/include]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.13&content-type=text/plain&only_with_tag=MAIN/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.13&content-type=text/plain&only_with_tag=MAIN/index.html new file mode 100644 index 00000000..d54d6b17 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.13&content-type=text/plain&only_with_tag=MAIN/index.html @@ -0,0 +1,1076 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.13 2002/04/16 12:01:39 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl AM_PATH_CCACHE +dnl +dnl Option: none. +dnl Description: check the instalation of the Ccache utility. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/include]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +# ========================================================================= +# AM_PATH_CCACHE : Ccache checking macros + +AC_DEFUN(AM_PATH_CCACHE, +[ + +AC_ARG_WITH( ccache, + [ --with-ccache use ccache for compiling.], + [ using_ccache=$with_ccache ] +) + +AC_PATH_PROG(CCACHE, ccache) +if test "$CCACHE" -a "$using_ccache" = "yes" +then + CC="ccache $CC" + CXX="ccache $CXX" +fi + +]) + + +dnl ========================================================================= +dnl End of file + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.13&content-type=text/plain&sortby=date/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.13&content-type=text/plain&sortby=date/index.html new file mode 100644 index 00000000..d54d6b17 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.13&content-type=text/plain&sortby=date/index.html @@ -0,0 +1,1076 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.13 2002/04/16 12:01:39 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl AM_PATH_CCACHE +dnl +dnl Option: none. +dnl Description: check the instalation of the Ccache utility. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/include]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +# ========================================================================= +# AM_PATH_CCACHE : Ccache checking macros + +AC_DEFUN(AM_PATH_CCACHE, +[ + +AC_ARG_WITH( ccache, + [ --with-ccache use ccache for compiling.], + [ using_ccache=$with_ccache ] +) + +AC_PATH_PROG(CCACHE, ccache) +if test "$CCACHE" -a "$using_ccache" = "yes" +then + CC="ccache $CC" + CXX="ccache $CXX" +fi + +]) + + +dnl ========================================================================= +dnl End of file + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.14&content-type=text/plain&only_with_tag=MAIN/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.14&content-type=text/plain&only_with_tag=MAIN/index.html new file mode 100644 index 00000000..3a62ee8b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.14&content-type=text/plain&only_with_tag=MAIN/index.html @@ -0,0 +1,1079 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.14 2002/04/25 17:52:16 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl AM_PATH_CCACHE +dnl +dnl Option: none. +dnl Description: check the instalation of the Ccache utility. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/include]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +dnl Check for the 'pthread' library. SLTPort needs it. +AC_CHECK_LIB(pthread, main, , [AC_MSG_ERROR([cannot find the pthread library.])]) + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +# ========================================================================= +# AM_PATH_CCACHE : Ccache checking macros + +AC_DEFUN(AM_PATH_CCACHE, +[ + +AC_ARG_WITH( ccache, + [ --with-ccache use ccache for compiling.], + [ using_ccache=$with_ccache ] +) + +AC_PATH_PROG(CCACHE, ccache) +if test "$CCACHE" -a "$using_ccache" = "yes" +then + CC="ccache $CC" + CXX="ccache $CXX" +fi + +]) + + +dnl ========================================================================= +dnl End of file + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.14&content-type=text/plain&only_with_tag=georges_v2/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.14&content-type=text/plain&only_with_tag=georges_v2/index.html new file mode 100644 index 00000000..3a62ee8b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.14&content-type=text/plain&only_with_tag=georges_v2/index.html @@ -0,0 +1,1079 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.14 2002/04/25 17:52:16 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl AM_PATH_CCACHE +dnl +dnl Option: none. +dnl Description: check the instalation of the Ccache utility. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/include]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +dnl Check for the 'pthread' library. SLTPort needs it. +AC_CHECK_LIB(pthread, main, , [AC_MSG_ERROR([cannot find the pthread library.])]) + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +# ========================================================================= +# AM_PATH_CCACHE : Ccache checking macros + +AC_DEFUN(AM_PATH_CCACHE, +[ + +AC_ARG_WITH( ccache, + [ --with-ccache use ccache for compiling.], + [ using_ccache=$with_ccache ] +) + +AC_PATH_PROG(CCACHE, ccache) +if test "$CCACHE" -a "$using_ccache" = "yes" +then + CC="ccache $CC" + CXX="ccache $CXX" +fi + +]) + + +dnl ========================================================================= +dnl End of file + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.14&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.14&content-type=text/plain/index.html new file mode 100644 index 00000000..3a62ee8b --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.14&content-type=text/plain/index.html @@ -0,0 +1,1079 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.14 2002/04/25 17:52:16 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl AM_PATH_CCACHE +dnl +dnl Option: none. +dnl Description: check the instalation of the Ccache utility. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/include]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" +nelgeorges_is_mandatory="$7" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) +MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +dnl Check for the 'pthread' library. SLTPort needs it. +AC_CHECK_LIB(pthread, main, , [AC_MSG_ERROR([cannot find the pthread library.])]) + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +# ========================================================================= +# AM_PATH_CCACHE : Ccache checking macros + +AC_DEFUN(AM_PATH_CCACHE, +[ + +AC_ARG_WITH( ccache, + [ --with-ccache use ccache for compiling.], + [ using_ccache=$with_ccache ] +) + +AC_PATH_PROG(CCACHE, ccache) +if test "$CCACHE" -a "$using_ccache" = "yes" +then + CC="ccache $CC" + CXX="ccache $CXX" +fi + +]) + + +dnl ========================================================================= +dnl End of file + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.2 b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.2 new file mode 100644 index 00000000..deb5def1 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.2 @@ -0,0 +1,1068 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.2 2002/01/08 10:09:35 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIB variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIB="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIB="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIB="$OPENAL_LIB -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIB" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIB) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" = "no" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.2&content-type=text/plain&only_with_tag=MAIN/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.2&content-type=text/plain&only_with_tag=MAIN/index.html new file mode 100644 index 00000000..deb5def1 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.2&content-type=text/plain&only_with_tag=MAIN/index.html @@ -0,0 +1,1068 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.2 2002/01/08 10:09:35 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIB variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIB="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIB="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIB="$OPENAL_LIB -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIB" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIB) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" = "no" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.2&content-type=text/plain&sortby=author/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.2&content-type=text/plain&sortby=author/index.html new file mode 100644 index 00000000..deb5def1 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.2&content-type=text/plain&sortby=author/index.html @@ -0,0 +1,1068 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.2 2002/01/08 10:09:35 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIB variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIB="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIB="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIB="$OPENAL_LIB -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIB" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIB) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" = "no" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.3 b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.3 new file mode 100644 index 00000000..adad0b43 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.3 @@ -0,0 +1,1076 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.3 2002/01/10 14:33:19 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIB variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIB="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIB="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIB="$OPENAL_LIB -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIB" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIB) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.3&content-type=text/plain&sortby=rev/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.3&content-type=text/plain&sortby=rev/index.html new file mode 100644 index 00000000..adad0b43 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.3&content-type=text/plain&sortby=rev/index.html @@ -0,0 +1,1076 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.3 2002/01/10 14:33:19 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIB variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIB="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIB="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIB="$OPENAL_LIB -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIB" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIB) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.4 b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.4 new file mode 100644 index 00000000..61c805d7 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.4 @@ -0,0 +1,1081 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.4 2002/01/22 14:24:56 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIB variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIB="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIB="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +if test "$nel_libraries" +then + NEL_LIBS="-L$nel_libraries" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIB="$OPENAL_LIB -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIB" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIB) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.4&content-type=text/plain&only_with_tag=MAIN/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.4&content-type=text/plain&only_with_tag=MAIN/index.html new file mode 100644 index 00000000..61c805d7 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.4&content-type=text/plain&only_with_tag=MAIN/index.html @@ -0,0 +1,1081 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.4 2002/01/22 14:24:56 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIB variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIB="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIB="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +if test "$nel_libraries" +then + NEL_LIBS="-L$nel_libraries" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIB="$OPENAL_LIB -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIB" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIB) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.4&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.4&content-type=text/plain/index.html new file mode 100644 index 00000000..61c805d7 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.4&content-type=text/plain/index.html @@ -0,0 +1,1081 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.4 2002/01/22 14:24:56 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIB variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIB="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIB="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +if test "$nel_libraries" +then + NEL_LIBS="-L$nel_libraries" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIB="$OPENAL_LIB -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIB" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIB) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.5 b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.5 new file mode 100644 index 00000000..68c8395e --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.5 @@ -0,0 +1,1081 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.5 2002/01/28 14:40:26 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIBS="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIBS="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +if test "$nel_libraries" +then + NEL_LIBS="-L$nel_libraries" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.6 b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.6 new file mode 100644 index 00000000..cab27813 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.6 @@ -0,0 +1,1086 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.6 2002/01/28 14:59:45 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_dir_lnk="$2" +nel_libraries="$3" +nel_test_lib="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + if test $nel_libraries + then + NEL_TEST_LIBS="-L$nel_libraries -l$nel_test_lib" + + else + NEL_TEST_LIBS="$nel_dir_lnk -l$nel_test_lib" + fi + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsound" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +nelconfig_libs_args="" + +if test "$nelnet_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-network" +fi + +if test "$nel3d_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-3d" +fi + +if test "$nelpacs_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-pacs" +fi + +if test "$nelsound_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-sound" +fi + +if test "$nelai_is_mandatory" != "yes" +then + nelconfig_libs_args="$nelconfig_libs_args --without-ai" +fi + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + NEL_LIBS=`nel-config --libs $nelconfig_libs_args` + + nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +if test "$nel_libraries" +then + NEL_LIBS="-L$nel_libraries" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.7 b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.7 new file mode 100644 index 00000000..a7fcf13f --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.7 @@ -0,0 +1,1054 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.7 2002/01/29 13:21:42 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_libraries="$2" +nel_test_lib="$3" +nel_additional_libs="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + NEL_TEST_LIBS="$NEL_LIBS $nel_additional_libs -l$nel_test_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $LIBS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsnd" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + + NEL_LIBS_CONFIG=`nel-config --libs` + + NEL_LIBS=`echo '$NEL_LIBS_CONFIG' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +if test "$nel_libraries" +then + NEL_LIBS="-L$nel_libraries" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_libraries, $nel_misc_lib, "", $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network],$nel_libraries, $nel_net_lib, "-lnelmisc", $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_libraries, $nel_3d_lib, "-lnelmisc", $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_libraries, $nel_pacs_lib, "-lnelmisc", $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_libraries, $nel_ai_lib, "-lnelmisc", $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_libraries, $nel_sound_lib, "-lnelmisc" $OPENAL_LIBS, $nelsound_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.7&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.7&content-type=text/plain/index.html new file mode 100644 index 00000000..a7fcf13f --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.7&content-type=text/plain/index.html @@ -0,0 +1,1054 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.7 2002/01/29 13:21:42 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_libraries="$2" +nel_test_lib="$3" +nel_additional_libs="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + NEL_TEST_LIBS="$NEL_LIBS $nel_additional_libs -l$nel_test_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $LIBS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsnd" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + + NEL_LIBS_CONFIG=`nel-config --libs` + + NEL_LIBS=`echo '$NEL_LIBS_CONFIG' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +if test "$nel_libraries" +then + NEL_LIBS="-L$nel_libraries" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_libraries, $nel_misc_lib, "", $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network],$nel_libraries, $nel_net_lib, "-lnelmisc", $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_libraries, $nel_3d_lib, "-lnelmisc", $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_libraries, $nel_pacs_lib, "-lnelmisc", $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_libraries, $nel_ai_lib, "-lnelmisc", $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_libraries, $nel_sound_lib, "-lnelmisc" $OPENAL_LIBS, $nelsound_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +stlport_lib="stlport_gcc" + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.8&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.8&content-type=text/plain/index.html new file mode 100644 index 00000000..7d877590 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.8&content-type=text/plain/index.html @@ -0,0 +1,1059 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.8 2002/02/18 12:58:38 lecroart Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_libraries="$2" +nel_test_lib="$3" +nel_additional_libs="$4" +is_mandatory="$5" + +if test $is_mandatory = "yes" +then + + AC_MSG_CHECKING(for -l$nel_test_lib) + + NEL_TEST_LIBS="$NEL_LIBS $nel_additional_libs -l$nel_test_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $LIBS $NEL_TEST_LIBS" + + AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_nel_test_libraries" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nel_misc_lib="nelmisc" +nel_net_lib="nelnet" +nel_3d_lib="nel3d" +nel_pacs_lib="nelpacs" +nel_sound_lib="nelsnd" +nel_ai_lib="nelai" + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +if test "$NEL_CONFIG" = "no" +then + have_nel_config="no" +else + NEL_CFLAGS=`nel-config --cflags` + + NEL_LIBS_CONFIG=`nel-config --libs` + + NEL_LIBS=`echo '$NEL_LIBS_CONFIG' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` + + have_nel_config="yes" +fi + +if test "$with_nel" +then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +if test "$nel_includes" +then + NEL_CFLAGS="-I$nel_includes" +fi + +if test "$nel_libraries" +then + NEL_LIBS="-L$nel_libraries" +fi + +dnl Checking for NeL headers +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl Checking for NeL libraries +MY_NEL_LIB_CHK([NeL Misc], $nel_libraries, $nel_misc_lib, "", $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network],$nel_libraries, $nel_net_lib, "-lnelmisc", $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], $nel_libraries, $nel_3d_lib, "-lnelmisc", $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], $nel_libraries, $nel_pacs_lib, "-lnelmisc", $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], $nel_libraries, $nel_ai_lib, "-lnelmisc", $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], $nel_libraries, $nel_sound_lib, "-lnelmisc" $OPENAL_LIBS, $nelsound_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_CHECKING(STLPort) + have_stlport="disabled" + AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) +else + if test "$with_stlport" + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test -z "$have_stlport" -a "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test -z "$have_stlport" -a "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +if test -z "$have_stlport" +then + dnl Put STLPorts includes in CXXFLAGS + if test "$stlport_includes" + then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" + fi + + dnl Put STLPorts libraries in LIBS + if test "$stlport_libraries" + then + LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" + fi + + dnl Test the headers + AC_MSG_CHECKING(for STLPort headers) + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS" + + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + have_stlport_headers="yes", + have_stlport_headers="no" ) + + if test "$have_stlport_headers" = "yes" + then + AC_MSG_RESULT([$stlport_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for STLPort libraries) + + CPPFLAGS="$CXXFLAGS $LIBS" + + AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_stlport_libraries" = "yes" + then + AC_MSG_RESULT([$stlport_libraries]) + else + AC_MSG_RESULT(no) + fi + + if test "$have_stlport_headers" = "yes" \ + && test "$have_stlport_libraries" = "yes" + then + have_stlport="yes" + else + have_stlport="no" + fi + + if test "$have_stlport" = "no" + then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) + fi + +fi + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.9 b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.9 new file mode 100644 index 00000000..999d4822 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.9 @@ -0,0 +1,1046 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.9 2002/03/19 17:42:48 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.9&content-type=text/plain&sortby=date/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.9&content-type=text/plain&sortby=date/index.html new file mode 100644 index 00000000..999d4822 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/acinclude.m4?rev=1.9&content-type=text/plain&sortby=date/index.html @@ -0,0 +1,1046 @@ +dnl ========================================================================= +dnl +dnl Macros used by Nevrax in configure.in files. +dnl +dnl $Id: acinclude.m4,v 1.9 2002/03/19 17:42:48 valignat Exp $ +dnl +dnl ========================================================================= + +dnl ========================================================================= +dnl WARNING: The original version of this file is placed in the $CVSROOT/code +dnl directory. +dnl There is links in the $CVSROOT/code sub-directories to that file +dnl (ex: $CVSROOT/code/nel), so be careful of the consequences of +dnl any modification of that file. +dnl ========================================================================= + +dnl ========================================================================= +dnl Macros available in that file. +dnl +dnl +dnl AM_NEL_DEBUG +dnl +dnl Option: none. +dnl Description: manage the different debug and the release mode by setting +dnl correctly the CFLAGS and CXXFLAGS variables. +dnl +dnl +dnl AM_PATH_NEL +dnl +dnl Option: none. +dnl Description: check the instalation of the NeL library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_STLPORT +dnl +dnl Option: none. +dnl Description: check the instalation of the STLPort library and set the +dnl CXXFLAGS and LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENGL +dnl +dnl Option: "yes" if the use of the OpenGL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENGL_CFLAGS and OPENGL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_FREETYPE +dnl +dnl Option: "yes" if the use of the Freetype library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_XF86VIDMODE +dnl +dnl Option: none. +dnl Description: check the instalation of the OpenGL library and set the +dnl XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_OPENAL +dnl +dnl Option: "yes" if the use of the OpenAL library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl OPENAL_CFLAGS and OPENAL_LIBS variables to use it. +dnl +dnl +dnl AM_PATH_PYTHON +dnl +dnl Option: "yes" if the use of the Python library is mandatory. +dnl Description: check the instalation of the OpenGL library and set the +dnl PYTHON_CFLAGS and PYTHON_LIBS variables to use it. +dnl +dnl ========================================================================= + + +# ========================================================================= +# AM_NEL_DEBUG + +AC_DEFUN(AM_NEL_DEBUG, +[ + +MAX_C_OPTIMIZE="-O6" + +STL_DEBUG="-D__STL_DEBUG" + +NL_DEBUG="-DNL_DEBUG" +NL_DEBUG_FAST="-DNL_DEBUG_FAST" +NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG" +NL_RELEASE="-DNL_RELEASE" + +AC_ARG_WITH(debug, + [ --with-debug[=full|medium|fast] + Build a debug version (huge libraries). + Full mode set only NeL and STL debug flags. + Medium mode set NeL debug flags with inline + optimization (default mode). + Fast mode is like the Medium mode with some basic + optimization. + --without-debug Build without debugging code (default)], + [with_debug=$withval], + [with_debug=no]) + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi + +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_INLINE_CXXFLAGS="-finline-functions" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" + OPTIMIZE_INLINE_CXXFLAGS="" +fi + +if test "$with_debug" = "yes" -o "$with_debug" = "medium" +then + dnl Medium debug. Inline optimization + CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS" +else + if test "$with_debug" = "full" + then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS" + else + if test "$with_debug" = "fast" + then + dnl Fast debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS" + else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS" + fi + fi +fi + +dnl AC_MSG_RESULT([CFLAGS = $CFLAGS]) +dnl AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS]) + +]) + + +# ========================================================================= +# MY_NEL_HEADER_CHK : NeL header files checking macros + +AC_DEFUN(MY_NEL_HEADER_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +header="$2" +macro="$3" +is_mandatory="$4" + +if test $is_mandatory = "yes" +then + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $NEL_CFLAGS" + + AC_MSG_CHECKING(for $header) + + AC_EGREP_CPP( yo_header, +[#include <$header> +#ifdef $macro + yo_header +#endif], + have_header="yes", + have_header="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_header" = "yes" + then + AC_MSG_RESULT(yes) + else + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).]) + else + AC_MSG_RESULT(no) + fi + fi +fi + + +]) + + +# ========================================================================= +# MY_NEL_LIB_CHK : NeL library checking macros + +AC_DEFUN(MY_NEL_LIB_CHK, +[ AC_REQUIRE_CPP() + +chk_message_obj="$1" +nel_test_lib="$2" +is_mandatory="$3" + +if test $is_mandatory = "yes" +then + + AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])]) +fi +]) + + +# ========================================================================= +# AM_PATH_NEL : NeL checking macros +AC_DEFUN(AM_PATH_NEL, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( nel, + [ --with-nel=<path> path to the NeL install files directory. + e.g. /usr/local/nel]) + +AC_ARG_WITH( nel-include, + [ --with-nel-include=<path> + path to the NeL header files directory. + e.g. /usr/local/nel/stlport]) + +AC_ARG_WITH( nel-lib, + [ --with-nel-lib=<path> + path to the NeL library files directory. + e.g. /usr/local/nel/lib]) + + +nelmisc_is_mandatory="$1" +nelnet_is_mandatory="$2" +nel3d_is_mandatory="$3" +nelpacs_is_mandatory="$4" +nelsound_is_mandatory="$5" +nelai_is_mandatory="$6" + +dnl Check for nel-config +AC_PATH_PROG(NEL_CONFIG, nel-config, no) + +dnl +dnl Configure options (--with-nel*) have precendence +dnl over nel-config only set variables if they are not +dnl specified +dnl +if test "$NEL_CONFIG" != "no" +then + if test -z "$with_nel" -a -z "$with_nel_include" + then + CXXFLAGS="$CXXFLAGS `nel-config --cflags`" + fi + + if test -z "$with_nel" -a -z "$with_nel_lib" + then + LDFLAGS="`nel-config --ldflags` $LDFLAGS" + fi +fi + +dnl +dnl Set nel_libraries and nel_includes according to +dnl user specification (--with-nel*) if any. +dnl --with-nel-include and --with-nel-lib have precendence +dnl over --with-nel +dnl +if test "$with_nel" = "no" +then + dnl The user explicitly disabled the use of the NeL + AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) +else + if test "$with_nel" -a "$with_nel" != "yes" + then + nel_includes="$with_nel/include" + nel_libraries="$with_nel/lib" + fi +fi + +if test "$with_nel_include" +then + nel_includes="$with_nel_include" +fi + +if test "$with_nel_lib" +then + nel_libraries="$with_nel_lib" +fi + +dnl +dnl Set compilation variables +dnl +if test "$nel_includes" +then + CXXFLAGS="$CXXFLAGS -I$nel_includes" +fi + +if test "$nel_libraries" +then + LDFLAGS="-L$nel_libraries $LDFLAGS" +fi + +dnl +dnl Collect headers information and bark if missing and +dnl mandatory +dnl + +MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) +MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) +MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) +MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory) +MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) +MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) + +dnl +dnl Collect libraries information and bark if missing and +dnl mandatory +dnl + +MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) +MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) +MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) +MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) +MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) +MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) + +]) + + +# ========================================================================= +# AM_PATH_STLPORT : STLPort checking macros + +AC_DEFUN(AM_PATH_STLPORT, +[ AC_REQUIRE_CPP() + +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport]) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport]) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib]) + +if test "$with_debug" = "full" +then + stlport_lib="stlport_gcc_stldebug" +else + stlport_lib="stlport_gcc" +fi + +if test "$with_stlport" = no +then + dnl The user explicitly disabled the use of the STLPorts + AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) +else + stlport_includes="/usr/include/stlport" + if test "$with_stlport" -a "$with_stlport" != yes + then + stlport_includes="$with_stlport/stlport" + stlport_libraries="$with_stlport/lib" + + if test ! -d "$stlport_includes" + then + stlport_includes="$with_stlport/include/stlport" + fi + fi +fi + +if test "$with_stlport_include" +then + stlport_includes="$with_stlport_include" +fi + +if test "$with_stlport_lib" +then + stlport_libraries="$with_stlport_lib" +fi + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +dnl Put STLPorts includes in CXXFLAGS +if test "$stlport_includes" +then + CXXFLAGS="$CXXFLAGS -I$stlport_includes" +fi + +dnl Put STLPorts libraries directory in LIBS +if test "$stlport_libraries" +then + LIBS="-L$stlport_libraries $LIBS" +else + stlport_libraries='default' +fi + +dnl Test the headers + +AC_CHECK_HEADER(algorithm, + have_stlport_headers="yes", + have_stlport_headers="no" ) + +AC_MSG_CHECKING(for STLPort headers) + +if test "$have_stlport_headers" = "yes" +then + AC_MSG_RESULT([$stlport_includes]) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") + +AC_MSG_CHECKING(for STLPort library) + +if test "$have_stlport_libraries" != "no" +then + AC_MSG_RESULT([$stlport_libraries]) +else + AC_MSG_RESULT(no) +fi + +if test "$have_stlport_headers" = "yes" && + test "$have_stlport_libraries" != "no" +then + have_stlport="yes" +else + have_stlport="no" +fi + +if test "$have_stlport" = "no" +then + AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) +fi + +AC_LANG_RESTORE + +]) + + +# ========================================================================= +# AM_PATH_OPENGL : OpenGL checking macros + +AC_DEFUN(AM_PATH_OPENGL, +[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2) + +is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( opengl, + [ --with-opengl=<path> path to the OpenGL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( opengl-include, + [ --with-opengl-include=<path> + path to the OpenGL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( opengl-lib, + [ --with-opengl-lib=<path> + path to the OpenGL library files directory. + e.g. /usr/local/lib]) + +opengl_lib="GL" + +if test "$with_opengl" +then + opengl_includes="$with_opengl/include" + opengl_libraries="$with_opengl/lib" +fi + +if test "$with_opengl_include" +then + opengl_includes="$with_opengl_include" +fi + +if test "$with_opengl_lib" +then + opengl_libraries="$with_opengl_lib" +fi + +dnl Set OPENGL_CFLAGS +if test "$opengl_includes" +then + OPENGL_CFLAGS="-I$opengl_includes" +fi + +dnl Set OPENGL_LIBS +if test "$opengl_libraries" +then + OPENGL_LIBS="-L$opengl_libraries" +fi +OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib" + +dnl Test the headers +_CPPFLAGS="$CPPFLAGS" + +CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS" + +AC_EGREP_CPP( yo_opengl, +[#include <GL/gl.h> +#if defined(GL_VERSION_1_2) + yo_opengl +#endif], + have_opengl_headers="yes", + have_opengl_headers="no" ) + +if test "$have_opengl_headers" = "yes" +then + if test "$opengl_includes" + then + AC_MSG_RESULT([$opengl_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Checking the GLEXT version >= 7 +AC_MSG_CHECKING(for <GL/glext.h> and GLEXT version >= 7) + +AC_EGREP_CPP( yo_glext_version, +[#include <GL/glext.h> +#ifdef GL_GLEXT_VERSION +#if GL_GLEXT_VERSION >= 7 + yo_glext_version +#endif +#endif], + have_glext="yes", + have_glext="no" ) + +if test "$have_glext" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT([no, <GL/glext.h> can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/]) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenGL libraries) + +CPPFLAGS="$CXXFLAGS $OPENGL_LIBS" + +AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_opengl_libraries" = "yes" +then + if test "$opengl_libraries" + then + AC_MSG_RESULT([$opengl_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +opengl_libraries="$opengl_libraries" + +if test "$have_opengl_headers" = "yes" \ + -a "$have_glext" = "yes" \ + -a "$have_opengl_libraries" = "yes" +then + have_opengl="yes" +else + have_opengl="no" +fi + +if test "$have_opengl" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)]) +fi + +AC_SUBST(OPENGL_CFLAGS) +AC_SUBST(OPENGL_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_FREETYPE : FreeType checking macros + +AC_DEFUN(AM_PATH_FREETYPE, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +AC_ARG_WITH( freetype, + [ --with-freetype=<path> path to the FreeType install files directory. + e.g. /usr/local/freetype]) + +AC_ARG_WITH( freetype-include, + [ --with-freetype-include=<path> + path to the FreeType header files directory. + e.g. /usr/local/freetype/include]) + +AC_ARG_WITH( freetype-lib, + [ --with-freetype-lib=<path> + path to the FreeType library files directory. + e.g. /usr/local/freetype/lib]) + +freetype_lib="freetype" + + +AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) + +if test "$FREETYPE_CONFIG" = "no" +then + have_freetype_config="no" +else + FREETYPE_CFLAGS=`freetype-config --cflags` + FREETYPE_LIBS=`freetype-config --libs` + have_freetype_config="yes" +fi + +if test "$with_freetype" +then + freetype_includes="$with_freetype/include" + freetype_libraries="$with_freetype/lib" +fi + +if test "$with_freetype_include" +then + freetype_includes="$with_freetype_include" +fi + +if test "$with_freetype_lib" +then + freetype_libraries="$with_freetype_lib" +fi + +if test "$freetype_includes" +then + FREETYPE_CFLAGS="-I$freetype_includes" +fi + +dnl Checking the FreeType 2 instalation +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + +AC_MSG_CHECKING(for FreeType version = 2) + +AC_EGREP_CPP( yo_freetype2, +[#include <freetype/freetype.h> +#if FREETYPE_MAJOR == 2 + yo_freetype2 +#endif], + have_freetype2="yes", + have_freetype2="no") + +if test "$have_freetype2" = "yes" +then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for FreeType libraries) + +if test $freetype_libraries +then + FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib" +fi + +CPPFLAGS="$CXXFLAGS $FREETYPE_LIBS" + +AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_freetype_libraries" = "yes" +then + if test "$freetype_libraries" + then + AC_MSG_RESULT([$freetype_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes" +then + have_freetype="yes" +else + have_freetype="no" +fi + +if test "$have_freetype" = "no" && test "$is_mandatory" = "yes" +then + AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)]) +fi + +AC_SUBST(FREETYPE_CFLAGS) +AC_SUBST(FREETYPE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_XF86VIDMODE : XF86VidMode checking macros + +AC_DEFUN(AM_PATH_XF86VIDMODE, +[ AC_MSG_CHECKING(for XF86VidMode extension) + +AC_REQUIRE_CPP() + +AC_ARG_WITH( xf86vidmode-lib, + [ --with-xf86vidmode-lib=<path> + path to the XF86VidMode library. + e.g. /usr/X11R6/lib] ) + +xf86vidmode_lib="Xxf86vm" + +if test "$with_xf86vidmode_lib" = no +then + dnl The user explicitly disabled the use of XF86VidMode + have_xf86vidmode="disabled" + AC_MSG_RESULT(disabled) +else + if test "$with_xf86vidmode_lib" + then + xf86vidmode_libraries="$with_xf86vidmode_lib" + fi + + XF86VIDMODE_CFLAGS="-DXF86VIDMODE" +fi + +if test -z "$have_xf86vidmode" +dnl -a "$with_xf86vidmode_lib" +then + if test "$xf86vidmode_libraries" + then + XF86VIDMODE_LIBS="-L$xf86vidmode_libraries" + fi + + XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib" + + _CPPFLAGS="$CPPFLAGS" + + CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS" + + AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_xf86vidmode_libraries" = "yes" + then + have_xf86vidmode="yes" + if test "$xf86vidmode_libraries" + then + AC_MSG_RESULT($xf86vidmode_libraries) + else + AC_MSG_RESULT(yes) + fi + else + have_xf86vidmode="no" + AC_MSG_RESULT(no, no fullscreen support available.) + fi + + xf86vidmode_libraries="$xf86vidmode_libraries" + +fi + +AC_SUBST(XF86VIDMODE_CFLAGS) +AC_SUBST(XF86VIDMODE_LIBS) + +]) + + +# ========================================================================= +# AM_PATH_OPENAL : OpenAL checking macros + +AC_DEFUN(AM_PATH_OPENAL, +[ is_mandatory="$1" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the OpenAL files location +AC_ARG_WITH( openal, + [ --with-openal=<path> path to the OpenAL install files directory. + e.g. /usr/local]) + +AC_ARG_WITH( openal-include, + [ --with-openal-include=<path> + path to the OpenAL header files directory. + e.g. /usr/local/include]) + +AC_ARG_WITH( openal-lib, + [ --with-openal-lib=<path> + path to the OpenAL library files directory. + e.g. /usr/local/lib]) + +openal_lib="openal" + +if test $with_openal +then + openal_includes="$with_openal/include" + openal_libraries="$with_openal/lib" +fi + +if test "$with_openal_include" +then + openal_includes="$with_openal_include" +fi + +if test "$with_openal_lib" +then + openal_libraries="$with_openal_lib" +fi + + +dnl Set OPENAL_CFLAGS +if test "$openal_includes" +then + OPENAL_CFLAGS="-I$openal_includes" +fi + +dnl Set OPENAL_LIBS +if test "$openal_libraries" +then + OPENAL_LIBS="-L$openal_libraries" +fi +OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS" + +AC_MSG_CHECKING(for OpenAL headers) +AC_EGREP_CPP( yo_openal, +[#include <AL/altypes.h> +#ifdef AL_VERSION + yo_openal +#endif], + have_openal_headers="yes", + have_openal_headers="no" ) + +if test "$have_openal_headers" = "yes" +then + if test "$openal_includes" + then + AC_MSG_RESULT([$openal_includes]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +dnl Test the libraries +AC_MSG_CHECKING(for OpenAL libraries) + +CPPFLAGS="$CXXFLAGS $OPENAL_LIBS" + +AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no") + +CPPFLAGS="$_CPPFLAGS" + +if test "$have_openal_libraries" = "yes" +then + if test "$openal_libraries" + then + AC_MSG_RESULT([$openal_libraries]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +openal_libraries="$openal_libraries" + +if test "$have_openal_headers" = "yes" \ + && test "$have_openal_libraries" = "yes" +then + have_openal="yes" +else + have_openal="no" +fi + +if test "$have_openal" = "no" -a "$is_mandatory" = "yes" +then + AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).]) +fi + +AC_SUBST(OPENAL_CFLAGS) +AC_SUBST(OPENAL_LIBS) + + +]) + + +# ========================================================================= +# AM_PATH_PYTHON : Python checking macros + +AC_DEFUN(AM_PATH_PYTHON, +[ python_version_required="$1" + +is_mandatory="$2" + +AC_REQUIRE_CPP() + +dnl Get from the user option the path to the Python files location +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [ PYTHON_PREFIX=$with_python ] +) + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [ PYTHON_VERSION=$with_python_version ] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.1 python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) + +if test "$PYTHON" != "no" +then + PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` + PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + + is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION` +fi + + +if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1" +then + + if test "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)]) + else + have_python="no" + fi + +else + + python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION" + python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config" + python_lib="python$PYTHON_VERSION" + + PYTHON_CFLAGS="-I$python_includes" + PYTHON_LIBS="-L$python_libraries -l$python_lib" + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + + dnl Test the headers + AC_MSG_CHECKING(for Python headers) + + AC_EGREP_CPP( yo_python, + [#include <Python.h> + yo_python + ], + have_python_headers="yes", + have_python_headers="no" ) + + if test "$have_python_headers" = "yes" + then + AC_MSG_RESULT([$python_includes]) + else + AC_MSG_RESULT(no) + fi + + dnl Test the libraries + AC_MSG_CHECKING(for Python libraries) + + CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS" + + AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") + + CPPFLAGS="$_CPPFLAGS" + + if test "$have_python_libraries" = "yes" + then + if test "$python_libraries" + then + AC_MSG_RESULT([$python_libraries]) + else + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + + if test "$have_python_headers" = "yes" \ + && test "$have_python_libraries" = "yes" + then + have_python="yes" + else + have_python="no" + fi + + if test "$have_python" = "no" -a "$is_mandatory" = "yes" + then + AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).]) + fi + + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + +fi + +]) + + +dnl ========================================================================= +dnl End of file diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Attic/sysload.h?rev=1.1&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Attic/sysload.h?rev=1.1&content-type=text/plain/index.html new file mode 100644 index 00000000..4291e873 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Attic/sysload.h?rev=1.1&content-type=text/plain/index.html @@ -0,0 +1,43 @@ +/** \file sysload.h + * + * $Id: sysload.h,v 1.1 2001/04/18 13:54:25 valignat Exp $ + */ + +/* Copyright, 2000 Nevrax Ltd. + * + * This file is part of NEVRAX NeL Network Services + * NEVRAX NeL Network Services 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, or (at your option) + * any later version. + * + * NEVRAX NeL Network Services 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. + * + * You should have received a copy of the GNU General Public License + * along with NEVRAX NeL Network Services; see the file COPYING. If not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + + +#ifndef NL_SYSLOAD_H +#define NL_SYSLOAD_H + + +class CSysLoad +{ +public: + CSysLoad ( void ); + ~CSysLoad ( void ); + + /// Returns the system load + double getLoadInfo ( void ); +}; + + +#endif // NL_SYSLOAD_H + +// End of sysload.h diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.3&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.3&content-type=text/plain/index.html new file mode 100644 index 00000000..3582ac47 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.3&content-type=text/plain/index.html @@ -0,0 +1,14 @@ +# +# $Id: Makefile.am,v 1.3 2001/05/03 13:19:13 lecroart Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in + +bin_PROGRAMS = admin_executor_service + +admin_executor_service_SOURCES = admin_executor_service.cpp + +admin_executor_service_LDADD = -lnelnet -lnelmisc + + +# End of Makefile.am diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.4&content-type=text/plain&sortby=date/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.4&content-type=text/plain&sortby=date/index.html new file mode 100644 index 00000000..8fb69ecf --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.4&content-type=text/plain&sortby=date/index.html @@ -0,0 +1,15 @@ +# +# $Id: Makefile.am,v 1.4 2001/07/27 15:51:10 valignat Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in + +bin_PROGRAMS = admin_executor_service + +admin_executor_service_SOURCES = admin_executor_service.cpp + +admin_executor_service_LDADD = -lnelnet -lnelmisc + + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.5&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.5&content-type=text/plain/index.html new file mode 100644 index 00000000..2edf32ad --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.5&content-type=text/plain/index.html @@ -0,0 +1,17 @@ +# +# $Id: Makefile.am,v 1.5 2002/03/19 17:42:48 valignat Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = admin_executor_service.cfg \ + admin_executor_service.dsp + +sbin_PROGRAMS = admin_executor_service + +admin_executor_service_SOURCES = admin_executor_service.cpp + +pkgsysconf_DATA = admin_executor_service.cfg + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.6 b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.6 new file mode 100644 index 00000000..bc71c7a8 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.6 @@ -0,0 +1,15 @@ +# +# $Id: Makefile.am,v 1.6 2002/04/10 07:33:07 lecroart Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = admin_executor_service.cfg \ + admin_executor_service.dsp + +sbin_PROGRAMS = admin_executor_service + +admin_executor_service_SOURCES = admin_executor_service.cpp + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.6&content-type=text/plain&sortby=date/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.6&content-type=text/plain&sortby=date/index.html new file mode 100644 index 00000000..bc71c7a8 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.6&content-type=text/plain&sortby=date/index.html @@ -0,0 +1,15 @@ +# +# $Id: Makefile.am,v 1.6 2002/04/10 07:33:07 lecroart Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = admin_executor_service.cfg \ + admin_executor_service.dsp + +sbin_PROGRAMS = admin_executor_service + +admin_executor_service_SOURCES = admin_executor_service.cpp + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.7&content-type=text/plain&sortby=date/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.7&content-type=text/plain&sortby=date/index.html new file mode 100644 index 00000000..06b4d371 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/Makefile.am?rev=1.7&content-type=text/plain&sortby=date/index.html @@ -0,0 +1,16 @@ +# +# $Id: Makefile.am,v 1.7 2002/06/12 10:21:25 lecroart Exp $ +# + +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = admin_executor_service.cfg \ + admin_executor_service.dsp \ + common.cfg + +sbin_PROGRAMS = admin_executor_service + +admin_executor_service_SOURCES = admin_executor_service.cpp + +# End of Makefile.am + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.2&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.2&content-type=text/plain/index.html new file mode 100644 index 00000000..d751b593 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.2&content-type=text/plain/index.html @@ -0,0 +1,10 @@ + +Services = { "TS", "NS" }; + +NS = { "r:\code\nelns\naming_service", "r:\code\nelns\naming_service\debug\naming_service.exe" }; +TS = { "r:\code\nelns\time_service", "r:\code\nelns\time_service\debug\time_service.exe" }; + +XWinParam = 0; +YWinParam = 250; +WWinParam = 1200; +HWinParam = 300; diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.5&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.5&content-type=text/plain/index.html new file mode 100644 index 00000000..9cae3d77 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.5&content-type=text/plain/index.html @@ -0,0 +1,8 @@ + +Services = { "NS", "LS", "WS" }; + +NS = { "r:\code\nelns\naming_service", "r:\code\nelns\naming_service\debug\naming_service.exe" }; +LS = { "r:\code\nelns\login_service", "r:\code\nelns\login_service\debug\login_service.exe" }; +WS = { "r:\code\nelns\welcome_service", "r:\code\nelns\welcome_service\debug\welcome_service.exe" }; + +WindowStyle = "WIN"; diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.6&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.6&content-type=text/plain/index.html new file mode 100644 index 00000000..198b84c7 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.6&content-type=text/plain/index.html @@ -0,0 +1,10 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +Services = { "NS", "LS", "WS" }; + +NS = { "r:\code\nelns\naming_service", "r:\code\nelns\naming_service\debug\naming_service.exe" }; +LS = { "r:\code\nelns\login_service", "r:\code\nelns\login_service\debug\login_service.exe" }; +WS = { "r:\code\nelns\welcome_service", "r:\code\nelns\welcome_service\debug\welcome_service.exe" }; + +WindowStyle = "WIN"; diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.7 b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.7 new file mode 100644 index 00000000..eecb0621 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cfg?rev=1.7 @@ -0,0 +1,8 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +Services = { "NS", "LS", "WS" }; + +NS = { "r:\code\nelns\naming_service", "r:\code\nelns\naming_service\debug\naming_service.exe" }; +LS = { "r:\code\nelns\login_service", "r:\code\nelns\login_service\debug\login_service.exe" }; +WS = { "r:\code\nelns\welcome_service", "r:\code\nelns\welcome_service\debug\welcome_service.exe" }; diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?content-type=text/plain&rev=1.12 b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?content-type=text/plain&rev=1.12 new file mode 100644 index 00000000..3e29a0ba --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?content-type=text/plain&rev=1.12 @@ -0,0 +1,518 @@ +/** \file admin_executor_service.cpp + * Admin Executor Service (AES) + * + * $Id: admin_executor_service.cpp,v 1.12 2001/10/22 10:35:49 lecroart Exp $ + * + */ + +/* Copyright, 2000 Nevrax Ltd. + * + * This file is part of NEVRAX NeL Network Services. + * NEVRAX NeL Network Services 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, or (at your option) + * any later version. + * + * NEVRAX NeL Network Services 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. + * + * You should have received a copy of the GNU General Public License + * along with NEVRAX NeL Network Services; see the file COPYING. If not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#include <fcntl.h> +#include <sys/stat.h> + +#include "nel/misc/types_nl.h" + +#ifdef NL_OS_WINDOWS +#include <windows.h> +#include <direct.h> +#else +#include <unistd.h> +#endif + +#include <string> +#include <list> + +#include "nel/misc/debug.h" +#include "nel/misc/config_file.h" +#include "nel/misc/thread.h" +#include "nel/misc/command.h" + +#include "nel/net/service.h" +#include "nel/net/net_manager.h" + +#ifdef NL_OS_WINDOWS +#define getcwd _getcwd +#define chdir _chdir +#endif + + +using namespace std; +using namespace NLMISC; +using namespace NLNET; + + + +struct CService +{ + CService(TSockId s) : SockId(s), Id(NextId++), Ready(false) { } + + TSockId SockId; /// connection to the service + uint32 Id; /// uint32 to identify the service + string AliasName; /// alias of the service used in the AES and AS to find him (unique per AES) + string ShortName; /// name of the service in short format ("NS" for example) + string LongName; /// name of the service in long format ("naming_service") + bool Ready; /// true if the service is ready + vector<CSerialCommand> Commands; + +private: + static uint32 NextId; +}; + +uint32 CService::NextId = 1; + +list<CService> Services; +typedef list<CService>::iterator SIT; + +SIT find (TSockId sid) +{ + SIT sit; + for (sit = Services.begin(); sit != Services.end(); sit++) + { + if ((*sit).SockId == sid) break; + } + return sit; +} + +SIT findService (uint32 sid, bool asrt = true) +{ + SIT sit; + for (sit = Services.begin(); sit != Services.end(); sit++) + { + if ((*sit).Id == sid) break; + } + if (asrt) + nlassert (sit != Services.end()); + return sit; +} + + +class CExecuteCommandThread : public IRunnable +{ +public: + string Command, Path; + + CExecuteCommandThread (string command, string path = "") : Command(command), Path(path) { } + + void run () + { + nlinfo ("start executing '%s' in '%s' directory", Command.c_str(), Path.c_str()); + + char oldpath[256]; + if (!Path.empty()) + { + getcwd(oldpath,256); + chdir(Path.c_str()); + } + + system (Command.c_str()); + + if (!Path.empty()) + chdir(oldpath); + + nlinfo ("end executing: %s", Command.c_str()); + } +}; + +class CExecuteServiceThread : public IRunnable +{ +public: + string ServiceAlias, ServiceCommand, ServicePath; + + CExecuteServiceThread (string serviceAlias, string serviceCommand, string servicePath = "") : + ServiceCommand(serviceCommand), ServicePath(servicePath), ServiceAlias(serviceAlias) { } + + void run () + { + nlinfo ("start service '%s' '%s' in '%s' directory", ServiceAlias.c_str(), ServiceCommand.c_str(), ServicePath.c_str()); + + char oldpath[256]; + if (!ServicePath.empty()) + { + getcwd(oldpath,256); + chdir(ServicePath.c_str()); + } + +#ifdef NL_OS_WINDOWS + WinExec (ServiceCommand.c_str(), SW_MINIMIZE/*SW_SHOWNORMAL*/); +#else + system (ServiceCommand.c_str()); +#endif + + if (!ServicePath.empty()) + chdir(oldpath); + + nlinfo ("end service '%s' '%s' in '%s' directory", ServiceAlias.c_str(), ServiceCommand.c_str(), ServicePath.c_str()); + } +}; + +void executeCommand (string command, bool background) +{ + if (command.empty()) return; + +/* + nlinfo ("start executing: %s", command.c_str()); + if (command[command.size()-1] == '&') + { + command.resize(command.size()-2); + + if (spawnlp (_P_NOWAIT, cmd.c_str(), command.c_str(), NULL) == -1) + { + perror ("ca chie grave!!!!: "); + } + } + else + { + if (spawnlp (_P_WAIT, cmd.c_str(), command.c_str(), NULL) == -1) + { + perror ("ca chie grave!!!!: "); + } + } + nlinfo ("end executing: %s", command.c_str()); +*/ + +#ifdef NL_OS_WINDOWS + command += " >NUL:"; +#else + command += " >/dev/null"; +#endif + if (background) + { + IThread *thread = IThread::create (new CExecuteCommandThread (command)); + thread->start (); + } + else + { + CExecuteCommandThread cmdt (command); + cmdt.run (); + } +} + + +/* +// execute without +void executeCommand (string command, TSockId from, CCallbackNetBase &netbase) +{ + if (command.empty()) return; + + #define STDOUT 1 + #define STDERR 2 + int nul, oldstdout, oldstderr; + char *tmpfilename = tmpnam (NULL); + nul = _open(tmpfilename, _O_RDWR | _O_CREAT | _O_TRUNC | _O_TEMPORARY | _O_SHORT_LIVED | _O_EXCL, _S_IREAD | _S_IWRITE); + oldstdout = _dup(STDOUT); + oldstderr = _dup(STDERR); + _dup2(nul, STDOUT); + _dup2(nul, STDERR); + system(command.c_str()); + _dup2(oldstdout, STDOUT); + _dup2(oldstderr, STDERR); + _close(oldstdout); + _close(oldstderr); + + _lseek (nul, 0L, SEEK_SET); + + while (!_eof(nul)) + { + uint8 buffer[10000]; + uint32 nbread = _read (nul, buffer, 10000); + + CMessage msgout (netbase.getSIDA(), "ESCR"); + msgout.serial (nbread); + msgout.serialBuffer (buffer, nbread); + netbase.send (msgout, from); + } + + _close(nul); +*/ +/* + FILE *fp = fopen ("test.txt", "r"); + do + { + char str[1024]; + fgets (str, 1024, fp); + if (feof(fp)) break; + result.push_back (str); + } + while (true); + fclose (fp); +// remove ("test.txt"); +*///} + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// CONNECTION TO THE SERVICES ////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +static void cbServiceIdentification (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + + msgin.serial (s->AliasName, s->ShortName, s->LongName); + msgin.serialCont (s->Commands); + + nlinfo ("*:*:%d is identified to be '%s' '%s' '%s'", s->Id, s->AliasName.c_str(), s->ShortName.c_str(), s->LongName.c_str()); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SID"); + msgout.serial (s->Id, s->AliasName, s->ShortName, s->LongName); + msgout.serialCont (s->Commands); + CNetManager::send ("AESAS", msgout); +} + +static void cbServiceReady (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + + nlinfo ("*:*:%d is ready", s->Id); + s->Ready = true; + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SR"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); +} + +static void cbLog (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + // received an answer for a command, give it to the AS + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "XLOG"); + string log; + msgin.serial (log); + msgout.serial (s->Id); + msgout.serial (log); + CNetManager::send ("AESAS", msgout); +} + +void serviceConnection (const string &serviceName, TSockId from, void *arg) +{ + Services.push_back (CService (from)); + CService *s = &(Services.back()); + from->setAppId ((uint64)(uint)s); + + nlinfo ("*:*:%d connected", s->Id); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SC"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); +} + +void serviceDisconnection (const string &serviceName, TSockId from, void *arg) +{ + CService *s = (CService*) (uint) from->appId(); + + nlinfo ("*:*:%d disconnected", s->Id); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SD"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); + + // remove the service from the list + Services.erase (findService(s->Id)); +} + + +/** Callback Array + */ +TCallbackItem ServicesCallbackArray[] = +{ + { "SID", cbServiceIdentification }, + { "SR", cbServiceReady }, + { "LOG", cbLog }, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// CONNECTION TO THE AS //////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +void errorMessage(string message, TSockId from) +{ + CMessage msgout (CNetManager::getSIDA ("AESAS"), "ERR"); + msgout.serial (message); + CNetManager::send ("AESAS", msgout, from); +} + +static void cbExecuteSystemCommand (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + string command; + + msgin.serial (command); + + IThread *thread = IThread::create (new CExecuteCommandThread (command)); + thread->start (); +} + +static void cbStartService (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + string serviceAlias, command, path; + msgin.serial (serviceAlias); + + nlinfo ("Starting the service alias '%s'", serviceAlias.c_str()); + + try + { + path = IService::ConfigFile.getVar(serviceAlias).asString(0); + command = IService::ConfigFile.getVar(serviceAlias).asString(1); + } + catch(EConfigFile &e) + { + nlwarning ("error in serviceAlias '%s' in config file (%s)", serviceAlias.c_str(), e.what()); + return; + } + + // give the service alias to the service to forward it back when it will connected to the aes. + command += " -n"; + command += serviceAlias.c_str(); + +#ifdef NL_OS_WINDOWS + command += " >NUL:"; +#else + command += " >/dev/null"; +#endif + + IThread *thread = IThread::create (new CExecuteServiceThread (serviceAlias, command, path)); + thread->start (); +} + +static void cbStopService (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + uint32 sid; + + msgin.serial (sid); + + nlinfo ("I have to stop service '%s'"); + + SIT sit = findService (sid, false); + if (sit == Services.end()) + { + // don't find the aes, send an error message + errorMessage ("couldn't stop service, aes didn't find the service", from); + return; + } + + CMessage msgout (CNetManager::getSIDA("AES"), "STOPS"); + CNetManager::send ("AES", msgout, (*sit).SockId); +} + +static void cbExecCommand (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + uint32 sid; + string command; + + msgin.serial (sid); + msgin.serial (command); + + SIT sit = findService (sid, false); + if (sit == Services.end()) + { + // don't find the aes, send an error message + errorMessage ("couldn't stop service, aes didn't find the service", from); + return; + } + + CMessage msgout (CNetManager::getSIDA("AES"), "EXEC_COMMAND"); + msgout.serial (command); + CNetManager::send ("AES", msgout, (*sit).SockId); +} + +void loadAndSendServicesAliasList (CConfigFile::CVar &var); + +void cbASServiceConnection (const string &serviceName, TSockId from, void *arg) +{ + // new admin service, send him all out info about services + + nlinfo ("AS %s is connected", from->asString().c_str()); + + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SL"); + uint32 nbs = (uint32)Services.size(); + msgout.serial (nbs); + for (SIT sit = Services.begin(); sit != Services.end(); sit++) + { + msgout.serial ((*sit).Id, (*sit).AliasName, (*sit).ShortName, (*sit).LongName, (*sit).Ready); + msgout.serialCont ((*sit).Commands); + } + CNetManager::send ("AESAS", msgout, from); + + loadAndSendServicesAliasList (IService::ConfigFile.getVar ("Services")); +} + +TCallbackItem AESASCallbackArray[] = +{ + { "SYS", cbExecuteSystemCommand }, + { "STARTS", cbStartService }, + { "STOPS", cbStopService }, + { "EXEC_COMMAND", cbExecCommand }, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// SERVICE IMPLEMENTATION ////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +void loadAndSendServicesAliasList (CConfigFile::CVar &services) +{ + vector<string> servicesaliaslist; + for (sint i = 0 ; i < services.size (); i++) + { + servicesaliaslist.push_back (services.asString(i)); + } + + CMessage msgout2 (CNetManager::getSIDA ("AESAS"), "SAL"); + msgout2.serialCont (servicesaliaslist); + CNetManager::send ("AESAS", msgout2, 0); +} + + +class CAdminExecutorService : public IService +{ +public: + + /// Init the service, load the universal time. + void init () + { + CNetManager::setConnectionCallback ("AES", serviceConnection, NULL); + CNetManager::setDisconnectionCallback ("AES", serviceDisconnection, NULL); + + // install the server for AS + CNetManager::setConnectionCallback ("AESAS", cbASServiceConnection, NULL); + CNetManager::addServer ("AESAS", 49996); + CNetManager::addCallbackArray ("AESAS", AESASCallbackArray, sizeof(AESASCallbackArray)/sizeof(AESASCallbackArray[0])); + + ConfigFile.setCallback ("Services", loadAndSendServicesAliasList); + loadAndSendServicesAliasList (IService::ConfigFile.getVar ("Services")); + } + + bool update () + { + return true; + } +}; + + +/// Naming Service +NLNET_SERVICE_MAIN (CAdminExecutorService, "AES", "admin_executor_service", 49997, ServicesCallbackArray); diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.1&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.1&content-type=text/plain/index.html new file mode 100644 index 00000000..8a183cb4 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.1&content-type=text/plain/index.html @@ -0,0 +1,181 @@ +/** \file admin_executor_service.cpp + * Admin Executor Service (AES) + * + * $Id: admin_executor_service.cpp,v 1.1 2001/04/18 13:54:25 valignat Exp $ + */ + +/* Copyright, 2000 Nevrax Ltd. + * + * This file is part of NEVRAX NeL Network Services + * NEVRAX NeL Network Services 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, or (at your option) + * any later version. + * + * NEVRAX NeL Network Services 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. + * + * You should have received a copy of the GNU General Public License + * along with NEVRAX NeL Network Services; see the file COPYING. If not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#include <nel/misc/debug.h> +#include <nel/misc/log.h> +#include <nel/misc/common.h> +#include <nel/net/service.h> +#include <nel/net/net_displayer.h> + +#include "sysload.h" +#include "sysmem.h" +#include "sysswap.h" + +using namespace std; +using namespace NLMISC; +using namespace NLNET; + + +static const char UNKNOW_VALUE[] = "<Unknown>"; + + +CLog StatLog(CLog::LOG_STAT); + + +/// Log Stat data (STT) +void sendData (const char *str, TSenderId from) +{ + StatLog.displayNL( str ); +} + + +/// Log the last minute average load +void cbLoad ( CMessage& message, TSenderId from ) +{ + CSysLoad sysload = CSysLoad(); + double load = sysload.getLoadInfo(); + string answer( "LOAD " ); + + if ( load < 0 ) + { + answer.append( UNKNOW_VALUE ); + } + else + { + char str[6]; + smprintf( str, 6, "%.2f", load ); + answer.append( string(str) ); + } + + sendData( answer.c_str(), from ); +} + + +/// Log the total memory size and the used memory size (in B) +void cbMemory ( CMessage& message, TSenderId from ) +{ + CSysMemory sysmem = CSysMemory(); + sint memUsage = sysmem.getMemoryUsage(); + string answer( "MEM " ); + + if ( memUsage < 0 ) + { + answer.append( UNKNOW_VALUE ); + } + else + { + char str[3]; + smprintf( str, 3, "%d", memUsage ); + answer.append( string(str) ); + } + + sendData( answer.c_str(), from ); +} + + +/// Log the swap size and the used swap space (in kB) +void cbSwap ( CMessage& message, TSenderId from ) +{ + CSysSwap sysswap = CSysSwap(); + sint swapUsage = sysswap.getSwapUsage(); + string answer( "SWAP " ); + + if ( swapUsage < 0 ) + { + answer.append( UNKNOW_VALUE ); + } + else + { + char str[3]; + smprintf( str, 3, "%d", swapUsage ); + answer.append( string(str) ); + } + + sendData( answer.c_str(), from ); +} + + +// Log all the server informations. +void cbSystem ( CMessage& message, TSenderId from ) +{ + cbLoad ( message, from ); + cbMemory ( message, from ); + cbSwap ( message, from ); +} + + +/** + * Callback Array + * Message types: + * LOAD: log Load information + * MEMORY: log Memory information + * SWAP: log Swap information + * SYSTEM: log the Load, Memory, and Swap informations + */ +TCallbackItem CallbackArray[] = +{ + { "LOAD", cbLoad }, + { "MEMORY", cbMemory }, + { "SWAP", cbSwap }, + + { "SYSTEM", cbSystem } +}; + + + +/** Admin Executor Service (AES). + * Log informations (load, memory usage, etc ...) about the server it's + * running on. + * These informations are used by the Admin Service (AS) and the Naming + * Service (NS) to watch the differents servers of the shard. + */ +class CAdminExecutorService : public NLNET::IService +{ +public: + + /// Initializes the service + void init () + { + // Connect to the Log Service + StatLog.addDisplayer( new NLMISC::CStdDisplayer() ); + + NLNET::CNetDisplayer *nd = new NLNET::CNetDisplayer; + + if ( nd->connected() ) + { + StatLog.addDisplayer( nd ); + } + else + { + nlerror( "Coudn't connect to the Log Service." ); + } + } + +}; + + +NLNET_SERVICE_MAIN( CAdminExecutorService, "AES", 50009 ); + +// End of admin_executor_service.cpp diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.10&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.10&content-type=text/plain/index.html new file mode 100644 index 00000000..d6ad849d --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.10&content-type=text/plain/index.html @@ -0,0 +1,505 @@ +/** \file admin_executor_service.cpp + * Admin Executor Service (AES) + * + * $Id: admin_executor_service.cpp,v 1.10 2001/06/27 08:35:13 lecroart Exp $ + * + */ + +/* Copyright, 2000 Nevrax Ltd. + * + * This file is part of NEVRAX NeL Network Services. + * NEVRAX NeL Network Services 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, or (at your option) + * any later version. + * + * NEVRAX NeL Network Services 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. + * + * You should have received a copy of the GNU General Public License + * along with NEVRAX NeL Network Services; see the file COPYING. If not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#include <fcntl.h> +#include <sys/stat.h> + +#include "nel/misc/types_nl.h" + +#ifdef NL_OS_WINDOWS +#include <direct.h> +#else +#include <unistd.h> +#endif + +#include <string> +#include <list> + +#include "nel/misc/debug.h" +#include "nel/misc/config_file.h" +#include "nel/misc/thread.h" +#include "nel/misc/command.h" + +#include "nel/net/service.h" +#include "nel/net/net_manager.h" + +#ifdef NL_OS_WINDOWS +#define getcwd _getcwd +#define chdir _chdir +#endif + + +using namespace std; +using namespace NLMISC; +using namespace NLNET; + + + +struct CService +{ + CService(TSockId s) : SockId(s), Id(NextId++), Ready(false) { } + + TSockId SockId; /// connection to the service + uint32 Id; /// uint32 to identify the service + string AliasName; /// alias of the service used in the AES and AS to find him (unique per AES) + string ShortName; /// name of the service in short format ("NS" for example) + string LongName; /// name of the service in long format ("naming_service") + bool Ready; /// true if the service is ready + vector<CSerialCommand> Commands; + +private: + static uint32 NextId; +}; + +uint32 CService::NextId = 1; + +list<CService> Services; +typedef list<CService>::iterator SIT; + +SIT find (TSockId sid) +{ + SIT sit; + for (sit = Services.begin(); sit != Services.end(); sit++) + { + if ((*sit).SockId == sid) break; + } + return sit; +} + +SIT findService (uint32 sid, bool asrt = true) +{ + SIT sit; + for (sit = Services.begin(); sit != Services.end(); sit++) + { + if ((*sit).Id == sid) break; + } + if (asrt) + nlassert (sit != Services.end()); + return sit; +} + + +class CExecuteCommandThread : public IRunnable +{ +public: + string Command, Path; + + CExecuteCommandThread (string command, string path = "") : Command(command), Path(path) { } + + void run () + { + nlinfo ("start executing '%s' in '%s' directory", Command.c_str(), Path.c_str()); + + char oldpath[256]; + if (!Path.empty()) + { + getcwd(oldpath,256); + chdir(Path.c_str()); + } + + system (Command.c_str()); + + if (!Path.empty()) + chdir(oldpath); + + nlinfo ("end executing: %s", Command.c_str()); + } +}; + +class CExecuteServiceThread : public IRunnable +{ +public: + string ServiceAlias, ServiceCommand, ServicePath; + + CExecuteServiceThread (string serviceAlias, string serviceCommand, string servicePath = "") : + ServiceCommand(serviceCommand), ServicePath(servicePath), ServiceAlias(serviceAlias) { } + + void run () + { + nlinfo ("start service '%s' '%s' in '%s' directory", ServiceAlias.c_str(), ServiceCommand.c_str(), ServicePath.c_str()); + + char oldpath[256]; + if (!ServicePath.empty()) + { + getcwd(oldpath,256); + chdir(ServicePath.c_str()); + } + + system (ServiceCommand.c_str()); + + if (!ServicePath.empty()) + chdir(oldpath); + + nlinfo ("end service '%s' '%s' in '%s' directory", ServiceAlias.c_str(), ServiceCommand.c_str(), ServicePath.c_str()); + } +}; + +void executeCommand (string command, bool background) +{ + if (command.empty()) return; + +/* + nlinfo ("start executing: %s", command.c_str()); + if (command[command.size()-1] == '&') + { + command.resize(command.size()-2); + + if (spawnlp (_P_NOWAIT, cmd.c_str(), command.c_str(), NULL) == -1) + { + perror ("ca chie grave!!!!: "); + } + } + else + { + if (spawnlp (_P_WAIT, cmd.c_str(), command.c_str(), NULL) == -1) + { + perror ("ca chie grave!!!!: "); + } + } + nlinfo ("end executing: %s", command.c_str()); +*/ + + command += " >NUL:"; + if (background) + { + IThread *thread = IThread::create (new CExecuteCommandThread (command)); + thread->start (); + } + else + { + CExecuteCommandThread cmdt (command); + cmdt.run (); + } +} + + +/* +// execute without +void executeCommand (string command, TSockId from, CCallbackNetBase &netbase) +{ + if (command.empty()) return; + + #define STDOUT 1 + #define STDERR 2 + int nul, oldstdout, oldstderr; + char *tmpfilename = tmpnam (NULL); + nul = _open(tmpfilename, _O_RDWR | _O_CREAT | _O_TRUNC | _O_TEMPORARY | _O_SHORT_LIVED | _O_EXCL, _S_IREAD | _S_IWRITE); + oldstdout = _dup(STDOUT); + oldstderr = _dup(STDERR); + _dup2(nul, STDOUT); + _dup2(nul, STDERR); + system(command.c_str()); + _dup2(oldstdout, STDOUT); + _dup2(oldstderr, STDERR); + _close(oldstdout); + _close(oldstderr); + + _lseek (nul, 0L, SEEK_SET); + + while (!_eof(nul)) + { + uint8 buffer[10000]; + uint32 nbread = _read (nul, buffer, 10000); + + CMessage msgout (netbase.getSIDA(), "ESCR"); + msgout.serial (nbread); + msgout.serialBuffer (buffer, nbread); + netbase.send (msgout, from); + } + + _close(nul); +*/ +/* + FILE *fp = fopen ("test.txt", "r"); + do + { + char str[1024]; + fgets (str, 1024, fp); + if (feof(fp)) break; + result.push_back (str); + } + while (true); + fclose (fp); +// remove ("test.txt"); +*///} + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// CONNECTION TO THE SERVICES ////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +static void cbServiceIdentification (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + + msgin.serial (s->AliasName, s->ShortName, s->LongName); + msgin.serialCont (s->Commands); + + nlinfo ("*:*:%d is identified to be '%s' '%s' '%s'", s->Id, s->AliasName.c_str(), s->ShortName.c_str(), s->LongName.c_str()); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SID"); + msgout.serial (s->Id, s->AliasName, s->ShortName, s->LongName); + msgout.serialCont (s->Commands); + CNetManager::send ("AESAS", msgout); +} + +static void cbServiceReady (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + + nlinfo ("*:*:%d is ready", s->Id); + s->Ready = true; + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SR"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); +} + +static void cbLog (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + // received an answer for a command, give it to the AS + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "XLOG"); + string log; + msgin.serial (log); + msgout.serial (s->Id); + msgout.serial (log); + CNetManager::send ("AESAS", msgout); +} + +void serviceConnection (const string &serviceName, TSockId from, void *arg) +{ + Services.push_back (CService (from)); + CService *s = &(Services.back()); + from->setAppId ((uint64)(uint)s); + + nlinfo ("*:*:%d connected", s->Id); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SC"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); +} + +void serviceDisconnection (const string &serviceName, TSockId from, void *arg) +{ + CService *s = (CService*) (uint) from->appId(); + + nlinfo ("*:*:%d disconnected", s->Id); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SD"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); + + // remove the service from the list + Services.erase (findService(s->Id)); +} + + +/** Callback Array + */ +TCallbackItem ServicesCallbackArray[] = +{ + { "SID", cbServiceIdentification }, + { "SR", cbServiceReady }, + { "LOG", cbLog }, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// CONNECTION TO THE AS //////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +void errorMessage(string message, TSockId from) +{ + CMessage msgout (CNetManager::getSIDA ("AESAS"), "ERR"); + msgout.serial (message); + CNetManager::send ("AESAS", msgout, from); +} + +static void cbExecuteSystemCommand (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + string command; + + msgin.serial (command); + + IThread *thread = IThread::create (new CExecuteCommandThread (command)); + thread->start (); +} + +static void cbStartService (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + string serviceAlias, command, path; + msgin.serial (serviceAlias); + + nlinfo ("Starting the service alias '%s'", serviceAlias.c_str()); + + try + { + path = IService::ConfigFile.getVar(serviceAlias).asString(0); + command = IService::ConfigFile.getVar(serviceAlias).asString(1); + } + catch(EConfigFile &e) + { + nlwarning ("error in serviceAlias '%s' in config file (%s)", serviceAlias.c_str(), e.what()); + return; + } + + // give the service alias to the service to forward it back when it will connected to the aes. + command += " -n"; + command += serviceAlias.c_str(); + + command += " >NUL:"; + + IThread *thread = IThread::create (new CExecuteServiceThread (serviceAlias, command, path)); + thread->start (); +} + +static void cbStopService (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + uint32 sid; + + msgin.serial (sid); + + nlinfo ("I have to stop service '%s'"); + + SIT sit = findService (sid, false); + if (sit == Services.end()) + { + // don't find the aes, send an error message + errorMessage ("couldn't stop service, aes didn't find the service", from); + return; + } + + CMessage msgout (CNetManager::getSIDA("AES"), "STOPS"); + CNetManager::send ("AES", msgout, (*sit).SockId); +} + +static void cbExecCommand (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + uint32 sid; + string command; + + msgin.serial (sid); + msgin.serial (command); + + SIT sit = findService (sid, false); + if (sit == Services.end()) + { + // don't find the aes, send an error message + errorMessage ("couldn't stop service, aes didn't find the service", from); + return; + } + + CMessage msgout (CNetManager::getSIDA("AES"), "EXEC_COMMAND"); + msgout.serial (command); + CNetManager::send ("AES", msgout, (*sit).SockId); +} + +void loadAndSendServicesAliasList (CConfigFile::CVar &var); + +void cbASServiceConnection (const string &serviceName, TSockId from, void *arg) +{ + // new admin service, send him all out info about services + + nlinfo ("AS %s is connected", from->asString().c_str()); + + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SL"); + uint32 nbs = (uint32)Services.size(); + msgout.serial (nbs); + for (SIT sit = Services.begin(); sit != Services.end(); sit++) + { + msgout.serial ((*sit).Id, (*sit).AliasName, (*sit).ShortName, (*sit).LongName, (*sit).Ready); + msgout.serialCont ((*sit).Commands); + } + CNetManager::send ("AESAS", msgout, from); + + loadAndSendServicesAliasList (IService::ConfigFile.getVar ("Services")); +} + +TCallbackItem AESASCallbackArray[] = +{ + { "SYS", cbExecuteSystemCommand }, + { "STARTS", cbStartService }, + { "STOPS", cbStopService }, + { "EXEC_COMMAND", cbExecCommand }, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// SERVICE IMPLEMENTATION ////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +void loadAndSendServicesAliasList (CConfigFile::CVar &services) +{ + vector<string> servicesaliaslist; + for (sint i = 0 ; i < services.size (); i++) + { + servicesaliaslist.push_back (services.asString(i)); + } + + CMessage msgout2 (CNetManager::getSIDA ("AESAS"), "SAL"); + msgout2.serialCont (servicesaliaslist); + CNetManager::send ("AESAS", msgout2, 0); +} + + +class CAdminExecutorService : public IService +{ +public: + + /// Init the service, load the universal time. + void init () + { + CNetManager::setConnectionCallback ("AES", serviceConnection, NULL); + CNetManager::setDisconnectionCallback ("AES", serviceDisconnection, NULL); + + // install the server for AS + CNetManager::setConnectionCallback ("AESAS", cbASServiceConnection, NULL); + CNetManager::addServer ("AESAS", 49996); + CNetManager::addCallbackArray ("AESAS", AESASCallbackArray, sizeof(AESASCallbackArray)/sizeof(AESASCallbackArray[0])); + + ConfigFile.setCallback ("Services", loadAndSendServicesAliasList); + loadAndSendServicesAliasList (IService::ConfigFile.getVar ("Services")); + } + + bool update () + { + return true; + } +}; + + +/// Naming Service +NLNET_SERVICE_MAIN (CAdminExecutorService, "AES", "admin_executor_service", 49997, ServicesCallbackArray); diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.13&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.13&content-type=text/plain/index.html new file mode 100644 index 00000000..6d314728 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.13&content-type=text/plain/index.html @@ -0,0 +1,530 @@ +/** \file admin_executor_service.cpp + * Admin Executor Service (AES) + * + * $Id: admin_executor_service.cpp,v 1.13 2002/03/19 17:42:48 valignat Exp $ + * + */ + +/* Copyright, 2000 Nevrax Ltd. + * + * This file is part of NEVRAX NeL Network Services. + * NEVRAX NeL Network Services 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, or (at your option) + * any later version. + * + * NEVRAX NeL Network Services 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. + * + * You should have received a copy of the GNU General Public License + * along with NEVRAX NeL Network Services; see the file COPYING. If not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif // HAVE_CONFIG_H + +#ifndef NELNS_CONFIG +#define NELNS_CONFIG "" +#endif // NELNS_CONFIG + +#ifndef NELNS_LOGS +#define NELNS_LOGS "" +#endif // NELNS_LOGS + +#include <fcntl.h> +#include <sys/stat.h> + +#include "nel/misc/types_nl.h" + +#ifdef NL_OS_WINDOWS +#include <windows.h> +#include <direct.h> +#else +#include <unistd.h> +#endif + +#include <string> +#include <list> + +#include "nel/misc/debug.h" +#include "nel/misc/config_file.h" +#include "nel/misc/thread.h" +#include "nel/misc/command.h" + +#include "nel/net/service.h" +#include "nel/net/net_manager.h" + +#ifdef NL_OS_WINDOWS +#define getcwd _getcwd +#define chdir _chdir +#endif + + +using namespace std; +using namespace NLMISC; +using namespace NLNET; + + + +struct CService +{ + CService(TSockId s) : SockId(s), Id(NextId++), Ready(false) { } + + TSockId SockId; /// connection to the service + uint32 Id; /// uint32 to identify the service + string AliasName; /// alias of the service used in the AES and AS to find him (unique per AES) + string ShortName; /// name of the service in short format ("NS" for example) + string LongName; /// name of the service in long format ("naming_service") + bool Ready; /// true if the service is ready + vector<CSerialCommand> Commands; + +private: + static uint32 NextId; +}; + +uint32 CService::NextId = 1; + +list<CService> Services; +typedef list<CService>::iterator SIT; + +SIT find (TSockId sid) +{ + SIT sit; + for (sit = Services.begin(); sit != Services.end(); sit++) + { + if ((*sit).SockId == sid) break; + } + return sit; +} + +SIT findService (uint32 sid, bool asrt = true) +{ + SIT sit; + for (sit = Services.begin(); sit != Services.end(); sit++) + { + if ((*sit).Id == sid) break; + } + if (asrt) + nlassert (sit != Services.end()); + return sit; +} + + +class CExecuteCommandThread : public IRunnable +{ +public: + string Command, Path; + + CExecuteCommandThread (string command, string path = "") : Command(command), Path(path) { } + + void run () + { + nlinfo ("start executing '%s' in '%s' directory", Command.c_str(), Path.c_str()); + + char oldpath[256]; + if (!Path.empty()) + { + getcwd(oldpath,256); + chdir(Path.c_str()); + } + + system (Command.c_str()); + + if (!Path.empty()) + chdir(oldpath); + + nlinfo ("end executing: %s", Command.c_str()); + } +}; + +class CExecuteServiceThread : public IRunnable +{ +public: + string ServiceAlias, ServiceCommand, ServicePath; + + CExecuteServiceThread (string serviceAlias, string serviceCommand, string servicePath = "") : + ServiceCommand(serviceCommand), ServicePath(servicePath), ServiceAlias(serviceAlias) { } + + void run () + { + nlinfo ("start service '%s' '%s' in '%s' directory", ServiceAlias.c_str(), ServiceCommand.c_str(), ServicePath.c_str()); + + char oldpath[256]; + if (!ServicePath.empty()) + { + getcwd(oldpath,256); + chdir(ServicePath.c_str()); + } + +#ifdef NL_OS_WINDOWS + WinExec (ServiceCommand.c_str(), SW_MINIMIZE/*SW_SHOWNORMAL*/); +#else + system (ServiceCommand.c_str()); +#endif + + if (!ServicePath.empty()) + chdir(oldpath); + + nlinfo ("end service '%s' '%s' in '%s' directory", ServiceAlias.c_str(), ServiceCommand.c_str(), ServicePath.c_str()); + } +}; + +void executeCommand (string command, bool background) +{ + if (command.empty()) return; + +/* + nlinfo ("start executing: %s", command.c_str()); + if (command[command.size()-1] == '&') + { + command.resize(command.size()-2); + + if (spawnlp (_P_NOWAIT, cmd.c_str(), command.c_str(), NULL) == -1) + { + perror ("ca chie grave!!!!: "); + } + } + else + { + if (spawnlp (_P_WAIT, cmd.c_str(), command.c_str(), NULL) == -1) + { + perror ("ca chie grave!!!!: "); + } + } + nlinfo ("end executing: %s", command.c_str()); +*/ + +#ifdef NL_OS_WINDOWS + command += " >NUL:"; +#else + command += " >/dev/null"; +#endif + if (background) + { + IThread *thread = IThread::create (new CExecuteCommandThread (command)); + thread->start (); + } + else + { + CExecuteCommandThread cmdt (command); + cmdt.run (); + } +} + + +/* +// execute without +void executeCommand (string command, TSockId from, CCallbackNetBase &netbase) +{ + if (command.empty()) return; + + #define STDOUT 1 + #define STDERR 2 + int nul, oldstdout, oldstderr; + char *tmpfilename = tmpnam (NULL); + nul = _open(tmpfilename, _O_RDWR | _O_CREAT | _O_TRUNC | _O_TEMPORARY | _O_SHORT_LIVED | _O_EXCL, _S_IREAD | _S_IWRITE); + oldstdout = _dup(STDOUT); + oldstderr = _dup(STDERR); + _dup2(nul, STDOUT); + _dup2(nul, STDERR); + system(command.c_str()); + _dup2(oldstdout, STDOUT); + _dup2(oldstderr, STDERR); + _close(oldstdout); + _close(oldstderr); + + _lseek (nul, 0L, SEEK_SET); + + while (!_eof(nul)) + { + uint8 buffer[10000]; + uint32 nbread = _read (nul, buffer, 10000); + + CMessage msgout (netbase.getSIDA(), "ESCR"); + msgout.serial (nbread); + msgout.serialBuffer (buffer, nbread); + netbase.send (msgout, from); + } + + _close(nul); +*/ +/* + FILE *fp = fopen ("test.txt", "r"); + do + { + char str[1024]; + fgets (str, 1024, fp); + if (feof(fp)) break; + result.push_back (str); + } + while (true); + fclose (fp); +// remove ("test.txt"); +*///} + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// CONNECTION TO THE SERVICES ////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +static void cbServiceIdentification (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + + msgin.serial (s->AliasName, s->ShortName, s->LongName); + msgin.serialCont (s->Commands); + + nlinfo ("*:*:%d is identified to be '%s' '%s' '%s'", s->Id, s->AliasName.c_str(), s->ShortName.c_str(), s->LongName.c_str()); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SID"); + msgout.serial (s->Id, s->AliasName, s->ShortName, s->LongName); + msgout.serialCont (s->Commands); + CNetManager::send ("AESAS", msgout); +} + +static void cbServiceReady (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + + nlinfo ("*:*:%d is ready", s->Id); + s->Ready = true; + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SR"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); +} + +static void cbLog (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + // received an answer for a command, give it to the AS + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "XLOG"); + string log; + msgin.serial (log); + msgout.serial (s->Id); + msgout.serial (log); + CNetManager::send ("AESAS", msgout); +} + +void serviceConnection (const string &serviceName, TSockId from, void *arg) +{ + Services.push_back (CService (from)); + CService *s = &(Services.back()); + from->setAppId ((uint64)(uint)s); + + nlinfo ("*:*:%d connected", s->Id); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SC"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); +} + +void serviceDisconnection (const string &serviceName, TSockId from, void *arg) +{ + CService *s = (CService*) (uint) from->appId(); + + nlinfo ("*:*:%d disconnected", s->Id); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SD"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); + + // remove the service from the list + Services.erase (findService(s->Id)); +} + + +/** Callback Array + */ +TCallbackItem ServicesCallbackArray[] = +{ + { "SID", cbServiceIdentification }, + { "SR", cbServiceReady }, + { "LOG", cbLog }, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// CONNECTION TO THE AS //////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +void errorMessage(string message, TSockId from) +{ + CMessage msgout (CNetManager::getSIDA ("AESAS"), "ERR"); + msgout.serial (message); + CNetManager::send ("AESAS", msgout, from); +} + +static void cbExecuteSystemCommand (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + string command; + + msgin.serial (command); + + IThread *thread = IThread::create (new CExecuteCommandThread (command)); + thread->start (); +} + +static void cbStartService (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + string serviceAlias, command, path; + msgin.serial (serviceAlias); + + nlinfo ("Starting the service alias '%s'", serviceAlias.c_str()); + + try + { + path = IService::ConfigFile.getVar(serviceAlias).asString(0); + command = IService::ConfigFile.getVar(serviceAlias).asString(1); + } + catch(EConfigFile &e) + { + nlwarning ("error in serviceAlias '%s' in config file (%s)", serviceAlias.c_str(), e.what()); + return; + } + + // give the service alias to the service to forward it back when it will connected to the aes. + command += " -n"; + command += serviceAlias.c_str(); + +#ifdef NL_OS_WINDOWS + command += " >NUL:"; +#else + command += " >/dev/null"; +#endif + + IThread *thread = IThread::create (new CExecuteServiceThread (serviceAlias, command, path)); + thread->start (); +} + +static void cbStopService (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + uint32 sid; + + msgin.serial (sid); + + nlinfo ("I have to stop service '%s'"); + + SIT sit = findService (sid, false); + if (sit == Services.end()) + { + // don't find the aes, send an error message + errorMessage ("couldn't stop service, aes didn't find the service", from); + return; + } + + CMessage msgout (CNetManager::getSIDA("AES"), "STOPS"); + CNetManager::send ("AES", msgout, (*sit).SockId); +} + +static void cbExecCommand (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + uint32 sid; + string command; + + msgin.serial (sid); + msgin.serial (command); + + SIT sit = findService (sid, false); + if (sit == Services.end()) + { + // don't find the aes, send an error message + errorMessage ("couldn't stop service, aes didn't find the service", from); + return; + } + + CMessage msgout (CNetManager::getSIDA("AES"), "EXEC_COMMAND"); + msgout.serial (command); + CNetManager::send ("AES", msgout, (*sit).SockId); +} + +void loadAndSendServicesAliasList (CConfigFile::CVar &var); + +void cbASServiceConnection (const string &serviceName, TSockId from, void *arg) +{ + // new admin service, send him all out info about services + + nlinfo ("AS %s is connected", from->asString().c_str()); + + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SL"); + uint32 nbs = (uint32)Services.size(); + msgout.serial (nbs); + for (SIT sit = Services.begin(); sit != Services.end(); sit++) + { + msgout.serial ((*sit).Id, (*sit).AliasName, (*sit).ShortName, (*sit).LongName, (*sit).Ready); + msgout.serialCont ((*sit).Commands); + } + CNetManager::send ("AESAS", msgout, from); + + loadAndSendServicesAliasList (IService::ConfigFile.getVar ("Services")); +} + +TCallbackItem AESASCallbackArray[] = +{ + { "SYS", cbExecuteSystemCommand }, + { "STARTS", cbStartService }, + { "STOPS", cbStopService }, + { "EXEC_COMMAND", cbExecCommand }, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// SERVICE IMPLEMENTATION ////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +void loadAndSendServicesAliasList (CConfigFile::CVar &services) +{ + vector<string> servicesaliaslist; + for (sint i = 0 ; i < services.size (); i++) + { + servicesaliaslist.push_back (services.asString(i)); + } + + CMessage msgout2 (CNetManager::getSIDA ("AESAS"), "SAL"); + msgout2.serialCont (servicesaliaslist); + CNetManager::send ("AESAS", msgout2, 0); +} + + +class CAdminExecutorService : public IService +{ +public: + + /// Init the service, load the universal time. + void init () + { + CNetManager::setConnectionCallback ("AES", serviceConnection, NULL); + CNetManager::setDisconnectionCallback ("AES", serviceDisconnection, NULL); + + // install the server for AS + CNetManager::setConnectionCallback ("AESAS", cbASServiceConnection, NULL); + CNetManager::addServer ("AESAS", 49996); + CNetManager::addCallbackArray ("AESAS", AESASCallbackArray, sizeof(AESASCallbackArray)/sizeof(AESASCallbackArray[0])); + + ConfigFile.setCallback ("Services", loadAndSendServicesAliasList); + loadAndSendServicesAliasList (IService::ConfigFile.getVar ("Services")); + } + + bool update () + { + return true; + } +}; + + +/// Naming Service +NLNET_SERVICE_MAIN (CAdminExecutorService, "AES", "admin_executor_service", 49997, ServicesCallbackArray, NELNS_CONFIG, NELNS_LOGS); diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.14&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.14&content-type=text/plain/index.html new file mode 100644 index 00000000..12ee8936 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/admin_executor_service/admin_executor_service.cpp?rev=1.14&content-type=text/plain/index.html @@ -0,0 +1,518 @@ +/** \file admin_executor_service.cpp + * Admin Executor Service (AES) + * + * $Id: admin_executor_service.cpp,v 1.14 2002/03/25 09:27:34 lecroart Exp $ + * + */ + +/* Copyright, 2000 Nevrax Ltd. + * + * This file is part of NEVRAX NeL Network Services. + * NEVRAX NeL Network Services 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, or (at your option) + * any later version. + * + * NEVRAX NeL Network Services 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. + * + * You should have received a copy of the GNU General Public License + * along with NEVRAX NeL Network Services; see the file COPYING. If not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif // HAVE_CONFIG_H + +#ifndef NELNS_CONFIG +#define NELNS_CONFIG "" +#endif // NELNS_CONFIG + +#ifndef NELNS_LOGS +#define NELNS_LOGS "" +#endif // NELNS_LOGS + +#include "nel/misc/types_nl.h" + +#include <fcntl.h> +#include <sys/stat.h> + +#ifdef NL_OS_WINDOWS +#include <windows.h> +#include <direct.h> +#else +#include <unistd.h> +#endif + +#include <string> +#include <list> + +#include "nel/misc/debug.h" +#include "nel/misc/config_file.h" +#include "nel/misc/thread.h" +#include "nel/misc/command.h" + +#include "nel/net/service.h" +#include "nel/net/net_manager.h" + +/*#ifdef NL_OS_WINDOWS +#define getcwd _getcwd +#define chdir _chdir +#endif +*/ + +using namespace std; +using namespace NLMISC; +using namespace NLNET; + + + +struct CService +{ + CService(TSockId s) : SockId(s), Id(NextId++), Ready(false) { } + + TSockId SockId; /// connection to the service + uint32 Id; /// uint32 to identify the service + string AliasName; /// alias of the service used in the AES and AS to find him (unique per AES) + string ShortName; /// name of the service in short format ("NS" for example) + string LongName; /// name of the service in long format ("naming_service") + bool Ready; /// true if the service is ready + vector<CSerialCommand> Commands; + +private: + static uint32 NextId; +}; + +uint32 CService::NextId = 1; + +list<CService> Services; +typedef list<CService>::iterator SIT; + +SIT find (TSockId sid) +{ + SIT sit; + for (sit = Services.begin(); sit != Services.end(); sit++) + { + if ((*sit).SockId == sid) break; + } + return sit; +} + +SIT findService (uint32 sid, bool asrt = true) +{ + SIT sit; + for (sit = Services.begin(); sit != Services.end(); sit++) + { + if ((*sit).Id == sid) break; + } + if (asrt) + nlassert (sit != Services.end()); + return sit; +} + + +class CExecuteCommandThread : public IRunnable +{ +public: + string Command; + + CExecuteCommandThread (string command) : Command(command) { } + + void run () + { + nlinfo ("start executing '%s'", Command.c_str()); + + system (Command.c_str()); + + nlinfo ("end executing: %s", Command.c_str()); + } +}; + +class CExecuteServiceThread : public IRunnable +{ +public: + string ServiceCommand; + + CExecuteServiceThread (string serviceCommand) : + ServiceCommand(serviceCommand) { } + + void run () + { + nlinfo ("start service '%s'", ServiceCommand.c_str()); + +#ifdef NL_OS_WINDOWS + WinExec (ServiceCommand.c_str(), SW_MINIMIZE/*SW_SHOWNORMAL*/); +#else + system (ServiceCommand.c_str()); +#endif + + nlinfo ("end service '%s'", ServiceCommand.c_str()); + } +}; + +void executeCommand (string command, bool background) +{ + if (command.empty()) return; + +/* + nlinfo ("start executing: %s", command.c_str()); + if (command[command.size()-1] == '&') + { + command.resize(command.size()-2); + + if (spawnlp (_P_NOWAIT, cmd.c_str(), command.c_str(), NULL) == -1) + { + perror ("ca chie grave!!!!: "); + } + } + else + { + if (spawnlp (_P_WAIT, cmd.c_str(), command.c_str(), NULL) == -1) + { + perror ("ca chie grave!!!!: "); + } + } + nlinfo ("end executing: %s", command.c_str()); +*/ + +#ifdef NL_OS_WINDOWS + command += " >NUL:"; +#else + command += " >/dev/null"; +#endif + if (background) + { + IThread *thread = IThread::create (new CExecuteCommandThread (command)); + thread->start (); + } + else + { + CExecuteCommandThread cmdt (command); + cmdt.run (); + } +} + + +/* +// execute without +void executeCommand (string command, TSockId from, CCallbackNetBase &netbase) +{ + if (command.empty()) return; + + #define STDOUT 1 + #define STDERR 2 + int nul, oldstdout, oldstderr; + char *tmpfilename = tmpnam (NULL); + nul = _open(tmpfilename, _O_RDWR | _O_CREAT | _O_TRUNC | _O_TEMPORARY | _O_SHORT_LIVED | _O_EXCL, _S_IREAD | _S_IWRITE); + oldstdout = _dup(STDOUT); + oldstderr = _dup(STDERR); + _dup2(nul, STDOUT); + _dup2(nul, STDERR); + system(command.c_str()); + _dup2(oldstdout, STDOUT); + _dup2(oldstderr, STDERR); + _close(oldstdout); + _close(oldstderr); + + _lseek (nul, 0L, SEEK_SET); + + while (!_eof(nul)) + { + uint8 buffer[10000]; + uint32 nbread = _read (nul, buffer, 10000); + + CMessage msgout (netbase.getSIDA(), "ESCR"); + msgout.serial (nbread); + msgout.serialBuffer (buffer, nbread); + netbase.send (msgout, from); + } + + _close(nul); +*/ +/* + FILE *fp = fopen ("test.txt", "r"); + do + { + char str[1024]; + fgets (str, 1024, fp); + if (feof(fp)) break; + result.push_back (str); + } + while (true); + fclose (fp); +// remove ("test.txt"); +*///} + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// CONNECTION TO THE SERVICES ////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +static void cbServiceIdentification (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + + msgin.serial (s->AliasName, s->ShortName, s->LongName); + msgin.serialCont (s->Commands); + + nlinfo ("*:*:%d is identified to be '%s' '%s' '%s'", s->Id, s->AliasName.c_str(), s->ShortName.c_str(), s->LongName.c_str()); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SID"); + msgout.serial (s->Id, s->AliasName, s->ShortName, s->LongName); + msgout.serialCont (s->Commands); + CNetManager::send ("AESAS", msgout); +} + +static void cbServiceReady (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + + nlinfo ("*:*:%d is ready", s->Id); + s->Ready = true; + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SR"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); +} + +static void cbLog (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + CService *s = (CService*) (uint) from->appId(); + // received an answer for a command, give it to the AS + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "XLOG"); + string log; + msgin.serial (log); + msgout.serial (s->Id); + msgout.serial (log); + CNetManager::send ("AESAS", msgout); +} + +void serviceConnection (const string &serviceName, TSockId from, void *arg) +{ + Services.push_back (CService (from)); + CService *s = &(Services.back()); + from->setAppId ((uint64)(uint)s); + + nlinfo ("*:*:%d connected", s->Id); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SC"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); +} + +void serviceDisconnection (const string &serviceName, TSockId from, void *arg) +{ + CService *s = (CService*) (uint) from->appId(); + + nlinfo ("*:*:%d disconnected", s->Id); + + // broadcast the message to the admin service + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SD"); + msgout.serial (s->Id); + CNetManager::send ("AESAS", msgout); + + // remove the service from the list + Services.erase (findService(s->Id)); +} + + +/** Callback Array + */ +TCallbackItem ServicesCallbackArray[] = +{ + { "SID", cbServiceIdentification }, + { "SR", cbServiceReady }, + { "LOG", cbLog }, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// CONNECTION TO THE AS //////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +void errorMessage(string message, TSockId from) +{ + CMessage msgout (CNetManager::getSIDA ("AESAS"), "ERR"); + msgout.serial (message); + CNetManager::send ("AESAS", msgout, from); +} + +static void cbExecuteSystemCommand (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + string command; + + msgin.serial (command); + + IThread *thread = IThread::create (new CExecuteCommandThread (command)); + thread->start (); +} + +static void cbStartService (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + string serviceAlias, command, path; + msgin.serial (serviceAlias); + + nlinfo ("Starting the service alias '%s'", serviceAlias.c_str()); + + try + { + path = IService::getInstance()->ConfigFile.getVar(serviceAlias).asString(0); + command = IService::getInstance()->ConfigFile.getVar(serviceAlias).asString(1); + } + catch(EConfigFile &e) + { + nlwarning ("error in serviceAlias '%s' in config file (%s)", serviceAlias.c_str(), e.what()); + return; + } + + // give the service alias to the service to forward it back when it will connected to the aes. + command += " -N"; + command += serviceAlias; + + // set the path for the config file + command += " -C"; + command += path; + + // set the path for log + command += " -L"; + command += path; + +#ifdef NL_OS_WINDOWS + command += " >NUL:"; +#else + command += " >/dev/null"; +#endif + + IThread *thread = IThread::create (new CExecuteServiceThread (command)); + thread->start (); +} + +static void cbStopService (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + uint32 sid; + + msgin.serial (sid); + + nlinfo ("I have to stop service '%s'"); + + SIT sit = findService (sid, false); + if (sit == Services.end()) + { + // don't find the aes, send an error message + errorMessage ("couldn't stop service, aes didn't find the service", from); + return; + } + + CMessage msgout (CNetManager::getSIDA("AES"), "STOPS"); + CNetManager::send ("AES", msgout, (*sit).SockId); +} + +static void cbExecCommand (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + uint32 sid; + string command; + + msgin.serial (sid); + msgin.serial (command); + + SIT sit = findService (sid, false); + if (sit == Services.end()) + { + // don't find the aes, send an error message + errorMessage ("couldn't stop service, aes didn't find the service", from); + return; + } + + CMessage msgout (CNetManager::getSIDA("AES"), "EXEC_COMMAND"); + msgout.serial (command); + CNetManager::send ("AES", msgout, (*sit).SockId); +} + +void loadAndSendServicesAliasList (CConfigFile::CVar &var); + +void cbASServiceConnection (const string &serviceName, TSockId from, void *arg) +{ + // new admin service, send him all out info about services + + nlinfo ("AS %s is connected", from->asString().c_str()); + + CMessage msgout (CNetManager::getSIDA ("AESAS"), "SL"); + uint32 nbs = (uint32)Services.size(); + msgout.serial (nbs); + for (SIT sit = Services.begin(); sit != Services.end(); sit++) + { + msgout.serial ((*sit).Id, (*sit).AliasName, (*sit).ShortName, (*sit).LongName, (*sit).Ready); + msgout.serialCont ((*sit).Commands); + } + CNetManager::send ("AESAS", msgout, from); + + loadAndSendServicesAliasList (IService::getInstance()->ConfigFile.getVar ("Services")); +} + +TCallbackItem AESASCallbackArray[] = +{ + { "SYS", cbExecuteSystemCommand }, + { "STARTS", cbStartService }, + { "STOPS", cbStopService }, + { "EXEC_COMMAND", cbExecCommand }, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////// SERVICE IMPLEMENTATION ////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// + +void loadAndSendServicesAliasList (CConfigFile::CVar &services) +{ + vector<string> servicesaliaslist; + for (sint i = 0 ; i < services.size (); i++) + { + servicesaliaslist.push_back (services.asString(i)); + } + + CMessage msgout2 (CNetManager::getSIDA ("AESAS"), "SAL"); + msgout2.serialCont (servicesaliaslist); + CNetManager::send ("AESAS", msgout2, 0); +} + + +class CAdminExecutorService : public IService +{ +public: + + /// Init the service, load the universal time. + void init () + { + CNetManager::setConnectionCallback ("AES", serviceConnection, NULL); + CNetManager::setDisconnectionCallback ("AES", serviceDisconnection, NULL); + + // install the server for AS + CNetManager::setConnectionCallback ("AESAS", cbASServiceConnection, NULL); + CNetManager::addServer ("AESAS", 49996); + CNetManager::addCallbackArray ("AESAS", AESASCallbackArray, sizeof(AESASCallbackArray)/sizeof(AESASCallbackArray[0])); + + ConfigFile.setCallback ("Services", loadAndSendServicesAliasList); + loadAndSendServicesAliasList (IService::ConfigFile.getVar ("Services")); + } + + bool update () + { + return true; + } +}; + + +/// Naming Service +NLNET_OLD_SERVICE_MAIN (CAdminExecutorService, "AES", "admin_executor_service", 49997, ServicesCallbackArray, NELNS_CONFIG, NELNS_LOGS); diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/agent_service/Attic/io_interface.cpp?rev=1.1&content-type=text/plain&hideattic=0/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/agent_service/Attic/io_interface.cpp?rev=1.1&content-type=text/plain&hideattic=0/index.html new file mode 100644 index 00000000..2cfd6fb4 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/agent_service/Attic/io_interface.cpp?rev=1.1&content-type=text/plain&hideattic=0/index.html @@ -0,0 +1,54 @@ +#include "nel/ai/agent/agent.h" +#include "io_interface.h" +#include <stdio.h> +#include <stdarg.h> + +namespace SRV +{ + extern std::fstream logStream; + extern bool logFileState; + + static char LaseErrorCodeOrdreInterprete[32*1024]; + void IOTrace::Echo(char *str, ...) + { + char temp[32*1024]; + va_list argument; + va_start (argument, str); + + vsprintf(temp, str, argument); + strcpy(LaseErrorCodeOrdreInterprete,temp); + +#ifdef NL_DEBUG + printf("%s",LaseErrorCodeOrdreInterprete); + if(logFileState && logStream.is_open()) + { + logStream << LaseErrorCodeOrdreInterprete; + logStream.flush(); + } +#else + printf("%s",LaseErrorCodeOrdreInterprete); + if(logFileState && logStream.is_open()) + { + logStream << LaseErrorCodeOrdreInterprete; + logStream.flush(); + } +#endif + + } + + const std::string IOTrace::InPut() + { + std::string str; + /*char toto[4096]; + str = gets(toto);*/ + cin >> str; + return str; + } + + const NLAIC::CIdentType &IOTrace::getType() const + { + static const NLAIC::CIdentType idIOWinInterface("IOWinInterface", NLAIC::CSelfClassFactory(*this), + NLAIC::CTypeOfObject(NLAIC::CTypeOfObject::tObject),NLAIC::CTypeOfOperator(0)); + return idIOWinInterface; + } +} diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/agent_service/Attic/py_object_trans.cpp?rev=1.1&content-type=text/plain&hideattic=0/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/agent_service/Attic/py_object_trans.cpp?rev=1.1&content-type=text/plain&hideattic=0/index.html new file mode 100644 index 00000000..92f3b304 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/agent_service/Attic/py_object_trans.cpp?rev=1.1&content-type=text/plain&hideattic=0/index.html @@ -0,0 +1,132 @@ +#include "py_object_trans.h" +//#include "ag_compile.h" + + +namespace SRV +{ + static PyObject *commandSell(pyCPyEditWin *self, PyObject *arg) + { + char *txt; + PyObject *argi; + argi = PyTuple_GetItem (arg, 0); + PyArg_Parse(argi,"s",&txt); + txt[strlen(txt)] = 0; + char command[1024*16]; +#ifdef NL_DEBUG + memset(command,0,sizeof(command)); +#endif + int i = 0,j = 0; + + while(txt[i] != 0) + { + if(txt[i] != '\n') + { + command[j] = txt[i]; + j ++; + } + else + { + command[j] = 0; + self->Instance->commandSell(command); + j = 0; + } + i ++; + } + if(j) + { + command[j] = 0; + self->Instance->commandSell(command); + } + return Py_BuildValue("i",false); + } + + static PyObject *coord(pyCPyEditWin *self, PyObject *arg) + { + char *txt; + PyObject *argi; + argi = PyTuple_GetItem (arg, 0); + PyArg_Parse(argi,"s",&txt); + //txt[strlen(txt)] = 0; + char num[1024]; +#ifdef NL_DEBUG + memset(num,0,sizeof(num)); +#endif + int i = 0,j = 0; + int x = -1,y = -1; + while(txt[i] != 0) + { + if(txt[i] == '.') + { + num[j] = 0; + x = atoi(num); + j = 0; + i++; + break; + } + else + { + num[j ++] = txt[i]; + } + i ++; + } + + while(1) + { + if(txt[i] == 0) + { + num[j] = 0; + y = atoi(num); + break; + } + else + { + num[j ++] = txt[i]; + } + i ++; + } + return Py_BuildValue("ii",x,y); + } + + static PyMethodDef V_methods[] = + { + {"commandSell", (PyCFunction) commandSell, 1, NULL}, + {"coord", (PyCFunction) coord, 1, NULL}, + {NULL, NULL} /* sentinel */ + }; + + static PyObject *getAttribDigitalType(pyCPyEditWin *self,char *name) + { + return Py_FindMethod(V_methods, (PyObject *)self, name); + } + + static void dealloc(pyCPyEditWin *self) + { + delete self; + } + + staticforward PyTypeObject V_Type = + { + PyObject_HEAD_INIT(&PyType_Type) + 0, /*ob_size*/ + "Shell", /*tp_name*/ + sizeof(pyCPyEditWin), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + /* methods */ + (destructor)dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + (getattrfunc)getAttribDigitalType, /*tp_getattr*/ + 0, + /* (setattrfunc)VConnection_setattr,*/ /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + }; + + pyCPyEditWin *allocPyEditWin(CPyEditWin *classType) + { + return NLAIC::CreatePyObjectInstance<CPyEditWin>(classType,&V_Type); + } +} diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/agent_service/Attic/server.cpp?rev=1.1&content-type=text/plain&hideattic=0/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/agent_service/Attic/server.cpp?rev=1.1&content-type=text/plain&hideattic=0/index.html new file mode 100644 index 00000000..9c27da39 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/agent_service/Attic/server.cpp?rev=1.1&content-type=text/plain&hideattic=0/index.html @@ -0,0 +1,228 @@ +/** \file server.cpp + * <File description> + * + * $Id: server.cpp,v 1.1 2001/04/18 13:54:25 valignat Exp $ + */ + +/* Copyright, 2001 Nevrax Ltd. + * + * This file is part of NEVRAX NeL Network Services. + * NEVRAX NeL Network Services 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, or (at your option) + * any later version. + + * NEVRAX NeL Network Services 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. + + * You should have received a copy of the GNU General Public License + * along with NEVRAX NeL Network Services; see the file COPYING. If not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ +#include <time.h> +#include "nel/ai/agent/agent.h" +#include "nel/ai/script/codage.h" +#include "nel/ai/script/interpret_object_agent.h" +#include "nel/ai/agent/main_agent_script.h" +#include "nel/ai/script/libcode.h" +#include "nel/misc/thread.h" + +#include "server.h" +const char logFile[] = "compile.log"; +#include "filestream_n.h" +#include "io_interface.h" +#include "ag_compile.h" +#include "init.h" + +namespace NLAISCRIPT +{ +#ifdef NL_DEBUG + extern bool NL_AI_DEBUG_SERVER; +#endif +} + + +namespace SRV +{ + std::fstream logStream; + bool logFileState = false; + SRV::IOTrace Interface; + + TAgentId getId(const NLAIAGENT::CAgentNumber &num) + { + TAgentId i; + i.CreatorSId = num.CreatorId; + i.CurrentSId = num.DynamicId; + i.SerialNumber = num.AgentNumber; + return i; + } + + NLAIAGENT::CAgentNumber getAgentId(TBasicAgentId &num) + { + NLAIAGENT::CAgentNumber i; + i.CreatorId = num.CreatorSId; + i.AgentNumber = num.SerialNumber; + return i; + } + + CApplication::CApplication(const std::vector<std::string> &args):IManager(&Interface),_Active(true),_Shell(NULL),_Runnable(NULL),_ManagerRun(NULL) + { + Interface.incRef(); + SRV::CPyEditWin::PyServer = NLAIPYSERVER::initPythonLib(&Interface,"./pyscript"); + Interface.incRef(); + SRV::CPyEditWin::inputOutput = &Interface; + Interface.incRef(); + NLAISCRIPT::CCallPrint::inputOutput = &Interface; + if(logFileState) logStream.open(logFile, std::ios_base::in | std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + //init(); + } + + bool CApplication::isActive() const + { + return _Active; + } + + NLAIAGENT::IRefrence *CApplication::agentIsPresent( TBasicAgentId baid ) const + { + const NLAIAGENT::CAgentNumber &id = getAgentId(baid); + return NLAIAGENT::CLocWordNumRef::getRef(NLAIAGENT::CNumericIndex(id)); + + } + + void CApplication::deliverMsg( NLAIAGENT::IRefrence *ag, NLNET::CMessage& inmsg, TAgentId src_aid ) + { + NLAIC::CIdentTypeAlloc msgFactory; + inmsg.serial( msgFactory ); + NLAIAGENT::IObjectIA *msg = (NLAIAGENT::IObjectIA *) msgFactory.allocClass(); + inmsg.serial( *msg ); +#ifdef NL_DEBUG + NLAISCRIPT::NL_AI_DEBUG_SERVER = true; +#endif + ag->sendMessage(msg); + } + + TAgentId CApplication::getAgentManagerId() const + { + const NLAIAGENT::CNumericIndex &id = ((const NLAIAGENT::IWordNumRef &)*this).getNumIdent(); + return getId(id.getId()); + } + + void CApplication::declareNewManager( const TAgentId& agtid ) + { + NLAIAGENT::CAgentNumber id; + id.CreatorId = agtid.CreatorSId; + id.DynamicId = agtid.CurrentSId; + id.AgentNumber = agtid.SerialNumber; + + std::list<NLAIAGENT::CAgentNumber>::iterator itr = _AgentServerID.begin(); + while(itr != _AgentServerID.end()) + { + if(*(itr ++) == id) return; + } + _AgentServerID.push_back(id); + } + + void CApplication::releaseManager( const TAgentId& agtid ) + { + NLAIAGENT::CAgentNumber id; + id.CreatorId = agtid.CreatorSId; + id.DynamicId = agtid.CurrentSId; + id.AgentNumber = agtid.SerialNumber; + + std::list<NLAIAGENT::CAgentNumber>::iterator itr = _AgentServerID.begin(); + while(itr != _AgentServerID.end()) + { + if(*(itr ++) == id) + { + _AgentServerID.erase(itr); + return; + } + } + } + + void CApplication::correctAgentLocation( TAgentId new_aid ) + { + } + + NLAIAGENT::IObjectIA::CProcessResult CApplication::sendMessage(const NLAIAGENT::CAgentNumber &ref,NLAIAGENT::IObjectIA *m) + { + NLNET::CMessage msg("Ag"); + msg.serial( (NLAIC::CIdentType &)m->getType() ); + msg.serial(*m); + const NLAIAGENT::CNumericIndex &id = ((const NLAIAGENT::IWordNumRef &)*this).getNumIdent(); + CAgentService::sendToAgent(getId(id.getId()),getId(ref),msg); + return NLAIAGENT::IObjectIA::CProcessResult(); + } + + void CApplication::init(NLMISC::CSynchronized<IManager *> &thisSync) + { + initServer(); + + bool i = haveActivity(); + + _Runnable = new SRV::CVoidRun(thisSync, _MessageList); + _ManagerRun = NLMISC::IThread::create(_Runnable); + _Runnable->setThread(_ManagerRun); + _Shell = new CPyEditWin(_MessageList,*_ManagerRun); + _ManagerRun->start(); + + const NLAIAGENT::CNumericIndex &id = ((const NLAIAGENT::IWordNumRef &)*this).getNumIdent(); + char text[1024]; + id.getDebugString(text); + _CodeContext->InputOutput->Echo("service %s is run\n",text); + } + + clock_t start = clock() - 11; + + NLAIAGENT::IObjectIA::CProcessResult CApplication::runActivity() + { + + /*NLNET::CMessage msg("PING"); + CMessageService m("PINGS",new CObjectSerial(msg)); + CMsgTranslater::MsgTranslater->sendMessage((CMessageService *)m.clone());*/ + + /*double time = ((double)(clock() - start))/(double)CLOCKS_PER_SEC; + if(time >= 5) + { + NLAIAGENT::CGroupType g; + NLAIAGENT::CStringType *name = new NLAIAGENT::CStringType(NLAIAGENT::CStringVarName("Mektoube")); + name->incRef(); + g.push(name); + CCreatureHerbivore *x = new CCreatureHerbivore(this); + x->incRef(); + x->connect(); + g.push(x); + addDynamicAgent(&g); + start = clock(); + }*/ + + NLMISC::CSynchronized<CMsgTranslater *>::CAccessor a(CMsgTranslater::MsgTranslater); + a.value()->run(); + + return NLAIAGENT::IObjectIA::CProcessResult(); + } + + NLAIAGENT::IMessageBase *CApplication::runKill(const NLAIAGENT::IMessageBase &m) + { + _Active = false; + //_ManagerRun->terminate(); + return (NLAIAGENT::IMessageBase *)m.clone(); + } + + void CApplication::leave() + { + _ManagerRun->terminate(); + } + + CApplication::~CApplication() + { + NLAIPYSERVER::endPythonInterface(SRV::CPyEditWin::PyServer); + if(logFileState) logStream.close(); + _Shell->release(); + delete _Runnable; + delete _ManagerRun; + } +} diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.1&sortby=author b/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.1&sortby=author new file mode 100644 index 00000000..666c7d38 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.1&sortby=author @@ -0,0 +1,11 @@ +#! /bin/sh + +set -x + +rm -f config.cache + +aclocal \ +&& autoheader \ +&& automake --gnu --add-missing --copy \ +&& autoconf + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.2&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.2&content-type=text/plain/index.html new file mode 100644 index 00000000..da0b43dd --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.2&content-type=text/plain/index.html @@ -0,0 +1,18 @@ +#! /bin/sh + +set -x + +rm -f config.cache + +# This is to avoid atomake to complain about the fact that there is no +# ChangeLog File at the moment +if test ! -f ChangeLog +then + touch ChangeLog +fi + +aclocal \ +&& autoheader \ +&& automake --gnu --add-missing --copy \ +&& autoconf + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.2&sortby=date b/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.2&sortby=date new file mode 100644 index 00000000..da0b43dd --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.2&sortby=date @@ -0,0 +1,18 @@ +#! /bin/sh + +set -x + +rm -f config.cache + +# This is to avoid atomake to complain about the fact that there is no +# ChangeLog File at the moment +if test ! -f ChangeLog +then + touch ChangeLog +fi + +aclocal \ +&& autoheader \ +&& automake --gnu --add-missing --copy \ +&& autoconf + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.3&only_with_tag=MAIN b/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.3&only_with_tag=MAIN new file mode 100644 index 00000000..665f3f13 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/bootstrap?rev=1.3&only_with_tag=MAIN @@ -0,0 +1,23 @@ +#! /bin/sh + +set -x + +rm -f config.cache + +# This is to avoid atomake to complain about the fact that there is no +# ChangeLog or README file at the moment +if test ! -f ChangeLog +then + touch ChangeLog +fi + +if test ! -f README +then + touch README +fi + +aclocal \ +&& autoheader \ +&& automake --gnu --add-missing --copy \ +&& autoconf + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?content-type=text/plain&rev=1.1 b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?content-type=text/plain&rev=1.1 new file mode 100644 index 00000000..a564a022 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?content-type=text/plain&rev=1.1 @@ -0,0 +1,289 @@ +dnl +dnl Configuration script for NeLNS +dnl +dnl $Id: configure.in,v 1.1 2001/04/18 13:54:25 valignat Exp $ +dnl + +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(log_service/log_service.h) + +MAJOR_VERSION=0 +MINOR_VERSION=3 +PICO_VERSION=0 + +AM_INIT_AUTOMAKE(netns, $MAJOR_VERSION.$MINOR_VERSION.$PICO_VERSION) + +AM_CONFIG_HEADER(config.h) + + +dnl The following hack should ensure that configure doesn't add optimizing +dnl or debugging flags to CFLAGS or CXXFLAGS +CFLAGS="$CFLAGS " +CXXFLAGS="$CXXFLAGS " + + +dnl ==================================================================== +dnl Checks for programs. + +AC_PROG_MAKE_SET + +AC_PROG_CC +AC_PROG_CXX + +AM_PROG_LIBTOOL + +AM_SANITY_CHECK + +AC_PROG_INSTALL + + +dnl ========== +dnl Python +dnl ========== + +AC_ARG_WITH( python, + [ --with-python=<path> path to the Python prefix installation directory. + e.g. /usr/local], + [PYTHON_PREFIX=$withval + AC_MSG_RESULT(using Python located in $withval.)] +) + +if test ! "$PYTHON_PREFIX" = "" +then + PATH="$PYTHON_PREFIX/bin:$PATH" +fi + +AC_ARG_WITH( python-version, + [ --with-python-version=<version> + Python version to use, e.g. 1.5], + [PYTHON_VERSION=$withval + AC_MSG_RESULT(using Python $withval.)] +) + +if test ! "$PYTHON_VERSION" = "" +then + PYTHON_EXEC="python$PYTHON_VERSION" +else + PYTHON_EXEC="python python2.0 python1.5" +fi + +AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH) +if test "$PYTHON" = "no"; +then + AC_MSG_ERROR([Python is needed to compile NeL (www.python.org)]) +fi + + +dnl ==================================================================== +dnl Configure Settings + +AC_LANG_CPLUSPLUS + + +dnl ==================================================================== +dnl Checks for typedefs, structures, and compiler characteristics. + +AC_C_CONST + +dnl Add the define _REENTRANT for a correct use of the threads +if test "X$CC" = "Xgcc"; +then + CXXFLAGS="$CXXFLAGS -D_REENTRANT" +fi + + +dnl ==================================================================== +dnl Checks for header files. + +AC_STDC_HEADERS +AC_CHECK_HEADERS(fcntl.h unistd.h) + + +dnl ========== +dnl STLPort +dnl ========== + +dnl Ask user for path to the STLport header files +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort header files directory. + e.g. /usr/local/include/stlport], + [STLPORT_DIR=$with_stlport + AC_MSG_RESULT(using STLPort header files located in $with_stlport)], + AC_MSG_ERROR([You must call configure with the --with-stlport option. + This tells configure where to find the STLPort header files. + e.g. --with-stlport=/usr/local/include/stlport]) +) + +if test X"$STLPORT_DIR" != X""; +then + CXXFLAGS="-I$STLPORT_DIR $CXXFLAGS" +fi + +dnl Ask user for path to the STLPort library files +AC_ARG_WITH( stllib, + [ --with-stllib=<path> path to the STLPort installation directory. + e.g. /usr/local/lib/stlport], + [STLLIB_DIR=$with_stllib + AC_MSG_RESULT(using STLPort library located in $with_stllib)] +) + +if test X"$STLLIB_DIR" != X""; +then + LIBS="-L$STLLIB_DIR $LIBS" +fi + +LIBS="$LIBS -lstlport_gcc" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS" + +AC_MSG_CHECKING(for STLPort) +AC_EGREP_CPP( yo_stlport, +[#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], +[AC_MSG_RESULT(yes)], +AC_MSG_ERROR([STLPort is needed to compile NeLNS (www.stlport.org)]) +) + +CPPFLAGS="$_CPPFLAGS" + + +dnl ========== +dnl NeL +dnl ========== + +dnl Ask user for path to the NeL header files +AC_ARG_WITH( nel, + [ --with-nel=<prefix> prefix to the NeL files installation. + e.g. /usr/local/include], + [NEL_DIR=$with_nel + AC_MSG_RESULT(using NeL header files located in $with_nel)] +) + +if test X"$NEL_DIR" != X""; +then + CXXFLAGS="-I$NEL_DIR/include $CXXFLAGS" + LIBS="-L$NEL_DIR/lib $LIBS" +fi + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS" + +AC_MSG_CHECKING(for NeL) +AC_EGREP_CPP( yo_nel, +[#include <nel/net.h> +#ifdef NL_NET_H + yo_nel +#endif], +[AC_MSG_RESULT(yes)], +AC_MSG_ERROR([NeL is needed to compile the NeLNS (www.nevrax.org)]) +) + + +dnl ========== +dnl Python +dnl ========== + +PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'` +PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'` + +PYTHON_CFLAGS="-I$PYTHON_PREFIX/include/python$PYTHON_VERSION" +PYTHON_LIBS="-L$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config -lpython$PYTHON_VERSION" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}" + +AC_SUBST(PYTHON_CFLAGS) + +AC_MSG_CHECKING(for Python header files) +AC_EGREP_CPP( yo_python, +[#include <Python.h> + yo_python +], +[AC_MSG_RESULT(ok)], +AC_MSG_ERROR([Python is needed to compile NeL (www.python.org).]) +) + +CPPFLAGS="$_CPPFLAGS" + +AC_SUBST(PYTHON_CFLAGS) +AC_SUBST(PYTHON_LIBS) + + +dnl ========== +dnl Debug/optimized compilation mode +dnl ========== + +MAX_C_OPTIMIZE="-O6" + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" +fi +AC_ARG_WITH(debug, + [ --with-debug[=full] Build a debug version (huge libraries) + --without-debug Build withoug debugging code (default)], + [with_debug=$withval], + [with_debug=no]) +if test "$with_debug" = "yes" +then + dnl Medium debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS" +elif test "$with_debug" = "full" +then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS" +else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS" +fi + + +dnl ==================================================================== +dnl Checks for libraries. + + +dnl ==================================================================== +dnl Checks for library functions. + + +dnl ==================================================================== +dnl Output files to generate. + +AC_OUTPUT( Makefile \ + login_service/Makefile \ + log_service/Makefile \ + naming_service/Makefile \ + time_service/Makefile \ + agent_service/Makefile \ + agent_service/creature/Makefile \ + agent_service/plugin/Makefile \ + admin_executor_service/Makefile \ +) + + +dnl End of configure.in diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?content-type=text/plain&rev=1.14 b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?content-type=text/plain&rev=1.14 new file mode 100644 index 00000000..e3113ed5 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?content-type=text/plain&rev=1.14 @@ -0,0 +1,156 @@ +dnl ==================================================================== +dnl Configuration script for NeLNS +dnl ==================================================================== +dnl +dnl $Id: configure.in,v 1.14 2002/04/15 12:04:30 lecroart Exp $ +dnl + + +dnl ==================================================================== +dnl Process this file with autoconf to produce a configure script. +dnl ==================================================================== + +AC_INIT(admin_service/admin_service.cpp) + +MAJOR_VERSION=0 +MINOR_VERSION=3 +PICO_VERSION=0 + +AM_INIT_AUTOMAKE(nelns, $MAJOR_VERSION.$MINOR_VERSION.$PICO_VERSION) + +AM_CONFIG_HEADER(config.h) + + +dnl The following hack should ensure that configure doesn't add optimizing +dnl or debugging flags to CFLAGS or CXXFLAGS +CFLAGS="$CFLAGS " +CXXFLAGS="$CXXFLAGS " + + +dnl ==================================================================== +dnl Checks for programs. +dnl ==================================================================== + +AC_PROG_MAKE_SET + +AC_PROG_CC +AC_PROG_CXX + +AM_PROG_LIBTOOL + +AM_SANITY_CHECK + +AC_PROG_INSTALL + +AC_PATH_PROG(CCACHE, ccache) +if test "$CCACHE" +then + CXX="ccache $CXX" +fi + +dnl ==================================================================== +dnl Configure Settings +dnl ==================================================================== + +AC_LANG_CPLUSPLUS + + +dnl ==================================================================== +dnl Debug/optimized compilation mode +dnl ==================================================================== + +AM_NEL_DEBUG + + +dnl ==================================================================== +dnl Checks for typedefs, structures, and compiler characteristics. +dnl ==================================================================== + +dnl Add the define _REENTRANT for a correct use of the threads +if test "X$CC" = "Xgcc"; +then + CXXFLAGS="$CXXFLAGS -D_REENTRANT" +fi + + +dnl ==================================================================== +dnl Checks for header files. +dnl ==================================================================== + +AC_STDC_HEADERS +AC_CHECK_HEADERS(fcntl.h unistd.h) + + +dnl ==================================================================== +dnl Checks for libraries. +dnl ==================================================================== + +AC_CHECK_LIB(crypt, crypt) + +dnl ==================================================================== +dnl STLPort + +AM_PATH_STLPORT + + +dnl ==================================================================== +dnl NeL + +dnl misc net 3d pacs sound ai georges +AM_PATH_NEL("yes", "yes", "no", "no", "no", "no", "no") + +dnl ==================================================================== +dnl Checks for library functions. +dnl ==================================================================== + +dnl ==================================================================== +dnl nelns configuration and logs file location +dnl ==================================================================== + +test "x$prefix" = xNONE && prefix=$ac_default_prefix + +AC_ARG_WITH(sysconfdir, + [ --with-sysconfdir[=DIR] + use DIR instead of the default sysconfdir/nelns], + [pkgsysconfdir=$withval], + [pkgsysconfdir='${sysconfdir}/nelns']) +AC_SUBST(pkgsysconfdir) + +eval eval NELNS_CONFIG=\"$pkgsysconfdir/\" +AC_DEFINE_UNQUOTED(NELNS_CONFIG, "$NELNS_CONFIG") + +AC_ARG_WITH(localstatedir, + [ --with-localstatedir[=DIR] + use DIR instead of the default localstatedir/game/nelns], + [pkglocalstatedir=$withval], + [pkglocalstatedir=${localstatedir}/game/nelns]) +AC_SUBST(pkglocalstatedir) + +eval eval NELNS_STATE=\"$pkglocalstatedir/\" +AC_DEFINE_UNQUOTED(NELNS_STATE, "$NELNS_STATE") + +AC_ARG_WITH(logdir, + [ --with-logdir[=DIR] + use DIR instead of the default localstatedir/log/nelns], + [logdir=$withval], + [logdir='${localstatedir}/log/nelns']) +AC_SUBST(logdir) + +eval eval NELNS_LOGS=\"$logdir/\" +AC_DEFINE_UNQUOTED(NELNS_LOGS, "$NELNS_LOGS") + +dnl ==================================================================== +dnl Output files to generate. +dnl ==================================================================== + +AC_OUTPUT( Makefile \ + login_service/Makefile \ + naming_service/Makefile \ + admin_executor_service/Makefile \ + admin_service/Makefile \ + welcome_service/Makefile \ +) + + +dnl End of configure.in + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.15&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.15&content-type=text/plain/index.html new file mode 100644 index 00000000..ac14e56e --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.15&content-type=text/plain/index.html @@ -0,0 +1,153 @@ +dnl ==================================================================== +dnl Configuration script for NeLNS +dnl ==================================================================== +dnl +dnl $Id: configure.in,v 1.15 2002/04/16 12:01:39 valignat Exp $ +dnl + + +dnl ==================================================================== +dnl Process this file with autoconf to produce a configure script. +dnl ==================================================================== + +AC_INIT(admin_service/admin_service.cpp) + +MAJOR_VERSION=0 +MINOR_VERSION=3 +PICO_VERSION=0 + +AM_INIT_AUTOMAKE(nelns, $MAJOR_VERSION.$MINOR_VERSION.$PICO_VERSION) + +AM_CONFIG_HEADER(config.h) + + +dnl The following hack should ensure that configure doesn't add optimizing +dnl or debugging flags to CFLAGS or CXXFLAGS +CFLAGS="$CFLAGS " +CXXFLAGS="$CXXFLAGS " + + +dnl ==================================================================== +dnl Checks for programs. +dnl ==================================================================== + +AC_PROG_MAKE_SET + +AC_PROG_CC +AC_PROG_CXX + +AM_PROG_LIBTOOL + +AM_SANITY_CHECK + +AC_PROG_INSTALL + +AM_PATH_CCACHE + + +dnl ==================================================================== +dnl Configure Settings +dnl ==================================================================== + +AC_LANG_CPLUSPLUS + + +dnl ==================================================================== +dnl Debug/optimized compilation mode +dnl ==================================================================== + +AM_NEL_DEBUG + + +dnl ==================================================================== +dnl Checks for typedefs, structures, and compiler characteristics. +dnl ==================================================================== + +dnl Add the define _REENTRANT for a correct use of the threads +if test "X$CC" = "Xgcc"; +then + CXXFLAGS="$CXXFLAGS -D_REENTRANT" +fi + + +dnl ==================================================================== +dnl Checks for header files. +dnl ==================================================================== + +AC_STDC_HEADERS +AC_CHECK_HEADERS(fcntl.h unistd.h) + + +dnl ==================================================================== +dnl Checks for libraries. +dnl ==================================================================== + +AC_CHECK_LIB(crypt, crypt) + +dnl ==================================================================== +dnl STLPort + +AM_PATH_STLPORT + + +dnl ==================================================================== +dnl NeL + +dnl misc net 3d pacs sound ai georges +AM_PATH_NEL("yes", "yes", "no", "no", "no", "no", "no") + +dnl ==================================================================== +dnl Checks for library functions. +dnl ==================================================================== + +dnl ==================================================================== +dnl nelns configuration and logs file location +dnl ==================================================================== + +test "x$prefix" = xNONE && prefix=$ac_default_prefix + +AC_ARG_WITH(sysconfdir, + [ --with-sysconfdir[=DIR] + use DIR instead of the default sysconfdir/nelns], + [pkgsysconfdir=$withval], + [pkgsysconfdir='${sysconfdir}/nelns']) +AC_SUBST(pkgsysconfdir) + +eval eval NELNS_CONFIG=\"$pkgsysconfdir/\" +AC_DEFINE_UNQUOTED(NELNS_CONFIG, "$NELNS_CONFIG") + +AC_ARG_WITH(localstatedir, + [ --with-localstatedir[=DIR] + use DIR instead of the default localstatedir/game/nelns], + [pkglocalstatedir=$withval], + [pkglocalstatedir=${localstatedir}/game/nelns]) +AC_SUBST(pkglocalstatedir) + +eval eval NELNS_STATE=\"$pkglocalstatedir/\" +AC_DEFINE_UNQUOTED(NELNS_STATE, "$NELNS_STATE") + +AC_ARG_WITH(logdir, + [ --with-logdir[=DIR] + use DIR instead of the default localstatedir/log/nelns], + [logdir=$withval], + [logdir='${localstatedir}/log/nelns']) +AC_SUBST(logdir) + +eval eval NELNS_LOGS=\"$logdir/\" +AC_DEFINE_UNQUOTED(NELNS_LOGS, "$NELNS_LOGS") + +dnl ==================================================================== +dnl Output files to generate. +dnl ==================================================================== + +AC_OUTPUT( Makefile \ + login_service/Makefile \ + naming_service/Makefile \ + admin_executor_service/Makefile \ + admin_service/Makefile \ + welcome_service/Makefile \ +) + + +dnl End of configure.in + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.4&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.4&content-type=text/plain/index.html new file mode 100644 index 00000000..c0341569 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.4&content-type=text/plain/index.html @@ -0,0 +1,221 @@ +dnl +dnl Configuration script for NeLNS +dnl +dnl $Id: configure.in,v 1.4 2001/08/07 12:41:46 valignat Exp $ +dnl + +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(log_service/log_service.h) + +MAJOR_VERSION=0 +MINOR_VERSION=3 +PICO_VERSION=0 + +AM_INIT_AUTOMAKE(netns, $MAJOR_VERSION.$MINOR_VERSION.$PICO_VERSION) + +AM_CONFIG_HEADER(config.h) + + +dnl The following hack should ensure that configure doesn't add optimizing +dnl or debugging flags to CFLAGS or CXXFLAGS +CFLAGS="$CFLAGS " +CXXFLAGS="$CXXFLAGS " + + +dnl ==================================================================== +dnl Checks for programs. + +AC_PROG_MAKE_SET + +AC_PROG_CC +AC_PROG_CXX + +AM_PROG_LIBTOOL + +AM_SANITY_CHECK + +AC_PROG_INSTALL + + +dnl ==================================================================== +dnl Configure Settings + +AC_LANG_CPLUSPLUS + + +dnl ==================================================================== +dnl Checks for typedefs, structures, and compiler characteristics. + +AC_C_CONST + +dnl Add the define _REENTRANT for a correct use of the threads +if test "X$CC" = "Xgcc"; +then + CXXFLAGS="$CXXFLAGS -D_REENTRANT" +fi + + +dnl ==================================================================== +dnl Checks for header files. + +AC_STDC_HEADERS +AC_CHECK_HEADERS(fcntl.h unistd.h) + + +dnl ========== +dnl STLPort +dnl ========== + +dnl Ask user for path to the STLport header files +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort header files directory. + e.g. /usr/local/include/stlport], + [STLPORT_DIR=$with_stlport + AC_MSG_RESULT(using STLPort header files located in $with_stlport)], + AC_MSG_ERROR([You must call configure with the --with-stlport option. + This tells configure where to find the STLPort header files. + e.g. --with-stlport=/usr/local/include/stlport]) +) + +if test X"$STLPORT_DIR" != X""; +then + CXXFLAGS="-I$STLPORT_DIR $CXXFLAGS" +fi + +dnl Ask user for path to the STLPort library files +AC_ARG_WITH( stllib, + [ --with-stllib=<path> path to the STLPort installation directory. + e.g. /usr/local/lib/stlport], + [STLLIB_DIR=$with_stllib + AC_MSG_RESULT(using STLPort library located in $with_stllib)] +) + +if test X"$STLLIB_DIR" != X""; +then + LIBS="-L$STLLIB_DIR $LIBS" +fi + +LIBS="$LIBS -lstlport_gcc" + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS" + +AC_MSG_CHECKING(for STLPort) +AC_EGREP_CPP( yo_stlport, +[#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], +[AC_MSG_RESULT(yes)], +AC_MSG_ERROR([STLPort is needed to compile NeLNS (www.stlport.org)]) +) + +CPPFLAGS="$_CPPFLAGS" + + +dnl ========== +dnl NeL +dnl ========== + +dnl Ask user for path to the NeL header files +AC_ARG_WITH( nel, + [ --with-nel=<prefix> prefix to the NeL files installation. + e.g. /usr/local/include], + [NEL_DIR=$with_nel + AC_MSG_RESULT(using NeL header files located in $with_nel)] +) + +if test X"$NEL_DIR" != X""; +then + CXXFLAGS="-I$NEL_DIR/include $CXXFLAGS" + LIBS="-L$NEL_DIR/lib $LIBS" +fi + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS" + +AC_MSG_CHECKING(for NeL) +AC_EGREP_CPP( yo_nel, +[#include <nel/net.h> +#ifdef NL_NET_H + yo_nel +#endif], +[AC_MSG_RESULT(yes)], +AC_MSG_ERROR([NeL is needed to compile the NeLNS (www.nevrax.org)]) +) + + +dnl ========== +dnl Debug/optimized compilation mode +dnl ========== + +MAX_C_OPTIMIZE="-O6" + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" +fi +AC_ARG_WITH(debug, + [ --with-debug[=full] Build a debug version (huge libraries) + --without-debug Build withoug debugging code (default)], + [with_debug=$withval], + [with_debug=no]) +if test "$with_debug" = "yes" +then + dnl Medium debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS" +elif test "$with_debug" = "full" +then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS" +else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS" +fi + + +dnl ==================================================================== +dnl Checks for libraries. + + +dnl ==================================================================== +dnl Checks for library functions. + + +dnl ==================================================================== +dnl Output files to generate. + +AC_OUTPUT( Makefile \ + login_service/Makefile \ + log_service/Makefile \ + naming_service/Makefile \ + time_service/Makefile \ + admin_executor_service/Makefile \ + admin_service/Makefile \ + welcome_service/Makefile \ +) + + +dnl End of configure.in diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.5&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.5&content-type=text/plain/index.html new file mode 100644 index 00000000..9e17feb0 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.5&content-type=text/plain/index.html @@ -0,0 +1,258 @@ +dnl +dnl Configuration script for NeLNS +dnl +dnl $Id: configure.in,v 1.5 2001/08/07 12:58:26 valignat Exp $ +dnl + +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(log_service/log_service.h) + +MAJOR_VERSION=0 +MINOR_VERSION=3 +PICO_VERSION=0 + +AM_INIT_AUTOMAKE(netns, $MAJOR_VERSION.$MINOR_VERSION.$PICO_VERSION) + +AM_CONFIG_HEADER(config.h) + + +dnl The following hack should ensure that configure doesn't add optimizing +dnl or debugging flags to CFLAGS or CXXFLAGS +CFLAGS="$CFLAGS " +CXXFLAGS="$CXXFLAGS " + + +dnl ==================================================================== +dnl Checks for programs. + +AC_PROG_MAKE_SET + +AC_PROG_CC +AC_PROG_CXX + +AM_PROG_LIBTOOL + +AM_SANITY_CHECK + +AC_PROG_INSTALL + + +dnl ==================================================================== +dnl Configure Settings + +AC_LANG_CPLUSPLUS + + +dnl ==================================================================== +dnl Checks for typedefs, structures, and compiler characteristics. + +AC_C_CONST + +dnl Add the define _REENTRANT for a correct use of the threads +if test "X$CC" = "Xgcc"; +then + CXXFLAGS="$CXXFLAGS -D_REENTRANT" +fi + + +dnl ==================================================================== +dnl Checks for header files. + +AC_STDC_HEADERS +AC_CHECK_HEADERS(fcntl.h unistd.h) + + +dnl ========== +dnl STLPort +dnl ========== + +dnl Ask user for path to the STLport files location +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install files directory. + e.g. /usr/local/stlport] +) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/include] +) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib] +) + +if test "$with_stlport" != "no" +then + if test -z "$with_stlport" && test -z "$with_stlport_lib" -o -z "$with_stlpo +rt_include" + then + AC_MSG_ERROR([You must call configure with the --with-stlport or --with-stlport-lib and with-stlport-include options. +This tells configure where to find the STLPort files.]) + fi + + if test $with_stlport + then + AC_MSG_RESULT(using STLPort files located in $with_stlport) + + STLPORT_CFLAGS="$with_stlport/include" + STLPORT_LIB="$with_stlport/lib" + fi +else + no_stlport="no" + AC_MSG_RESULT(*** Override the use of the STLPorts (EXPERIMENTAL) ***) +fi + +if test -z "$no_stlport" -a "$with_stlport_include" +then + AC_MSG_RESULT(using STLPort header files located in $with_stlport_include) + STLPORT_CFLAGS="$with_stlport_include" +fi + +if test -z "$no_stlport" -a "$with_stlport_lib" +then + AC_MSG_RESULT(using STLPort library files located in $with_stlport_lib) + STLPORT_LIB="$with_stlport_lib" +fi + + +dnl ========== +dnl NeL +dnl ========== + +dnl Ask user for path to the NeL header files +AC_ARG_WITH( nel, + [ --with-nel=<prefix> prefix to the NeL files installation. + e.g. /usr/local/include], + [NEL_DIR=$with_nel + AC_MSG_RESULT(using NeL header files located in $with_nel)] +) + +if test X"$NEL_DIR" != X""; +then + CXXFLAGS="-I$NEL_DIR/include $CXXFLAGS" + LIBS="-L$NEL_DIR/lib $LIBS" +fi + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS" + +AC_MSG_CHECKING(for NeL) +AC_EGREP_CPP( yo_nel, +[#include <nel/net.h> +#ifdef NL_NET_H + yo_nel +#endif], +[AC_MSG_RESULT(yes)], +AC_MSG_ERROR([NeL is needed to compile the NeLNS (www.nevrax.org)]) +) + + +dnl ========== +dnl Debug/optimized compilation mode +dnl ========== + +MAX_C_OPTIMIZE="-O6" + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" +fi +AC_ARG_WITH(debug, + [ --with-debug[=full] Build a debug version (huge libraries) + --without-debug Build withoug debugging code (default)], + [with_debug=$withval], + [with_debug=no]) +if test "$with_debug" = "yes" +then + dnl Medium debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS" +elif test "$with_debug" = "full" +then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS" +else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS" +fi + + +dnl ==================================================================== +dnl Checks for libraries. + +dnl ========== +dnl STLPort +dnl ========== + +if test -z "$no_stlport" +then + + if test X"$STLPORT_CFLAGS" != X + then + CXXFLAGS="-I$STLPORT_CFLAGS $CXXFLAGS" + fi + + if test X"$STLPORT_LIB" != X + then + LIBS="-L$STLPORT_LIB $LIBS -lstlport_gcc" + fi + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS $STLPORT_CFLAGS" + + AC_MSG_CHECKING(for STLPort) + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + [ AC_MSG_RESULT(yes)], + AC_MSG_ERROR([STLPort is needed to compile NeL (www.stlport.org).]) ) + + CPPFLAGS="$_CPPFLAGS" +fi + + +dnl ==================================================================== +dnl Checks for library functions. + + +dnl ==================================================================== +dnl Output files to generate. + +AC_OUTPUT( Makefile \ + login_service/Makefile \ + log_service/Makefile \ + naming_service/Makefile \ + time_service/Makefile \ + admin_executor_service/Makefile \ + admin_service/Makefile \ + welcome_service/Makefile \ +) + + +dnl End of configure.in diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.6&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.6&content-type=text/plain/index.html new file mode 100644 index 00000000..57546b2d --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.6&content-type=text/plain/index.html @@ -0,0 +1,258 @@ +dnl +dnl Configuration script for NeLNS +dnl +dnl $Id: configure.in,v 1.6 2001/08/08 10:23:32 valignat Exp $ +dnl + +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(log_service/log_service.h) + +MAJOR_VERSION=0 +MINOR_VERSION=3 +PICO_VERSION=0 + +AM_INIT_AUTOMAKE(netns, $MAJOR_VERSION.$MINOR_VERSION.$PICO_VERSION) + +AM_CONFIG_HEADER(config.h) + + +dnl The following hack should ensure that configure doesn't add optimizing +dnl or debugging flags to CFLAGS or CXXFLAGS +CFLAGS="$CFLAGS " +CXXFLAGS="$CXXFLAGS " + + +dnl ==================================================================== +dnl Checks for programs. + +AC_PROG_MAKE_SET + +AC_PROG_CC +AC_PROG_CXX + +AM_PROG_LIBTOOL + +AM_SANITY_CHECK + +AC_PROG_INSTALL + + +dnl ==================================================================== +dnl Configure Settings + +AC_LANG_CPLUSPLUS + + +dnl ==================================================================== +dnl Checks for typedefs, structures, and compiler characteristics. + +AC_C_CONST + +dnl Add the define _REENTRANT for a correct use of the threads +if test "X$CC" = "Xgcc"; +then + CXXFLAGS="$CXXFLAGS -D_REENTRANT" +fi + + +dnl ==================================================================== +dnl Checks for header files. + +AC_STDC_HEADERS +AC_CHECK_HEADERS(fcntl.h unistd.h) + + +dnl ========== +dnl STLPort +dnl ========== + +dnl Ask user for path to the STLport files location +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install directory. + e.g. /usr/local/stlport] +) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport] +) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib] +) + +if test "$with_stlport" != "no" +then + if test -z "$with_stlport" && test -z "$with_stlport_lib" -o -z "$with_stlpo +rt_include" + then + AC_MSG_ERROR([You must call configure with the --with-stlport or --with-stlport-lib and with-stlport-include options. +This tells configure where to find the STLPort files.]) + fi + + if test $with_stlport + then + AC_MSG_RESULT(using STLPort files located in $with_stlport) + + STLPORT_CFLAGS="-I$with_stlport/stlport" + STLPORT_LIB="-L$with_stlport/lib" + fi +else + no_stlport="no" + AC_MSG_RESULT(*** Override the use of the STLPorts (EXPERIMENTAL) ***) +fi + +if test -z "$no_stlport" -a "$with_stlport_include" +then + AC_MSG_RESULT(using STLPort header files located in $with_stlport_include) + STLPORT_CFLAGS="-I$with_stlport_include" +fi + +if test -z "$no_stlport" -a "$with_stlport_lib" +then + AC_MSG_RESULT(using STLPort library files located in $with_stlport_lib) + STLPORT_LIB="i-L$with_stlport_lib" +fi + + +dnl ========== +dnl NeL +dnl ========== + +dnl Ask user for path to the NeL header files +AC_ARG_WITH( nel, + [ --with-nel=<prefix> prefix to the NeL files installation. + e.g. /usr/local/include], + [NEL_DIR=$with_nel + AC_MSG_RESULT(using NeL header files located in $with_nel)] +) + +if test X"$NEL_DIR" != X""; +then + CXXFLAGS="-I$NEL_DIR/include $CXXFLAGS" + LIBS="-L$NEL_DIR/lib $LIBS" +fi + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS" + +AC_MSG_CHECKING(for NeL) +AC_EGREP_CPP( yo_nel, +[#include <nel/net.h> +#ifdef NL_NET_H + yo_nel +#endif], +[AC_MSG_RESULT(yes)], +AC_MSG_ERROR([NeL is needed to compile the NeLNS (www.nevrax.org)]) +) + + +dnl ========== +dnl Debug/optimized compilation mode +dnl ========== + +MAX_C_OPTIMIZE="-O6" + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" +fi +AC_ARG_WITH(debug, + [ --with-debug[=full] Build a debug version (huge libraries) + --without-debug Build withoug debugging code (default)], + [with_debug=$withval], + [with_debug=no]) +if test "$with_debug" = "yes" +then + dnl Medium debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS" +elif test "$with_debug" = "full" +then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS" +else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS" +fi + + +dnl ==================================================================== +dnl Checks for libraries. + +dnl ========== +dnl STLPort +dnl ========== + +if test -z "$no_stlport" +then + + if test X"$STLPORT_CFLAGS" != X + then + CXXFLAGS="$STLPORT_CFLAGS $CXXFLAGS" + fi + + if test X"$STLPORT_LIB" != X + then + LIBS="$STLPORT_LIB $LIBS -lstlport_gcc" + fi + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS $STLPORT_CFLAGS" + + AC_MSG_CHECKING(for STLPort) + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + [ AC_MSG_RESULT(yes)], + AC_MSG_ERROR([STLPort is needed to compile NeL (www.stlport.org).]) ) + + CPPFLAGS="$_CPPFLAGS" +fi + + +dnl ==================================================================== +dnl Checks for library functions. + + +dnl ==================================================================== +dnl Output files to generate. + +AC_OUTPUT( Makefile \ + login_service/Makefile \ + log_service/Makefile \ + naming_service/Makefile \ + time_service/Makefile \ + admin_executor_service/Makefile \ + admin_service/Makefile \ + welcome_service/Makefile \ +) + + +dnl End of configure.in diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.8&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.8&content-type=text/plain/index.html new file mode 100644 index 00000000..1eeee2f2 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.8&content-type=text/plain/index.html @@ -0,0 +1,256 @@ +dnl +dnl Configuration script for NeLNS +dnl +dnl $Id: configure.in,v 1.8 2001/10/29 14:00:28 valignat Exp $ +dnl + +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(admin_service/admin_service.cpp) + +MAJOR_VERSION=0 +MINOR_VERSION=3 +PICO_VERSION=0 + +AM_INIT_AUTOMAKE(nelns, $MAJOR_VERSION.$MINOR_VERSION.$PICO_VERSION) + +AM_CONFIG_HEADER(config.h) + + +dnl The following hack should ensure that configure doesn't add optimizing +dnl or debugging flags to CFLAGS or CXXFLAGS +CFLAGS="$CFLAGS " +CXXFLAGS="$CXXFLAGS " + + +dnl ==================================================================== +dnl Checks for programs. + +AC_PROG_MAKE_SET + +AC_PROG_CC +AC_PROG_CXX + +AM_PROG_LIBTOOL + +AM_SANITY_CHECK + +AC_PROG_INSTALL + + +dnl ==================================================================== +dnl Configure Settings + +AC_LANG_CPLUSPLUS + + +dnl ==================================================================== +dnl Checks for typedefs, structures, and compiler characteristics. + +AC_C_CONST + +dnl Add the define _REENTRANT for a correct use of the threads +if test "X$CC" = "Xgcc"; +then + CXXFLAGS="$CXXFLAGS -D_REENTRANT" +fi + + +dnl ==================================================================== +dnl Checks for header files. + +AC_STDC_HEADERS +AC_CHECK_HEADERS(fcntl.h unistd.h) + + +dnl ========== +dnl STLPort +dnl ========== + +dnl Ask user for path to the STLport files location +AC_ARG_WITH( stlport, + [ --with-stlport=<path> path to the STLPort install directory. + e.g. /usr/local/stlport] +) + +AC_ARG_WITH( stlport-include, + [ --with-stlport-include=<path> + path to the STLPort header files directory. + e.g. /usr/local/stlport/stlport] +) + +AC_ARG_WITH( stlport-lib, + [ --with-stlport-lib=<path> + path to the STLPort library files directory. + e.g. /usr/local/stlport/lib] +) + +if test "$with_stlport" != "no" +then + if test -z "$with_stlport" && test -z "$with_stlport_lib" -o -z "$with_stlpo +rt_include" + then + AC_MSG_ERROR([You must call configure with the --with-stlport or --with-stlport-lib and with-stlport-include options. +This tells configure where to find the STLPort files.]) + fi + + if test $with_stlport + then + AC_MSG_RESULT(using STLPort files located in $with_stlport) + + STLPORT_CFLAGS="-I$with_stlport/stlport" + STLPORT_LIB="-L$with_stlport/lib" + fi +else + no_stlport="no" + AC_MSG_RESULT(*** Override the use of the STLPorts (EXPERIMENTAL) ***) +fi + +if test -z "$no_stlport" -a "$with_stlport_include" +then + AC_MSG_RESULT(using STLPort header files located in $with_stlport_include) + STLPORT_CFLAGS="-I$with_stlport_include" +fi + +if test -z "$no_stlport" -a "$with_stlport_lib" +then + AC_MSG_RESULT(using STLPort library files located in $with_stlport_lib) + STLPORT_LIB="-L$with_stlport_lib" +fi + + +dnl ========== +dnl NeL +dnl ========== + +dnl Ask user for path to the NeL header files +AC_ARG_WITH( nel, + [ --with-nel=<prefix> prefix to the NeL files installation. + e.g. /usr/local], + [ NEL_DIR=$with_nel + AC_MSG_RESULT(using NeL files located in $with_nel)] +) + +if test X"$NEL_DIR" != X""; +then + CXXFLAGS="-I$NEL_DIR/include $CXXFLAGS" + LIBS="-L$NEL_DIR/lib $LIBS" +fi + +_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS" + +AC_MSG_CHECKING(for NeL) +AC_EGREP_CPP( yo_nel, +[#include <nel/net.h> +#ifdef NL_NET_H + yo_nel +#endif], +[AC_MSG_RESULT(yes)], +AC_MSG_ERROR([NeL is needed to compile the NeLNS (www.nevrax.org)]) +) + + +dnl ========== +dnl Debug/optimized compilation mode +dnl ========== + +MAX_C_OPTIMIZE="-O6" + +dnl Build optimized or debug version ? +dnl First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" +fi +AC_ARG_WITH(debug, + [ --with-debug[=full] Build a debug version (huge libraries) + --without-debug Build withoug debugging code (default)], + [with_debug=$withval], + [with_debug=no]) +if test "$with_debug" = "yes" +then + dnl Medium debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS" +elif test "$with_debug" = "full" +then + dnl Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS" +else + dnl Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS" +fi + + +dnl ==================================================================== +dnl Checks for libraries. + +dnl ========== +dnl STLPort +dnl ========== + +if test -z "$no_stlport" +then + + if test X"$STLPORT_CFLAGS" != X + then + CXXFLAGS="$STLPORT_CFLAGS $CXXFLAGS" + fi + + if test X"$STLPORT_LIB" != X + then + LIBS="$STLPORT_LIB $LIBS -lstlport_gcc" + fi + + _CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CXXFLAGS $STLPORT_CFLAGS" + + AC_MSG_CHECKING(for STLPort) + AC_EGREP_CPP( yo_stlport, + [#include <algorithm> +#ifdef __SGI_STL_PORT + yo_stlport +#endif], + [ AC_MSG_RESULT(yes)], + AC_MSG_ERROR([STLPort is needed to compile NeL (www.stlport.org).]) ) + + CPPFLAGS="$_CPPFLAGS" +fi + + +dnl ==================================================================== +dnl Checks for library functions. + + +dnl ==================================================================== +dnl Output files to generate. + +AC_OUTPUT( Makefile \ + login_service/Makefile \ + naming_service/Makefile \ + admin_executor_service/Makefile \ + admin_service/Makefile \ + welcome_service/Makefile \ +) + + +dnl End of configure.in diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.9&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.9&content-type=text/plain/index.html new file mode 100644 index 00000000..86b40350 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/configure.in?rev=1.9&content-type=text/plain/index.html @@ -0,0 +1,110 @@ +dnl +dnl Configuration script for NeLNS +dnl +dnl $Id: configure.in,v 1.9 2002/01/07 16:09:52 valignat Exp $ +dnl + +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(admin_service/admin_service.cpp) + +MAJOR_VERSION=0 +MINOR_VERSION=3 +PICO_VERSION=0 + +AM_INIT_AUTOMAKE(nelns, $MAJOR_VERSION.$MINOR_VERSION.$PICO_VERSION) + +AM_CONFIG_HEADER(config.h) + + +dnl The following hack should ensure that configure doesn't add optimizing +dnl or debugging flags to CFLAGS or CXXFLAGS +CFLAGS="$CFLAGS " +CXXFLAGS="$CXXFLAGS " + + +dnl ==================================================================== +dnl Checks for programs. +dnl ==================================================================== + +AC_PROG_MAKE_SET + +AC_PROG_CC +AC_PROG_CXX + +AM_PROG_LIBTOOL + +AM_SANITY_CHECK + +AC_PROG_INSTALL + + +dnl ==================================================================== +dnl Configure Settings +dnl ==================================================================== + +AC_LANG_CPLUSPLUS + + +dnl ==================================================================== +dnl Debug/optimized compilation mode +dnl ==================================================================== + +AM_NEL_DEBUG + + +dnl ==================================================================== +dnl Checks for typedefs, structures, and compiler characteristics. +dnl ==================================================================== + +AC_C_CONST + +dnl Add the define _REENTRANT for a correct use of the threads +if test "X$CC" = "Xgcc"; +then + CXXFLAGS="$CXXFLAGS -D_REENTRANT" +fi + + +dnl ==================================================================== +dnl Checks for header files. + +AC_STDC_HEADERS +AC_CHECK_HEADERS(fcntl.h unistd.h) + + +dnl ==================================================================== +dnl Checks for libraries. + +dnl ========================================================================== +dnl STLPort + +AM_PATH_STLPORT + + +dnl ========================================================================== +dnl NeL + +AM_PATH_NEL("yes", "yes", "no", "no", "no", "no") + +CXXFLAGS="$CXXFLAGS ${NEL_CFLAGS}" +LIBS="$LIBS ${NEL_LIBS}" + + +dnl ==================================================================== +dnl Checks for library functions. + + +dnl ==================================================================== +dnl Output files to generate. + +AC_OUTPUT( Makefile \ + login_service/Makefile \ + naming_service/Makefile \ + admin_executor_service/Makefile \ + admin_service/Makefile \ + welcome_service/Makefile \ +) + + +dnl End of configure.in diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.1&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.1&content-type=text/plain/index.html new file mode 100644 index 00000000..7e36001f --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.1&content-type=text/plain/index.html @@ -0,0 +1,182 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "admin_executor_service"=.\moves_service\admin_executor_service\admin_executor_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "agent_service"=.\agent_service\agent_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "ia"=..\nel\src\ai.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "log_service"=.\log_service\log_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "login_service"=.\login_service\login_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "misc"=..\nel\src\misc.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "moves_service"=.\moves_service\moves_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "naming_service"=.\naming_service\naming_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "net"=..\nel\src\net.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency +}}} + +############################################################################### + +Project: "time_service"=.\time_service\time_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.2&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.2&content-type=text/plain/index.html new file mode 100644 index 00000000..a94da8e2 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.2&content-type=text/plain/index.html @@ -0,0 +1,221 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "admin"=..\nel\tools\net\admin\admin.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "admin_executor_service"=.\admin_executor_service\admin_executor_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "admin_service"=.\admin_service\admin_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "log_service"=.\log_service\log_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "login_service"=.\login_service\login_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "misc"=..\nel\src\misc.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "naming_service"=.\naming_service\naming_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "net"=..\nel\src\net.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency +}}} + +############################################################################### + +Project: "pacs"=..\nel\src\pacs.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "pacs_service"=.\pacs_service\pacs_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name pacs + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "time_service"=.\time_service\time_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "welcome_service"=.\welcome_service\welcome_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.3&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.3&content-type=text/plain/index.html new file mode 100644 index 00000000..838bf01d --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.3&content-type=text/plain/index.html @@ -0,0 +1,200 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "admin_executor_service"=.\admin_executor_service\admin_executor_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "admin_service"=.\admin_service\admin_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "agent_service"=.\agent_service\agent_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "ia"=..\nel\src\ai.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "log_service"=.\log_service\log_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "login_service"=.\login_service\login_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "misc"=..\nel\src\misc.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "naming_service"=.\naming_service\naming_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "net"=..\nel\src\net.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency +}}} + +############################################################################### + +Project: "time_service"=.\time_service\time_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "welcome_service"=.\welcome_service\welcome_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.4&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.4&content-type=text/plain/index.html new file mode 100644 index 00000000..c1d09c3a --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.4&content-type=text/plain/index.html @@ -0,0 +1,218 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "admin"=..\nel\tools\net\admin\admin.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "admin_executor_service"=.\admin_executor_service\admin_executor_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "admin_service"=.\admin_service\admin_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "agent_service"=.\agent_service\agent_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "ia"=..\nel\src\ai.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "log_service"=.\log_service\log_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "login_service"=.\login_service\login_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "misc"=..\nel\src\misc.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "naming_service"=.\naming_service\naming_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "net"=..\nel\src\net.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency +}}} + +############################################################################### + +Project: "time_service"=.\time_service\time_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "welcome_service"=.\welcome_service\welcome_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.5&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.5&content-type=text/plain/index.html new file mode 100644 index 00000000..d643a665 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.5&content-type=text/plain/index.html @@ -0,0 +1,200 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "admin"=..\nel\tools\net\admin\admin.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "admin_executor_service"=.\admin_executor_service\admin_executor_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "admin_service"=.\admin_service\admin_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "ia"=..\nel\src\ai.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "log_service"=.\log_service\log_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "login_service"=.\login_service\login_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "misc"=..\nel\src\misc.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "naming_service"=.\naming_service\naming_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "net"=..\nel\src\net.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency +}}} + +############################################################################### + +Project: "time_service"=.\time_service\time_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "welcome_service"=.\welcome_service\welcome_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.6&content-type=text/plain/index.html b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.6&content-type=text/plain/index.html new file mode 100644 index 00000000..a94da8e2 --- /dev/null +++ b/cvs/cvsweb.cgi/~checkout~/code/nelns/services.dsw?rev=1.6&content-type=text/plain/index.html @@ -0,0 +1,221 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "admin"=..\nel\tools\net\admin\admin.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "admin_executor_service"=.\admin_executor_service\admin_executor_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "admin_service"=.\admin_service\admin_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "log_service"=.\log_service\log_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "login_service"=.\login_service\login_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "misc"=..\nel\src\misc.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "naming_service"=.\naming_service\naming_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "net"=..\nel\src\net.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency +}}} + +############################################################################### + +Project: "pacs"=..\nel\src\pacs.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "pacs_service"=.\pacs_service\pacs_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name pacs + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "time_service"=.\time_service\time_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Project: "welcome_service"=.\welcome_service\welcome_service.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name misc + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + |