| 1 |
dnl # ************ <auto-copyright.pl BEGIN do not edit this line> ************ |
|---|
| 2 |
dnl # |
|---|
| 3 |
dnl # VR Juggler is (C) Copyright 1998, 1999, 2000, 2001, 2002 |
|---|
| 4 |
dnl # by Iowa State University |
|---|
| 5 |
dnl # |
|---|
| 6 |
dnl # Original Authors: |
|---|
| 7 |
dnl # Allen Bierbaum, Christopher Just, |
|---|
| 8 |
dnl # Patrick Hartling, Kevin Meinert, |
|---|
| 9 |
dnl # Carolina Cruz-Neira, Albert Baker |
|---|
| 10 |
dnl # |
|---|
| 11 |
dnl # This library is free software; you can redistribute it and/or |
|---|
| 12 |
dnl # modify it under the terms of the GNU Library General Public |
|---|
| 13 |
dnl # License as published by the Free Software Foundation; either |
|---|
| 14 |
dnl # version 2 of the License, or (at your option) any later version. |
|---|
| 15 |
dnl # |
|---|
| 16 |
dnl # This library is distributed in the hope that it will be useful, |
|---|
| 17 |
dnl # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 18 |
dnl # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 19 |
dnl # Library General Public License for more details. |
|---|
| 20 |
dnl # |
|---|
| 21 |
dnl # You should have received a copy of the GNU Library General Public |
|---|
| 22 |
dnl # License along with this library; if not, write to the |
|---|
| 23 |
dnl # Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|---|
| 24 |
dnl # Boston, MA 02111-1307, USA. |
|---|
| 25 |
dnl # |
|---|
| 26 |
dnl # ----------------------------------------------------------------- |
|---|
| 27 |
dnl # File: $RCSfile$ |
|---|
| 28 |
dnl # Date modified: $Date$ |
|---|
| 29 |
dnl # Version: $Revision$ |
|---|
| 30 |
dnl # ----------------------------------------------------------------- |
|---|
| 31 |
dnl # |
|---|
| 32 |
dnl # ************* <auto-copyright.pl END do not edit this line> ************* |
|---|
| 33 |
|
|---|
| 34 |
dnl # ------------------------------------------------------------------------- |
|---|
| 35 |
dnl # Base configure.in for VR Juggler. |
|---|
| 36 |
dnl # ------------------------------------------------------------------------- |
|---|
| 37 |
dnl # This file is "compiled" by GNU autoconf to generate the configure script |
|---|
| 38 |
dnl # that is actually run. |
|---|
| 39 |
dnl # ------------------------------------------------------------------------- |
|---|
| 40 |
dnl # |
|---|
| 41 |
|
|---|
| 42 |
AC_REVISION($Revision$) |
|---|
| 43 |
AC_INIT(vjConfig.h) |
|---|
| 44 |
AC_CONFIG_HEADER(vjDefines.h) |
|---|
| 45 |
|
|---|
| 46 |
dnl # ------------------------------------------------------------------------- |
|---|
| 47 |
dnl # Helper subroutines. |
|---|
| 48 |
dnl # ------------------------------------------------------------------------- |
|---|
| 49 |
|
|---|
| 50 |
dnl # This is a copy of DPP_WIN32_SETUP from Doozer++ 1.5. It's renamed here |
|---|
| 51 |
dnl # to prevent any possible conflicts with the "real" version. |
|---|
| 52 |
AC_DEFUN(VJ_WIN32_SETUP, |
|---|
| 53 |
[ |
|---|
| 54 |
AC_PATH_PROG([CYGPATH], [cygpath], [no]) |
|---|
| 55 |
|
|---|
| 56 |
dnl UNIX path translator. This converts a UNIX-style path to a DOS/Win32 |
|---|
| 57 |
dnl path. With this routine, we can safely use UNIX paths for all Win32 |
|---|
| 58 |
dnl variables while the configure script runs. Then, immediately before |
|---|
| 59 |
dnl Makefile substitution is done, we can translate all the paths to |
|---|
| 60 |
dnl DOS-style for use in the Makefiles. |
|---|
| 61 |
unix2dos ( ) { |
|---|
| 62 |
dnl The first expression changes a "//C" drive name to "C:". It has a |
|---|
| 63 |
dnl pair of surrounding []'s because those symbols have special meaning |
|---|
| 64 |
dnl to m4(1). Without them, the first pair of []'s in the regular |
|---|
| 65 |
dnl expression will be lost. Similarly, the second expression chagnes |
|---|
| 66 |
dnl a "/cygdrive/C" drive name to "C:". |
|---|
| 67 |
dnl The third expression ensures that a path beginning with / is |
|---|
| 68 |
dnl returned as being a directory on the home drive. The UNIX utilities |
|---|
| 69 |
dnl treat $HOMEDRIVE as the root directory and will give, for example, |
|---|
| 70 |
dnl /tmp instead of //D/tmp if D: is the home drive. The expression |
|---|
| 71 |
dnl simply prepends "$HOMEDRIVE" (after evaluation) to the path. |
|---|
| 72 |
dpp_drive_exp=['s/^\/\/\([[:alpha:]]\)/\1:/'] |
|---|
| 73 |
dpp_drive_exp2=['s/^\/cygdrive\/\([[:alpha:]]\)/\1:/'] |
|---|
| 74 |
dpp_add_home_exp=["s/^\//$HOMEDRIVE\//"] |
|---|
| 75 |
|
|---|
| 76 |
dnl If we have a value in $CYGPATH, use it to convert the path from |
|---|
| 77 |
dnl UNIX to Win32. |
|---|
| 78 |
if test "x$CYGPATH" != "xno" ; then |
|---|
| 79 |
dnl The -p option tells that we are given a simple path. |
|---|
| 80 |
if test "x${1}" = "x-p" ; then |
|---|
| 81 |
dpp_retval=`$CYGPATH --windows ${2} | sed -e ['s/\\\\/\//g']` |
|---|
| 82 |
else |
|---|
| 83 |
dnl With the newer Cygwin code, we can use $CYGPATH to get the |
|---|
| 84 |
dnl Win32 version of /. |
|---|
| 85 |
dpp_cygroot=`$CYGPATH --windows / | sed -e ['s/\\\\/\//g']` |
|---|
| 86 |
dpp_cygroot_exp=["s|^\/|$dpp_cygroot\/|"] |
|---|
| 87 |
dpp_retval=`echo ${1} | sed -e "$dpp_drive_exp" -e "$dpp_drive_exp2" -e "$dpp_cygroot_exp" -e "$dpp_add_home_exp"` |
|---|
| 88 |
fi |
|---|
| 89 |
dnl Otherwise, use only sed(1) which is a little more clumsy. |
|---|
| 90 |
else |
|---|
| 91 |
dnl Ignore the -p option in this case. |
|---|
| 92 |
if test "x${1}" = "x-p" ; then |
|---|
| 93 |
dpp_unix_path="${2}" |
|---|
| 94 |
else |
|---|
| 95 |
dpp_unix_path="${1}" |
|---|
| 96 |
fi |
|---|
| 97 |
|
|---|
| 98 |
dpp_retval=`echo $dpp_unix_path | sed -e "$dpp_drive_exp" -e "$dpp_drive_exp2" -e "$dpp_add_home_exp"` |
|---|
| 99 |
fi |
|---|
| 100 |
|
|---|
| 101 |
echo "$dpp_retval" |
|---|
| 102 |
} |
|---|
| 103 |
|
|---|
| 104 |
dnl DOS path translator. This converts a DOS-style path to a UNIX path. |
|---|
| 105 |
dos2unix ( ) { |
|---|
| 106 |
dnl All expressions hers are enclosed in []'s because those symbols |
|---|
| 107 |
dnl have special meaning to m4(1). This is the same situation as |
|---|
| 108 |
dnl above. |
|---|
| 109 |
|
|---|
| 110 |
dnl Ignore the -p option in this case. |
|---|
| 111 |
if test "x${1}" = "x-p" ; then |
|---|
| 112 |
dpp_dos_path="${2}" |
|---|
| 113 |
else |
|---|
| 114 |
dpp_dos_path="${1}" |
|---|
| 115 |
fi |
|---|
| 116 |
|
|---|
| 117 |
dnl If we have a value in $CYGPATH, use it to convert the path from |
|---|
| 118 |
dnl Win32 to UNIX. |
|---|
| 119 |
dnl The -p option tells that we are given a simple path. |
|---|
| 120 |
if test "x$CYGPATH" != "xno" -a "x${1}" != "x-p" ; then |
|---|
| 121 |
dpp_retval=`$CYGPATH --unix $dpp_dos_path` |
|---|
| 122 |
dnl Otherwise, use sed(1) which is a little more clumsy. |
|---|
| 123 |
else |
|---|
| 124 |
dnl This changes \'s to /'s and escapes any whitespace in the path. |
|---|
| 125 |
dpp_slash_exp=['s/\\/\//g'] |
|---|
| 126 |
dpp_ws_esc_exp=['s/ /\\ /g'] |
|---|
| 127 |
dpp_unix_root=`echo "$dpp_dos_path" | sed -e "$dpp_slash_exp" -e "$dpp_ws_esc_exp"` |
|---|
| 128 |
|
|---|
| 129 |
dnl This changes the leading "C:" to "//C" (for the appropriate |
|---|
| 130 |
dnl drive letter). |
|---|
| 131 |
dpp_colon_rem_exp=['s/\([[:alpha:]]\):/\/\/\1/g'] |
|---|
| 132 |
dpp_colon_rem_root=`echo "$dpp_unix_root" | sed -e "$dpp_colon_rem_exp"` |
|---|
| 133 |
|
|---|
| 134 |
dnl This changes any ";" into ":" |
|---|
| 135 |
dpp_semicolon_exp=['s/\;/:/g'] |
|---|
| 136 |
dpp_retval=`echo "$dpp_colon_rem_root" | sed -e "$dpp_semicolon_exp"` |
|---|
| 137 |
fi |
|---|
| 138 |
|
|---|
| 139 |
echo "$dpp_retval" |
|---|
| 140 |
} |
|---|
| 141 |
]) |
|---|
| 142 |
|
|---|
| 143 |
dnl # ------------------------------------------------------------------------- |
|---|
| 144 |
dnl # Command-line arguments (--enable-option, --with-pkg=package_name). |
|---|
| 145 |
dnl # ------------------------------------------------------------------------- |
|---|
| 146 |
|
|---|
| 147 |
dnl # -------------------------------------------- # |
|---|
| 148 |
dnl # --with-pkg[=arg] and --without-pkg arguments # |
|---|
| 149 |
dnl # -------------------------------------------- # |
|---|
| 150 |
|
|---|
| 151 |
dnl # Override the C compiler that configure would otherwise find itself. |
|---|
| 152 |
AC_ARG_WITH([cc], [ --with-cc=<PATH> Alternate C compiler ], |
|---|
| 153 |
[_alt_cc="$withval"], [_alt_cc='none']) |
|---|
| 154 |
|
|---|
| 155 |
dnl # Override the C++ compiler that configure would otherwise find itself. |
|---|
| 156 |
AC_ARG_WITH([cxx], [ --with-cxx=<PATH> Alternate C++ compiler ], |
|---|
| 157 |
[_alt_cxx="$withval"], [_alt_cxx='none']) |
|---|
| 158 |
|
|---|
| 159 |
dnl # Force the use of GCC as the compiler. |
|---|
| 160 |
dnl # NOTE: This is not fully implemented yet for any platform, but it is |
|---|
| 161 |
dnl # partially usable on Windows. |
|---|
| 162 |
AC_ARG_WITH([gcc], |
|---|
| 163 |
[ --with-gcc Force the use of GCC as the compiler], |
|---|
| 164 |
[_use_gcc="$withval"]) |
|---|
| 165 |
|
|---|
| 166 |
dnl # Define the binary format. Possible values are the following: |
|---|
| 167 |
dnl # N32_M3 - On IRIX, use N32 mips3 binaries |
|---|
| 168 |
dnl # N32_M4 - On IRIX, use N32 mips4 binaries |
|---|
| 169 |
dnl # 64_M3 - On IRIX, use 64-bit mips3 binaries |
|---|
| 170 |
dnl # 64_M4 - On IRIX, use 64-bit mips4 binaries |
|---|
| 171 |
dnl # HP - On HP-UX, use HP PA-RISC binaries |
|---|
| 172 |
dnl # HP64 - On HP-UX, use 64-bit HP PA-RISC binaries |
|---|
| 173 |
dnl # ALPHA - On an Alpha running Digital UNIX, use COFF binaries |
|---|
| 174 |
dnl # ELF_i386 - On an i386 OS (e.g., Linux/i386), use ELF binaries |
|---|
| 175 |
dnl # WIN32_i386 - On an i386 Win32 OS, Linux), use Win32 binaries |
|---|
| 176 |
AC_ARG_WITH([abi], |
|---|
| 177 |
[ --with-abi=<N32_M3|N32_M4|64_M3|64_M4|HP|HP64|ALPHA|ELF_i386|WIN32_i386> |
|---|
| 178 |
Define the Application Binary Interface to use], |
|---|
| 179 |
[_abi_type="$withval"]) |
|---|
| 180 |
|
|---|
| 181 |
dnl # Define which threading model to use. Possible values are "IRIX_SPROC" |
|---|
| 182 |
dnl # or "POSIX". |
|---|
| 183 |
dnl # The default is "IRIX_SPROC". |
|---|
| 184 |
AC_ARG_WITH([threads], |
|---|
| 185 |
[ --with-threads=<IRIX_SPROC|POSIX|WIN32> |
|---|
| 186 |
Define threading implementation [default=IRIX_SPROC]], |
|---|
| 187 |
[_thread_pkg="$withval"], [_thread_pkg='IRIX_SPROC']) |
|---|
| 188 |
|
|---|
| 189 |
dnl # Define the root directory for the Java installation. |
|---|
| 190 |
dnl # The default is /usr/java or what the user has defined in his or her |
|---|
| 191 |
dnl # $JDK_HOME environment variable. ${_JDK_HOME_ALT_LIST} must be a |
|---|
| 192 |
dnl # colon-separated list of bin directories that could contain javac(1) |
|---|
| 193 |
dnl # and the other JDK utilities. |
|---|
| 194 |
if test "x$JAVA_HOME" = "x" ; then |
|---|
| 195 |
_JDK_HOME_ALT_LIST="/usr/local/java/bin" |
|---|
| 196 |
else |
|---|
| 197 |
_JDK_HOME_ALT_LIST="${JAVA_HOME}/bin:/usr/local/java/bin" |
|---|
| 198 |
fi |
|---|
| 199 |
|
|---|
| 200 |
AC_ARG_WITH([jdkhome], |
|---|
| 201 |
[ --with-jdkhome=<PATH> JDK installation directory [default=\$JDK_HOME |
|---|
| 202 |
then /usr/java]], |
|---|
| 203 |
[JDK_HOME="$withval"], [JDK_HOME="${JDK_HOME-/usr/java}"]) |
|---|
| 204 |
|
|---|
| 205 |
dnl # Define the root directory for the Performer installation. |
|---|
| 206 |
dnl # The default is /usr. |
|---|
| 207 |
AC_ARG_WITH([pfroot], |
|---|
| 208 |
[ --with-pfroot=<PATH> Performer installation |
|---|
| 209 |
directory [default=/usr]], |
|---|
| 210 |
[PFROOT="$withval"], [PFROOT='/usr']) |
|---|
| 211 |
|
|---|
| 212 |
dnl # Define the version of Perfromer to use. |
|---|
| 213 |
dnl # The default is 2.4. |
|---|
| 214 |
AC_ARG_WITH([pfver], |
|---|
| 215 |
[ --with-pfver=<VER> Performer version to use [default=2.4]], |
|---|
| 216 |
[PF_VER="$withval"], [PF_VER='2.4']) |
|---|
| 217 |
|
|---|
| 218 |
dnl # If no value has been set for $DEFAULT_OGLROOT, use /usr. |
|---|
| 219 |
: ${DEFAULT_OGLROOT=/usr} |
|---|
| 220 |
|
|---|
| 221 |
dnl # Define the root directory for the OpenGL installation. |
|---|
| 222 |
dnl # The default is /usr. |
|---|
| 223 |
AC_ARG_WITH([oglroot], |
|---|
| 224 |
[ --with-oglroot=<PATH> OpenGL installation directory [default=/usr]], |
|---|
| 225 |
[OGLROOT="$withval"], [OGLROOT="$DEFAULT_OGLROOT"]) |
|---|
| 226 |
|
|---|
| 227 |
dnl # Use the Mesa OpenGL implementation. That is, link with libMesaGL and |
|---|
| 228 |
dnl # libMesaGLU. |
|---|
| 229 |
dnl # The default is no. |
|---|
| 230 |
AC_ARG_WITH([mesa], |
|---|
| 231 |
[ --with-mesa Use Mesa OpenGL implementation [default=no]], |
|---|
| 232 |
[_with_mesa="$withval"], [_with_mesa='no']) |
|---|
| 233 |
|
|---|
| 234 |
dnl # Use AudioWorks (which can be found at the given path) in the sound |
|---|
| 235 |
dnl # wrapper. |
|---|
| 236 |
dnl # The default is to use it with the path being /usr. |
|---|
| 237 |
AC_ARG_WITH([audioworks], |
|---|
| 238 |
[ --with-audioworks=<PATH> |
|---|
| 239 |
AudioWorks installation [default=/usr]], |
|---|
| 240 |
[_with_aw="$withval"], [_with_aw='/usr']) |
|---|
| 241 |
|
|---|
| 242 |
dnl # Use SL (which can be found at the given path) in the sound wrapper. |
|---|
| 243 |
dnl # The default is to use it with the path being /usr. |
|---|
| 244 |
AC_ARG_WITH([sl], |
|---|
| 245 |
[ --with-sl=<PATH> SL installation [default=/usr]], |
|---|
| 246 |
[_with_sl="$withval"], [_with_sl='/usr']) |
|---|
| 247 |
|
|---|
| 248 |
dnl # Specify a directory containing a working Perl 5.004 (or newer) binary. |
|---|
| 249 |
dnl # There is no default since standard locations are always available. |
|---|
| 250 |
AC_ARG_WITH([perl], |
|---|
| 251 |
[ --with-perl=<PATH> Directory containing Perl 5.004 |
|---|
| 252 |
or newer binary [No default]], |
|---|
| 253 |
[_user_perl_path="$withval"]) |
|---|
| 254 |
|
|---|
| 255 |
dnl # Name the user who will own installed files. |
|---|
| 256 |
AC_ARG_WITH([install-owner], |
|---|
| 257 |
[ --with-install-owner=<USER NAME> |
|---|
| 258 |
Installed file owner name], |
|---|
| 259 |
[_install_owner="$withval"]) |
|---|
| 260 |
|
|---|
| 261 |
dnl # Name the group used for setting ownership on installed files. |
|---|
| 262 |
AC_ARG_WITH([install-group], |
|---|
| 263 |
[ --with-install-group=<GROUP NAME> |
|---|
| 264 |
Installed file group name [default=vrjuggler]], |
|---|
| 265 |
[_install_group="$withval"], [_install_group='vrjuggler']) |
|---|
| 266 |
|
|---|
| 267 |
dnl # Provide permissions for installed (normal) files. |
|---|
| 268 |
AC_ARG_WITH([file-perms], |
|---|
| 269 |
[ --with-file-perms=<FILE PERMISSIONS> |
|---|
| 270 |
Installed file permissions [default=0644]], |
|---|
| 271 |
[FILE_PERMS="$withval"], [FILE_PERMS='0644']) |
|---|
| 272 |
|
|---|
| 273 |
dnl # Provide permissions for installed executable files. |
|---|
| 274 |
AC_ARG_WITH([exec-perms], |
|---|
| 275 |
[ --with-exec-perms=<EXEC PERMISSIONS> |
|---|
| 276 |
Installed executable permisions [default=0755]], |
|---|
| 277 |
[EXEC_PERMS="$withval"], [EXEC_PERMS='0755']) |
|---|
| 278 |
|
|---|
| 279 |
dnl # Provide permissions for directories in the installation tree. |
|---|
| 280 |
AC_ARG_WITH([dir-perms], |
|---|
| 281 |
[ --with-dir-perms=<DIRECTORY PERMISSIONS> |
|---|
| 282 |
Installed directory permisions [default=0755]], |
|---|
| 283 |
[DIR_PERMS="$withval"], [DIR_PERMS='0755']) |
|---|
| 284 |
|
|---|
| 285 |
dnl # ------------------------------------------------------ # |
|---|
| 286 |
dnl # --enable-feature[=arg] and --disable-feature arguments # |
|---|
| 287 |
dnl # ------------------------------------------------------ # |
|---|
| 288 |
|
|---|
| 289 |
dnl # Enable compilation of the OpenGL API. Possible values are "yes" or |
|---|
| 290 |
dnl # "no". "yes" is set with --enable-gl-api and "no" is set with |
|---|
| 291 |
dnl # --disable-gl-api. |
|---|
| 292 |
dnl # The default is "yes". |
|---|
| 293 |
AC_ARG_ENABLE([gl-api], |
|---|
| 294 |
[ --enable-gl-api use OpenGL API [default=yes]], |
|---|
| 295 |
[_enable_gl_api="$enableval"], [_enable_gl_api='yes']) |
|---|
| 296 |
|
|---|
| 297 |
dnl # Enable compilation of the Performer API. Possible values are "yes" or |
|---|
| 298 |
dnl # "no". "yes" is set with --enable-pf-api and "no" is set with |
|---|
| 299 |
dnl # --disable-pf-api. |
|---|
| 300 |
dnl # The default is "yes". |
|---|
| 301 |
AC_ARG_ENABLE([pf-api], |
|---|
| 302 |
[ --enable-pf-api use Perfromer API [default=yes]], |
|---|
| 303 |
[_enable_pf_api="$enableval"], [_enable_pf_api='yes']) |
|---|
| 304 |
|
|---|
| 305 |
dnl # Enable performance testing. Values that enable it are as follows: |
|---|
| 306 |
dnl # |
|---|
| 307 |
dnl # SGI: Enable SGI IPC performance testing. This defines |
|---|
| 308 |
dnl # VJ_PERFORMANCE to be VJ_PERF_SGI |
|---|
| 309 |
dnl # POSIX: Enable POSIX threads performance testing. This defines |
|---|
| 310 |
dnl # VJ_PERFORMANCE to be VJ_PERF_POSIX |
|---|
| 311 |
dnl # |
|---|
| 312 |
dnl # Values that disable it are "no" or "NONE". The default is "SGI". |
|---|
| 313 |
AC_ARG_ENABLE([performance], |
|---|
| 314 |
[ --enable-performance=<SGI|POSIX|NONE> |
|---|
| 315 |
enable performance testing [default=SGI] ], |
|---|
| 316 |
[ if test "x$enableval" = "xyes" ; then |
|---|
| 317 |
_enable_perf='SGI' |
|---|
| 318 |
elif test "x$enableval" = "xno" ; then |
|---|
| 319 |
_enable_perf='NONE' |
|---|
| 320 |
else |
|---|
| 321 |
_enable_perf="$enableval" |
|---|
| 322 |
fi |
|---|
| 323 |
], [_enable_perf='SGI']) |
|---|
| 324 |
|
|---|
| 325 |
dnl # Define a macro VJ_ABI_CFG for setting up the configuration parameters |
|---|
| 326 |
dnl # for a given ABI. The usage is: |
|---|
| 327 |
dnl # |
|---|
| 328 |
dnl # VJ_ABI_CFG([ ABI [, ISA [, library suffix [, extra compiler flags]]]]) |
|---|
| 329 |
dnl # |
|---|
| 330 |
dnl # All arguments are optional and will default to the empty string if not |
|---|
| 331 |
dnl # provided. |
|---|
| 332 |
AC_DEFUN(VJ_ABI_CFG, [ ABI=$1 ISA=$2 LIBBITSUF=$3 _EXTRA_FLAGS=$4 ; ]) |
|---|
| 333 |
|
|---|
| 334 |
dnl # Set default values for these before checking ${_abi_type}. Currently, |
|---|
| 335 |
dnl # these are for non-IRIX platforms. |
|---|
| 336 |
ABI='' |
|---|
| 337 |
LIBBITSUF='' |
|---|
| 338 |
|
|---|
| 339 |
dnl # Based on the value of $abi_type, set $ABI for later use and the Makefile |
|---|
| 340 |
dnl # substitution variables $LIBBITSUF and $ISA. |
|---|
| 341 |
case "x${_abi_type}" in |
|---|
| 342 |
x64_M3) |
|---|
| 343 |
VJ_ABI_CFG('64', 'mips3', '64', '-64 -mips3') |
|---|
| 344 |
;; |
|---|
| 345 |
x64_M4) |
|---|
| 346 |
VJ_ABI_CFG('64', 'mips4', '64', '-64 -mips4') |
|---|
| 347 |
;; |
|---|
| 348 |
xN32_M3) |
|---|
| 349 |
VJ_ABI_CFG('N32', 'mips3', '32', '-n32 -mips3') |
|---|
| 350 |
;; |
|---|
| 351 |
xN32_M4) |
|---|
| 352 |
VJ_ABI_CFG('N32', 'mips4', '32', '-n32 -mips4') |
|---|
| 353 |
;; |
|---|
| 354 |
xHP) |
|---|
| 355 |
VJ_ABI_CFG('HP', 'PA-RISC') |
|---|
| 356 |
;; |
|---|
| 357 |
xHP64) |
|---|
| 358 |
VJ_ABI_CFG('HP64', 'PA-RISC', '/pa20_64', '+DD64') |
|---|
| 359 |
;; |
|---|
| 360 |
xALPHA) |
|---|
| 361 |
VJ_ABI_CFG('ALPHA') |
|---|
| 362 |
;; |
|---|
| 363 |
xELF_i386) |
|---|
| 364 |
VJ_ABI_CFG('ELF', 'i386') |
|---|
| 365 |
;; |
|---|
| 366 |
xWIN32_i386) |
|---|
| 367 |
VJ_ABI_CFG('WIN32') |
|---|
| 368 |
;; |
|---|
| 369 |
esac |
|---|
| 370 |
|
|---|
| 371 |
dnl # ------------------------------------------------------------------------- |
|---|
| 372 |
dnl # System-dependent stuff. |
|---|
| 373 |
dnl # ------------------------------------------------------------------------- |
|---|
| 374 |
|
|---|
| 375 |
VJ_WIN32_SETUP |
|---|
| 376 |
|
|---|
| 377 |
dnl # We use AC_CANONICAL SYSTEM so that we can find out information about |
|---|
| 378 |
dnl # the build, target and host platforms rather than only the host. |
|---|
| 379 |
AC_CANONICAL_SYSTEM |
|---|
| 380 |
|
|---|
| 381 |
dnl # Operating system release information. This may contain anything and |
|---|
| 382 |
dnl # should be treated as a string. |
|---|
| 383 |
_OS_REL_STR=`uname -r` |
|---|
| 384 |
|
|---|
| 385 |
dnl # Operating system version number only (any miscellaneous text is |
|---|
| 386 |
dnl # stripped). This will only contain a number and can be treated as a |
|---|
| 387 |
dnl # float-point value. |
|---|
| 388 |
dnl # NOTE: It is currently not used in config.h. |
|---|
| 389 |
_OS_REL_NUM=`uname -r | sed -e 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\)[^0-9]*$/\1/'` |
|---|
| 390 |
|
|---|
| 391 |
dnl # Major and minor version numbers from ${_OS_REL_NUM} separated for use |
|---|
| 392 |
dnl # with the C preprocessor. Using cut(1) is kind of a hack, but at least |
|---|
| 393 |
dnl # it's a clean one. |
|---|
| 394 |
_OS_REL_NUM_MAJOR=`echo "${_OS_REL_NUM}" | cut -f1 -d'.'` |
|---|
| 395 |
_OS_REL_NUM_MINOR=`echo "${_OS_REL_NUM}" | cut -f1 -d' ' | cut -f2 -d'.'` |
|---|
| 396 |
|
|---|
| 397 |
dnl # These are used on all platforms. |
|---|
| 398 |
AC_DEFINE_UNQUOTED(VJ_OS_RELEASE, "${_OS_REL_STR}") |
|---|
| 399 |
AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MAJOR, ${_OS_REL_NUM_MAJOR}) |
|---|
| 400 |
AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MINOR, ${_OS_REL_NUM_MINOR}) |
|---|
| 401 |
|
|---|
| 402 |
AR='' dnl # Archive library command (generally ar(1)) |
|---|
| 403 |
ARFLAGS='' dnl # Flags for $AR |
|---|
| 404 |
AR_NAME_FLAG='' dnl # Extra flag used to allow $AR to name its output |
|---|
| 405 |
DEP_GEN_FLAG='-M' dnl # Flag for the compiler to generate dependencies |
|---|
| 406 |
LD='' dnl # Shared library command (usually ld(1)) |
|---|
| 407 |
LDOPTS='' dnl # More options for shared library generator |
|---|
| 408 |
LDOPTS_DBG='' dnl # Debugging options for shared library generator |
|---|
| 409 |
LDOPTS_OPT='' dnl # Optimization options for shared library generator |
|---|
| 410 |
OBJ_FILE_SUFFIX='o' dnl # Suffix for object file names |
|---|
| 411 |
OBJ_NAME_FLAG='-o $@' dnl # Flag used for naming a compiled object file |
|---|
| 412 |
|
|---|
| 413 |
LIB_PREFIX='lib' dnl # Prefix for library name |
|---|
| 414 |
STATICLIB_EXT='a' dnl # Extension for shared library names (usually 'a') |
|---|
| 415 |
SHAREDLIB_EXT='' dnl # Extension for shared library names (usually 'so') |
|---|
| 416 |
|
|---|
| 417 |
DBG_FLAGS='' dnl # Compiler debugging flags for object files |
|---|
| 418 |
OPT_FLAGS='' dnl # Compiler optimization flags for object files |
|---|
| 419 |
|
|---|
| 420 |
DSOREGFILE='' |
|---|
| 421 |
DSOVERSION='' |
|---|
| 422 |
DSOVERSIONOPTS='' |
|---|
| 423 |
ABI_LIST='' dnl # List of supported ABIs on a given platform |
|---|
| 424 |
OS_TYPE='UNIX' dnl # General type of operating system (UNIX, Win32) |
|---|
| 425 |
PLATFORM='' dnl # Platform name |
|---|
| 426 |
|
|---|
| 427 |
dnl # Depending on the target operating system, set various command options and |
|---|
| 428 |
dnl # such. |
|---|
| 429 |
case $target_os in |
|---|
| 430 |
dnl # SGI running IRIX 6.*. |
|---|
| 431 |
irix6*) |
|---|
| 432 |
dnl # If no ABI has been set yet, default to N32_M3. |
|---|
| 433 |
if test "$ABI" = "" ; then |
|---|
| 434 |
VJ_ABI_CFG('N32', 'mips3', '32', '-n32 -mips3') |
|---|
| 435 |
fi |
|---|
| 436 |
|
|---|
| 437 |
dnl # Set compiler flags and the location of $DSOREGFILE depending on |
|---|
| 438 |
dnl # $ABI. |
|---|
| 439 |
if test "$ABI" = "64" ; then |
|---|
| 440 |
DSOREGFILE='/usr/lib64/so_locations' |
|---|
| 441 |
OPT_FLAGS='-O2 -OPT:Olimit=0' |
|---|
| 442 |
elif test "$ABI" = "N32" ; then |
|---|
| 443 |
DSOREGFILE='/usr/lib32/so_locations' |
|---|
| 444 |
OPT_FLAGS='-O2 -OPT:Olimit=0' |
|---|
| 445 |
fi |
|---|
| 446 |
|
|---|
| 447 |
AR='${CXX}' |
|---|
| 448 |
ARFLAGS='-LANG:std -J6 -ar -WR,-v -o' |
|---|
| 449 |
CFLAGS="$CFLAGS -ansi" |
|---|
| 450 |
CFLAGS_DYNLIB="$CFLAGS_DYNLIB -KPIC" |
|---|
| 451 |
CXXFLAGS="$CXXFLAGS -ansi -LANG:std" |
|---|
| 452 |
CXXFLAGS_DYNLIB="$CXXFLAGS_DYNLIB -KPIC" |
|---|
| 453 |
DBG_FLAGS="-g -gslim" |
|---|
| 454 |
LD='${CXX} -shared' |
|---|
| 455 |
# _LD_REGOPTS='-check_registry ${DSOREGFILE}' |
|---|
| 456 |
LDOPTS="$LDOPTS -ansi -LANG:std -all ${_LD_REGOPTS} -elf -rdata_shared" |
|---|
| 457 |
SHAREDLIB_EXT='so' |
|---|
| 458 |
|
|---|
| 459 |
DSOVERSION='sgi4.0' |
|---|
| 460 |
DSOVERSIONOPTS='-set_version ${DSOVERSION}' |
|---|
| 461 |
|
|---|
| 462 |
ABI_LIST='64_M4 64_M3 N32_M4 N32_M3' |
|---|
| 463 |
PLATFORM='IRIX' |
|---|
| 464 |
|
|---|
| 465 |
AC_DEFINE(VJ_OS_IRIX,) |
|---|
| 466 |
AC_DEFINE(_BSD_TYPES,) |
|---|
| 467 |
|
|---|
| 468 |
if test ${_OS_REL_NUM_MAJOR} -lt 6 ; then |
|---|
| 469 |
AC_DEFINE(IRIXREL, "IRIX5") |
|---|
| 470 |
else |
|---|
| 471 |
AC_DEFINE(IRIXREL, "IRIX6") |
|---|
| 472 |
fi |
|---|
| 473 |
;; |
|---|
| 474 |
dnl # HP PA-RISC machine running HP-UX 10.x. These are not supported |
|---|
| 475 |
dnl # because they lack a complete POSIX.4 real-time implementation. |
|---|
| 476 |
hpux10*) |
|---|
| 477 |
AC_MSG_ERROR([HP-UX 10.x is not supported. Please upgrade to 11.00!]) |
|---|
| 478 |
;; |
|---|
| 479 |
dnl # HP PA-RISC machine running HP-UX 11.x. |
|---|
| 480 |
hpux11*) |
|---|
| 481 |
dnl # If no ABI has been set yet, default to HP PA-RISC. |
|---|
| 482 |
if test "$ABI" = "" ; then |
|---|
| 483 |
VJ_ABI_CFG('HP', 'PA-RISC') |
|---|
| 484 |
fi |
|---|
| 485 |
|
|---|
| 486 |
AR='ar' |
|---|
| 487 |
ARFLAGS='ru' |
|---|
| 488 |
CFLAGS_DYNLIB="$CFLAGS_DYNLIB +Z" |
|---|
| 489 |
CXXFLAGS="-AA -mt $CXXFLAGS" |
|---|
| 490 |
CXXFLAGS_DYNLIB="$CXXFLAGS_DYNLIB +Z" |
|---|
| 491 |
DEP_GEN_FLAG='-E +m' |
|---|
| 492 |
LD='aCC' |
|---|
| 493 |
LDFLAGS="$LDFLAGS -mt -L/usr/lib/X11R6" |
|---|
| 494 |
LDOPTS='-b' |
|---|
| 495 |
DBG_FLAGS='-g' |
|---|
| 496 |
OPT_FLAGS='' |
|---|
| 497 |
SHAREDLIB_EXT='sl' |
|---|
| 498 |
|
|---|
| 499 |
dnl # We have to use POSIX threads on HP-UX. |
|---|
| 500 |
if test "x${_thread_pkg}" != "xPOSIX" ; then |
|---|
| 501 |
AC_MSG_WARN([*** Forcing the use of POSIX threads ***]) |
|---|
| 502 |
_thread_pkg='POSIX' |
|---|
| 503 |
fi |
|---|
| 504 |
|
|---|
| 505 |
dnl # If nothing was given as an alternate OpenGL installation path, |
|---|
| 506 |
dnl # use /opt/graphics/OpenGL. |
|---|
| 507 |
if test "x$OGLROOT" = "x$DEFAULT_OGLROOT" ; then |
|---|
| 508 |
OGLROOT='/opt/graphics/OpenGL' |
|---|
| 509 |
fi |
|---|
| 510 |
|
|---|
| 511 |
AC_DEFINE(VJ_OS_HPUX,) |
|---|
| 512 |
ABI_LIST='HP' |
|---|
| 513 |
PLATFORM='HP' |
|---|
| 514 |
;; |
|---|
| 515 |
dnl # DEC Alpha running Digital UNIX 4.0. |
|---|
| 516 |
osf4.0) |
|---|
| 517 |
dnl # If no ABI has been set yet, default to ALPHA (whatever that |
|---|
| 518 |
dnl # means). |
|---|
| 519 |
if test "$ABI" = "" ; then |
|---|
| 520 |
VJ_ABI_CFG('ALPHA') |
|---|
| 521 |
fi |
|---|
| 522 |
|
|---|
| 523 |
AR='ar' |
|---|
| 524 |
ARFLAGS='-ruv' |
|---|
| 525 |
LD='${CXX} -shared' |
|---|
| 526 |
LDOPTS='' |
|---|
| 527 |
OPT_FLAGS='-O2' |
|---|
| 528 |
SHAREDLIB_EXT='so' |
|---|
| 529 |
|
|---|
| 530 |
AC_DEFINE(VJ_OS_DUX,) |
|---|
| 531 |
ABI_LIST='ALPHA' |
|---|
| 532 |
PLATFORM='alpha-osf' |
|---|
| 533 |
;; |
|---|
| 534 |
dnl # A machine running FreeBSD. Currently only i386 is known to compile. |
|---|
| 535 |
freebsd*) |
|---|
| 536 |
dnl # If no ABI has been set yet, default to ELF with whatever the |
|---|
| 537 |
dnl # target CPU architecture is. |
|---|
| 538 |
if test "$ABI" = "" ; then |
|---|
| 539 |
VJ_ABI_CFG('ELF', "$target_cpu") |
|---|
| 540 |
fi |
|---|
| 541 |
|
|---|
| 542 |
AR='ar' |
|---|
| 543 |
ARFLAGS='-ruv' |
|---|
| 544 |
CXXFLAGS="-Wall -Werror-implicit-function-declaration $CXXFLAGS" |
|---|
| 545 |
LD='${CXX} -shared' |
|---|
| 546 |
LDOPTS='' |
|---|
| 547 |
DBG_FLAGS='-g' |
|---|
| 548 |
OPT_FLAGS='-O2' |
|---|
| 549 |
SHAREDLIB_EXT='so' |
|---|
| 550 |
|
|---|
| 551 |
dnl # We have to use POSIX threads on FreeBSD. |
|---|
| 552 |
if test "x${_thread_pkg}" != "xPOSIX" ; then |
|---|
| 553 |
AC_MSG_WARN([*** Forcing the use of POSIX threads ***]) |
|---|
| 554 |
_thread_pkg='POSIX' |
|---|
| 555 |
fi |
|---|
| 556 |
|
|---|
| 557 |
AC_DEFINE(VJ_OS_FreeBSD,) |
|---|
| 558 |
ABI_LIST='ELF' |
|---|
| 559 |
PLATFORM='FreeBSD' |
|---|
| 560 |
;; |
|---|
| 561 |
dnl # A machine running Linux. Currently only i386 and PowerPC are known |
|---|
| 562 |
dnl # to work. |
|---|
| 563 |
linux*) |
|---|
| 564 |
dnl # If no ABI has been set yet, default to ELF with whatever the |
|---|
| 565 |
dnl # target CPU architecture is. |
|---|
| 566 |
if test "$ABI" = "" ; then |
|---|
| 567 |
VJ_ABI_CFG('ELF', "$target_cpu") |
|---|
| 568 |
fi |
|---|
| 569 |
|
|---|
| 570 |
AR='ar' |
|---|
| 571 |
ARFLAGS='-ruv' |
|---|
| 572 |
CXXFLAGS="-Wall -Werror-implicit-function-declaration $CXXFLAGS" |
|---|
| 573 |
LD='${CXX} -shared' |
|---|
| 574 |
LDOPTS='' |
|---|
| 575 |
OPT_FLAGS='-O1' |
|---|
| 576 |
DBG_FLAGS='-g' |
|---|
| 577 |
SHAREDLIB_EXT='so' |
|---|
| 578 |
|
|---|
| 579 |
dnl # We have to use POSIX threads on Linux. |
|---|
| 580 |
if test "x${_thread_pkg}" != "xPOSIX" ; then |
|---|
| 581 |
AC_MSG_WARN([*** Forcing the use of POSIX threads ***]) |
|---|
| 582 |
_thread_pkg='POSIX' |
|---|
| 583 |
fi |
|---|
| 584 |
|
|---|
| 585 |
AC_DEFINE(VJ_OS_Linux,) |
|---|
| 586 |
ABI_LIST='ELF' |
|---|
| 587 |
PLATFORM='Linux' |
|---|
| 588 |
;; |
|---|
| 589 |
dnl # A machine running Solaris (aka SunOS). Currently only i386 is |
|---|
| 590 |
dnl # known to work. |
|---|
| 591 |
solaris*) |
|---|
| 592 |
dnl # If no ABI has been set yet, default to ELF with whatever the |
|---|
| 593 |
dnl # target CPU architecture is. |
|---|
| 594 |
if test "$ABI" = "" ; then |
|---|
| 595 |
VJ_ABI_CFG('ELF', "$target_cpu") |
|---|
| 596 |
fi |
|---|
| 597 |
|
|---|
| 598 |
AR='ar' |
|---|
| 599 |
ARFLAGS='-ruv' |
|---|
| 600 |
CXXFLAGS="-Wall -Werror-implicit-function-declaration $CXXFLAGS" |
|---|
| 601 |
LD='${CXX} -G' |
|---|
| 602 |
LDOPTS='' |
|---|
| 603 |
DBG_FLAGS='-g' |
|---|
| 604 |
OPT_FLAGS='-O2' |
|---|
| 605 |
SHAREDLIB_EXT='so' |
|---|
| 606 |
|
|---|
| 607 |
dnl # We have to use POSIX threads on Solaris. |
|---|
| 608 |
if test "x${_thread_pkg}" != "xPOSIX" ; then |
|---|
| 609 |
AC_MSG_WARN([*** Forcing the use of POSIX threads ***]) |
|---|
| 610 |
_thread_pkg='POSIX' |
|---|
| 611 |
fi |
|---|
| 612 |
|
|---|
| 613 |
AC_DEFINE(VJ_OS_Solaris,) |
|---|
| 614 |
ABI_LIST='ELF' |
|---|
| 615 |
PLATFORM='Solaris' |
|---|
| 616 |
;; |
|---|
| 617 |
dnl # IBM RS/6000 running AIX. |
|---|
| 618 |
aix*) |
|---|
| 619 |
dnl # We have to use POSIX threads on AIX. |
|---|
| 620 |
if test "x${_thread_pkg}" != "xPOSIX" ; then |
|---|
| 621 |
AC_MSG_WARN([*** Forcing the use of POSIX threads ***]) |
|---|
| 622 |
_thread_pkg='POSIX' |
|---|
| 623 |
fi |
|---|
| 624 |
|
|---|
| 625 |
AC_DEFINE(VJ_OS_AIX,) |
|---|
| 626 |
PLATFORM='AIX' |
|---|
| 627 |
;; |
|---|
| 628 |
dnl # i386-class machine running Windows {98,NT} with Cygnus GNU-Win32. |
|---|
| 629 |
cygwin) |
|---|
| 630 |
dnl # If no ABI has been set yet, default to WIN32 with whatever the |
|---|
| 631 |
dnl # target CPU architecture is. |
|---|
| 632 |
if test "$ABI" = "" ; then |
|---|
| 633 |
VJ_ABI_CFG('WIN32') |
|---|
| 634 |
fi |
|---|
| 635 |
|
|---|
| 636 |
dnl # There is no performance testing/monitoring code for Win32 (yet). |
|---|
| 637 |
if test "x${_enable_perf}" != "xNONE" ; then |
|---|
| 638 |
AC_MSG_WARN([*** Disabling performance testing on $host ***]) |
|---|
| 639 |
_enable_perf='NONE' |
|---|
| 640 |
fi |
|---|
| 641 |
|
|---|
| 642 |
dnl # We have to use Win32 threads on Win32. |
|---|
| 643 |
if test "x${_thread_pkg}" != "xWIN32" ; then |
|---|
| 644 |
AC_MSG_WARN([*** WIN32 threads must be used on $host ***]) |
|---|
| 645 |
_thread_pkg='WIN32' |
|---|
| 646 |
fi |
|---|
| 647 |
|
|---|
| 648 |
if test "x${_use_gcc}" = "xyes" ; then |
|---|
| 649 |
AR='ar' |
|---|
| 650 |
ARFLAGS='-ruv' |
|---|
| 651 |
CFLAGS="-mno-cygwin" |
|---|
| 652 |
CXXFLAGS="-mno-cygwin" |
|---|
| 653 |
DBG_FLAGS='-g' |
|---|
| 654 |
|
|---|
| 655 |
LD='${CXX} -shared' |
|---|
| 656 |
else |
|---|
| 657 |
AR='link -lib' |
|---|
| 658 |
ARFLAGS="$ARFLAGS -nologo" |
|---|
| 659 |
AR_NAME_FLAG='-out:' |
|---|
| 660 |
CFLAGS="-nologo" |
|---|
| 661 |
CXXFLAGS="-nologo" |
|---|
| 662 |
DBG_FLAGS='-Od -GZ -MTd -Z7' |
|---|
| 663 |
DEP_GEN_FLAG='-FD' |
|---|
| 664 |
OPT_FLAGS='-GB -MT' |
|---|
| 665 |
LD='link -dll' |
|---|
| 666 |
LDOPTS="$LDOPTS -nologo -out:\"${OBJDIR}/Juggler.lib\"" |
|---|
| 667 |
LDOPTS_DBG='-DEBUG -PDB:NONE' |
|---|
| 668 |
LDOPTS_OPT='-RELEASE' |
|---|
| 669 |
OBJ_FILE_SUFFIX='obj' |
|---|
| 670 |
OBJ_NAME_FLAG='-Fo$@' |
|---|
| 671 |
fi |
|---|
| 672 |
|
|---|
| 673 |
LIB_PREFIX='' |
|---|
| 674 |
STATICLIB_EXT='lib' |
|---|
| 675 |
SHAREDLIB_EXT='dll' |
|---|
| 676 |
|
|---|
| 677 |
AC_DEFINE(VJ_OS_Win32,) |
|---|
| 678 |
ABI_LIST='WIN32' |
|---|
| 679 |
OS_TYPE='Win32' |
|---|
| 680 |
|
|---|
| 681 |
_sys_name=`uname -s` |
|---|
| 682 |
|
|---|
| 683 |
dnl # Determine the value for $PLATFORM based on what uname(1) tells |
|---|
| 684 |
dnl # us. We define our own values because Cygnus' uname(1) returns |
|---|
| 685 |
dnl # somewhat annoying names. |
|---|
| 686 |
case ${_sys_name} in |
|---|
| 687 |
dnl # Windows NT 4.0. |
|---|
| 688 |
*NT-[[45]].*) |
|---|
| 689 |
PLATFORM='WinNT' |
|---|
| 690 |
;; |
|---|
| 691 |
dnl # Windows 95 and 98. |
|---|
| 692 |
*WIN_9*-4.*) |
|---|
| 693 |
PLATFORM='Win9x' |
|---|
| 694 |
;; |
|---|
| 695 |
dnl # Unknown version of Windows that may not yet be supported. |
|---|
| 696 |
*) |
|---|
| 697 |
AC_MSG_ERROR([Unknown Windows type ${_sys_name}!]) |
|---|
| 698 |
;; |
|---|
| 699 |
esac |
|---|
| 700 |
|
|---|
| 701 |
AC_DEFINE(WIN32,) |
|---|
| 702 |
AC_DEFINE(_MBCS,) |
|---|
| 703 |
;; |
|---|
| 704 |
dnl # Unkown operating system (to config.guess). |
|---|
| 705 |
unknown) |
|---|
| 706 |
dnl # If no ABI has been set yet, default to the target OS (which |
|---|
| 707 |
dnl # will be 'unknown') with whatever the target CPU architecture is. |
|---|
| 708 |
if test "$ABI" = "" ; then |
|---|
| 709 |
VJ_ABI_CFG("$target_os", "$target_cpu") |
|---|
| 710 |
fi |
|---|
| 711 |
|
|---|
| 712 |
AC_DEFINE(VJ_OS_GENERIC,) |
|---|
| 713 |
PLATFORM='UNKNOWN' |
|---|
| 714 |
;; |
|---|
| 715 |
esac |
|---|
| 716 |
|
|---|
| 717 |
dnl # -------------------------------------------------------------------- |
|---|
| 718 |
dnl # Depending on host type and the value in ${_enable_perf}, define the |
|---|
| 719 |
dnl # settings for the performance code. |
|---|
| 720 |
dnl # -------------------------------------------------------------------- |
|---|
| 721 |
if test "$PLATFORM" != "IRIX" -a "${_enable_perf}" != "NONE" ; then |
|---|
| 722 |
_enable_perf='POSIX' |
|---|
| 723 |
fi |
|---|
| 724 |
|
|---|
| 725 |
dnl # Define unique values for each type of performance testing option. |
|---|
| 726 |
dnl # Only one of these may be used for the value to which VJ_PERFORMANCE |
|---|
| 727 |
dnl # is set. |
|---|
| 728 |
AC_DEFINE(VJ_PERF_NONE, 0) |
|---|
| 729 |
AC_DEFINE(VJ_PERF_SGI, 1) |
|---|
| 730 |
AC_DEFINE(VJ_PERF_POSIX, 2) |
|---|
| 731 |
|
|---|
| 732 |
dnl # Define VJ_PERFORMANCE based on ${_enable_perf}. Default to |
|---|
| 733 |
dnl # VJ_PERF_SGI if ${_enable_perf} has some unknown value. |
|---|
| 734 |
if test "x${_enable_perf}" = "xSGI" ; then |
|---|
| 735 |
AC_DEFINE(VJ_PERFORMANCE, VJ_PERF_SGI) |
|---|
| 736 |
elif test "x${_enable_perf}" = "xPOSIX" ; then |
|---|
| 737 |
AC_DEFINE(VJ_PERFORMANCE, VJ_PERF_POSIX) |
|---|
| 738 |
elif test "x${_enable_perf}" = "xNONE" ; then |
|---|
| 739 |
AC_DEFINE(VJ_PERFORMANCE, VJ_PERF_NONE) |
|---|
| 740 |
else |
|---|
| 741 |
AC_DEFINE(VJ_PERFORMANCE, VJ_PERF_SGI) |
|---|
| 742 |
fi |
|---|
| 743 |
|
|---|
| 744 |
dnl # ------------------------------------------------------------------------- |
|---|
| 745 |
dnl # Checks for programs. |
|---|
| 746 |
dnl # ------------------------------------------------------------------------- |
|---|
| 747 |
|
|---|
| 748 |
_vjsave_CFLAGS="$CFLAGS" |
|---|
| 749 |
_vjsave_CXXFLAGS="$CXXFLAGS" |
|---|
| 750 |
|
|---|
| 751 |
dnl # If no alternate C compiler was specified, check to see if it is |
|---|
| 752 |
dnl # necessary to force the use of a specific compiler on a given platform. |
|---|
| 753 |
if test "x${_alt_cc}" = "xnone" ; then |
|---|
| 754 |
dnl # On HP-UX, we have to use the aCC C++ compiler. |
|---|
| 755 |
if test "$PLATFORM" = "HP" ; then |
|---|
| 756 |
AC_CHECK_PROG([CC], [cc], [cc], |
|---|
| 757 |
[AC_MSG_ERROR([*** The library requires the HP-UX aCC C++ compiler ***])]) |
|---|
| 758 |
dnl # On IRIX, we have to use cc (not gcc). |
|---|
| 759 |
elif test "$PLATFORM" = "IRIX" ; then |
|---|
| 760 |
AC_CHECK_PROG([CC], [cc], [cc], |
|---|
| 761 |
[AC_MSG_ERROR([*** The library requires the IRIX cc C compiler ***])]) |
|---|
| 762 |
fi |
|---|
| 763 |
dnl # Otherwise, force the use of the alternate C compiler. |
|---|
| 764 |
else |
|---|
| 765 |
CC="${_alt_cc}" |
|---|
| 766 |
fi |
|---|
| 767 |
|
|---|
| 768 |
dnl # If no alternate C++ compiler was specified, check to see if it is |
|---|
| 769 |
dnl # necessary to force the use of a specific compiler on a given platform. |
|---|
| 770 |
if test "x${_alt_cxx}" = "xnone" ; then |
|---|
| 771 |
dnl # On HP-UX, we have to use the aCC C++ compiler. |
|---|
| 772 |
if test "$PLATFORM" = "HP" ; then |
|---|
| 773 |
AC_CHECK_PROG([CXX], [aCC], [aCC], |
|---|
| 774 |
[AC_MSG_ERROR([*** The library requires the HP-UX aCC C++ compiler ***])]) |
|---|
| 775 |
dnl # On Windows, we have to use the Microsoft Visual C++ compiler CL.EXE. |
|---|
| 776 |
elif test "$OS_TYPE" = "Win32" -a "x${_use_gcc}" != "xyes" ; then |
|---|
| 777 |
AC_CHECK_PROG([CXX], [cl], [cl], |
|---|
| 778 |
[AC_MSG_ERROR([*** The library requires the MS Visual C++ compiler ***])]) |
|---|
| 779 |
CC=$CXX |
|---|
| 780 |
dnl # On IRIX, we have to use CC (not g++). |
|---|
| 781 |
elif test "$PLATFORM" = "IRIX" ; then |
|---|
| 782 |
AC_CHECK_PROG([CXX], [CC], [CC], |
|---|
| 783 |
[AC_MSG_ERROR([*** The library requires the IRIX CC C++ compiler ***])]) |
|---|
| 784 |
fi |
|---|
| 785 |
dnl # Otherwise, force the use of the alternate C++ compiler. |
|---|
| 786 |
else |
|---|
| 787 |
CXX="${_alt_cxx}" |
|---|
| 788 |
fi |
|---|
| 789 |
|
|---|
| 790 |
CFLAGS="$CFLAGS ${_EXTRA_FLAGS}" |
|---|
| 791 |
CXXFLAGS="$CXXFLAGS ${_EXTRA_FLAGS}" |
|---|
| 792 |
|
|---|
| 793 |
AC_PROG_CC |
|---|
| 794 |
AC_PROG_CXX |
|---|
| 795 |
|
|---|
| 796 |
dnl # If we are using GCC as the C compiler, the option for making |
|---|
| 797 |
dnl # position-independent code is -fPIC. |
|---|
| 798 |
if test "x$GCC" = "xyes" ; then |
|---|
| 799 |
CFLAGS_DYNLIB="$CFLAGS_DYNLIB -fPIC" |
|---|
| 800 |
fi |
|---|
| 801 |
|
|---|
| 802 |
dnl # If we are using GCC as the C++ compiler, the option for making |
|---|
| 803 |
dnl # position-independent code is -fPIC. |
|---|
| 804 |
if test "x$GXX" = "xyes" ; then |
|---|
| 805 |
CXXFLAGS_DYNLIB="$CXXFLAGS_DYNLIB -fPIC" |
|---|
| 806 |
fi |
|---|
| 807 |
|
|---|
| 808 |
dnl # If we are using GCC as the compiler, we need to be using at least egcs |
|---|
| 809 |
dnl # 1.1.2. A newer version (e.g., 2.95.2) is even better. |
|---|
| 810 |
if test "x$GXX" = "xyes" ; then |
|---|
| 811 |
gcc_version=`$CXX -dumpversion 2>&1` |
|---|
| 812 |
|
|---|
| 813 |
AC_CACHE_CHECK([if $CXX is egcs 1.1.2 or newer], |
|---|
| 814 |
[ac_cv_CXX_is_egcs], |
|---|
| 815 |
[ case $gcc_version in |
|---|
| 816 |
egcs-2.9*) |
|---|
| 817 |
ac_cv_CXX_is_egcs='yes' |
|---|
| 818 |
;; |
|---|
| 819 |
2.9*) |
|---|
| 820 |
ac_cv_CXX_is_egcs='yes' |
|---|
| 821 |
;; |
|---|
| 822 |
3.*) |
|---|
| 823 |
ac_cv_CXX_is_egcs='yes' |
|---|
| 824 |
;; |
|---|
| 825 |
*) |
|---|
| 826 |
_val=`$CXX -v 2>&1 | grep -e '^gcc version' | cut -f4 -d' '` |
|---|
| 827 |
if test ${_val} -ge 19990314 ; then |
|---|
| 828 |
ac_cv_CXX_is_egcs='yes' |
|---|
| 829 |
else |
|---|
| 830 |
ac_cv_CXX_is_egcs='no' |
|---|
| 831 |
fi |
|---|
| 832 |
;; |
|---|
| 833 |
esac |
|---|
| 834 |
]) |
|---|
| 835 |
|
|---|
| 836 |
dnl # If the $CXX binary is not egcs 1.1.2 or newer, check for egcc and |
|---|
| 837 |
dnl # eg++. If it exists, we will assume that it is new enough. |
|---|
| 838 |
if test "x$ac_cv_CXX_is_egcs" = "xno" ; then |
|---|
| 839 |
AC_CHECK_PROG([CC], [egcc], [egcc], |
|---|
| 840 |
[AC_MSG_ERROR([*** The library requires the egcc C compiler ***])]) |
|---|
| 841 |
AC_CHECK_PROG([CXX], [eg++], [eg++], |
|---|
| 842 |
[AC_MSG_ERROR([*** The library requires the eg++ C++ compiler ***])]) |
|---|
| 843 |
fi |
|---|
| 844 |
fi |
|---|
| 845 |
|
|---|
| 846 |
dnl # At this point, we know what threading package we will be using and what |
|---|
| 847 |
dnl # C compiler we have available. Now check to see if the compiler accepts |
|---|
| 848 |
dnl # the -pthread option. |
|---|
| 849 |
if test "x${_thread_pkg}" = "xPOSIX" ; then |
|---|
| 850 |
AC_CACHE_CHECK([whether $CC accepts -pthread], |
|---|
| 851 |
[ac_cv_CC_accepts_pthread], |
|---|
| 852 |
[ echo 'void f(){}' > conftest.c |
|---|
| 853 |
if test -z "`${CC} -pthread -c conftest.c 2>&1`" ; then |
|---|
| 854 |
ac_cv_CC_accepts_pthread='yes' |
|---|
| 855 |
else |
|---|
| 856 |
ac_cv_CC_accepts_pthread='no' |
|---|
| 857 |
fi |
|---|
| 858 |
rm -f conftest* |
|---|
| 859 |
]) |
|---|
| 860 |
fi |
|---|
| 861 |
|
|---|
| 862 |
AC_LANG_SAVE |
|---|
| 863 |
AC_LANG_CPLUSPLUS |
|---|
| 864 |
ac_ext='cpp' |
|---|
| 865 |
|
|---|
| 866 |
AC_CACHE_CHECK([for C++ template support], |
|---|
| 867 |
[vj_cv_CXX_handles_templates], |
|---|
| 868 |
[AC_TRY_COMPILE([template<class T> class Test { |
|---|
| 869 |
public: |
|---|
| 870 |
Test() {;} |
|---|
| 871 |
}; |
|---|
| 872 |
template<class T> void f (const Test<T>&){;}], |
|---|
| 873 |
[ |
|---|
| 874 |
Test<double> d; |
|---|
| 875 |
Test<int> i; |
|---|
| 876 |
f(d); |
|---|
| 877 |
f(i); |
|---|
| 878 |
return 0; ], |
|---|
| 879 |
[ vj_cv_CXX_handles_templates='yes' |
|---|
| 880 |
rm -rf ./ii_files ], |
|---|
| 881 |
[vj_cv_CXX_handles_templates='no'])]) |
|---|
| 882 |
|
|---|
| 883 |
AC_LANG_RESTORE |
|---|
| 884 |
|
|---|
| 885 |
AC_PROG_CPP |
|---|
| 886 |
AC_PROG_CXXCPP |
|---|
| 887 |
|
|---|
| 888 |
CFLAGS="${_vjsave_CFLAGS}" |
|---|
| 889 |
CXXFLAGS="${_vjsave_CXXFLAGS}" |
|---|
| 890 |
|
|---|
| 891 |
JAVAC='' |
|---|
| 892 |
JAR='' |
|---|
| 893 |
|
|---|
| 894 |
dnl # Check for the JDK (specifically try to find javac(1) in $JDK_HOME or |
|---|
| 895 |
dnl # in ${_JDK_HOME_ALT_LIST}). |
|---|
| 896 |
AC_PATH_PROG([JAVAC], [javac], [no], |
|---|
| 897 |
[${JDK_HOME}/bin:$PATH:${_JDK_HOME_ALT_LIST}]) |
|---|
| 898 |
|
|---|
| 899 |
dnl # If there is still no value in $JAVAC, then warn that the GUI will not be |
|---|
| 900 |
dnl # built. |
|---|
| 901 |
if test "$JAVAC" = "no" ; then |
|---|
| 902 |
AC_MSG_WARN([*** The GUI requires javac -- it will not be built ***]) |
|---|
| 903 |
BUILD_GUI='N' |
|---|
| 904 |
dnl # Otherwise, set $JAR to the path to jar(1) and continue. |
|---|
| 905 |
else |
|---|
| 906 |
if test "$OS_TYPE" = "Win32" ; then |
|---|
| 907 |
JAVAC=`unix2dos "$JAVAC"` |
|---|
| 908 |
fi |
|---|
| 909 |
|
|---|
| 910 |
JAR=`echo $JAVAC | sed 's/javac$//'`jar |
|---|
| 911 |
BUILD_GUI='Y' |
|---|
| 912 |
fi |
|---|
| 913 |
|
|---|
| 914 |
dnl # If we are on a Win32 system, use $ac_install_sh for the install |
|---|
| 915 |
dnl # program. This prevents problems with paths if an install program is |
|---|
| 916 |
dnl # found elsewhere on the system. |
|---|
| 917 |
dnl # XXX: This may not be a safe value to use since it is internal to the |
|---|
| 918 |
dnl # generated configure script. (patrick 1/10/2000) |
|---|
| 919 |
if test "$OS_TYPE" = "Win32" ; then |
|---|
| 920 |
INSTALL="$ac_install_sh" |
|---|
| 921 |
dnl # Otherwise, use the safe AC_PROG_INSTALL macro. |
|---|
| 922 |
else |
|---|
| 923 |
AC_PROG_INSTALL |
|---|
| 924 |
fi |
|---|
| 925 |
|
|---|
| 926 |
dnl # Ensure that a version of Perl greater than or equal to 5.004 is |
|---|
| 927 |
dnl # available. |
|---|
| 928 |
chkPerl ( ) { |
|---|
| 929 |
if test -x "$1" ; then |
|---|
| 930 |
retval=`$1 -e "printf("%s\n", (($] >= 5.004) ? 0 : 1))"` |
|---|
| 931 |
else |
|---|
| 932 |
retval=1 |
|---|
| 933 |
fi |
|---|
| 934 |
|
|---|
| 935 |
echo $retval |
|---|
| 936 |
} |
|---|
| 937 |
|
|---|
| 938 |
_PERL_PATH='/usr/local/bin /usr/bin C:/Perl/bin' |
|---|
| 939 |
|
|---|
| 940 |
dnl # If ${_user_perl_path} has a value, prepend that on ${_PERL_PATH} so that |
|---|
| 941 |
dnl # it will be checked before the standard places. |
|---|
| 942 |
if test "x${_user_perl_path}" != "x" ; then |
|---|
| 943 |
_PERL_PATH="${_user_perl_path} ${_PERL_PATH}" |
|---|
| 944 |
fi |
|---|
| 945 |
|
|---|
| 946 |
AC_CACHE_CHECK([for Perl version >= 5.004], |
|---|
| 947 |
[ac_cv_perl_version], |
|---|
| 948 |
[ ac_cv_perl_version='no' ; |
|---|
| 949 |
for _dir in ${_PERL_PATH} ; do |
|---|
| 950 |
if eval "test \"`chkPerl ${_dir}/perl`\" -eq 0" ; then |
|---|
| 951 |
ac_cv_perl_version="${_dir}/perl" |
|---|
| 952 |
break |
|---|
| 953 |
elif eval "test \"`chkPerl ${_dir}/perl5`\" -eq 0" ; then |
|---|
| 954 |
ac_cv_perl_version="${_dir}/perl5" |
|---|
| 955 |
break |
|---|
| 956 |
fi |
|---|
| 957 |
done |
|---|
| 958 |
]) |
|---|
| 959 |
|
|---|
| 960 |
PERL="$ac_cv_perl_version" |
|---|
| 961 |
|
|---|
| 962 |
AC_CHECK_PROG(MTREE_CMD, mtree, mtree, \${PERL} \${scriptdir}/mtree.pl) |
|---|
| 963 |
AC_PROG_MAKE_SET |
|---|
| 964 |
|
|---|
| 965 |
dnl # While ranlib(1) is not part of the base IRIX installation, the VRAC SGIs |
|---|
| 966 |
dnl # have a ranlib(1) installed that does very bad things to ar archives. |
|---|
| 967 |
dnl # We also do not want to use the Cygwin ranlib(1) with the Visual C++ |
|---|
| 968 |
dnl # LINK.EXE command. |
|---|
| 969 |
if test "$PLATFORM" = "IRIX" -o "$OS_TYPE" = "Win32" ; then |
|---|
| 970 |
RANLIB=':' |
|---|
| 971 |
else |
|---|
| 972 |
AC_PROG_RANLIB |
|---|
| 973 |
fi |
|---|
| 974 |
|
|---|
| 975 |
AC_PROG_LN_S |
|---|
| 976 |
|
|---|
| 977 |
dnl # ------------------------------------------------------------------------- |
|---|
| 978 |
dnl # Checks for libraries. |
|---|
| 979 |
dnl # ------------------------------------------------------------------------- |
|---|
| 980 |
|
|---|
| 981 |
THREADS='' |
|---|
| 982 |
|
|---|
| 983 |
dnl # Test for libpthread or for libcma if libpthread is not present. |
|---|
| 984 |
dnl # If the library is found, check for pthread_kill(). If it is present, |
|---|
| 985 |
dnl # Draft 10 (the "final" draft) of the POSIX threads standard is in place. |
|---|
| 986 |
dnl # If not, Draft 4 is available. |
|---|
| 987 |
if test "x${_thread_pkg}" = "xPOSIX" ; then |
|---|
| 988 |
_vjsave_LDFLAGS="$LDFLAGS" |
|---|
| 989 |
|
|---|
| 990 |
if test "$ac_cv_CC_accepts_pthread" = "yes" ; then |
|---|
| 991 |
LDFLAGS="$LDFLAGS -pthread" |
|---|
| 992 |
fi |
|---|
| 993 |
|
|---|
| 994 |
dnl # On HP-UX 11.00, HP hides the pthread library from configure. |
|---|
| 995 |
dnl # This forces its use with the -mt flag. |
|---|
| 996 |
if test "$PLATFORM" = "HP" ; then |
|---|
| 997 |
THREADS='POSIX' |
|---|
| 998 |
fi |
|---|
| 999 |
|
|---|
| 1000 |
AC_CHECK_LIB([pthread], [pthread_create], |
|---|
| 1001 |
[AC_CHECK_HEADER([pthread.h], |
|---|
| 1002 |
[ THREADS='POSIX' _pthread_lib='-lpthread'; ], |
|---|
| 1003 |
[AC_MSG_WARN([*** POSIX threads will not be used (header file not found) ***])])]) |
|---|
| 1004 |
|
|---|
| 1005 |
dnl # On FreeBSD, the pthreads stuff is in libc_r. |
|---|
| 1006 |
if test "x$THREADS" = "x" ; then |
|---|
| 1007 |
AC_CHECK_LIB([c_r], [pthread_create], |
|---|
| 1008 |
[AC_CHECK_HEADER([pthread.h], |
|---|
| 1009 |
[ THREADS='POSIX' _pthread_lib='' ], |
|---|
| 1010 |
[AC_MSG_WARN([*** POSIX threads will not be used (header file not found) ***])])]) |
|---|
| 1011 |
fi |
|---|
| 1012 |
|
|---|
| 1013 |
dnl # If $THREADS is equal to "POSIX" at this point, then the pthread |
|---|
| 1014 |
dnl # libraries needed are in $LIBS, so now we make a check for the draft |
|---|
| 1015 |
dnl # revision being used. This is done by determining if pthread_kill() |
|---|
| 1016 |
dnl # is in the library. If it is, Draft 10 is in use. Otherwise, assume |
|---|
| 1017 |
dnl # it is Draft 4. |
|---|
| 1018 |
if test "$THREADS" = "POSIX" ; then |
|---|
| 1019 |
_vjsave_LIBS="$LIBS" |
|---|
| 1020 |
LIBS="$LIBS ${_pthread_lib}" |
|---|
| 1021 |
|
|---|
| 1022 |
AC_CACHE_CHECK([POSIX threads draft revision], |
|---|
| 1023 |
[ac_cv_pthread_version], |
|---|
| 1024 |
[AC_TRY_LINK([#include <pthread.h> ], |
|---|
| 1025 |
[ pthread_t t; pthread_kill(t, 1); ], |
|---|
| 1026 |
[ac_cv_pthread_version='Draft 10'], |
|---|
| 1027 |
[ac_cv_pthread_version='Draft 4'])]) |
|---|
| 1028 |
|
|---|
| 1029 |
AC_CHECK_FUNC([pthread_attr_setstack], |
|---|
| 1030 |
[AC_DEFINE([HAVE_PTHREAD_ATTR_SETSTACK], [1])]) |
|---|
| 1031 |
|
|---|
| 1032 |
LIBS="${_vjsave_LIBS}" |
|---|
| 1033 |
|
|---|
| 1034 |
dnl # HP once again, not playing by the rules. Forcing draft level 10. |
|---|
| 1035 |
if test "$PLATFORM" = "HP" ; then |
|---|
| 1036 |
AC_MSG_WARN(*** Forcing Pthreads Draft 10 on HP ***) |
|---|
| 1037 |
AC_DEFINE(_PTHREADS_DRAFT_10,) |
|---|
| 1038 |
else |
|---|
| 1039 |
if test "$ac_cv_pthread_version" = "Draft 10" ; then |
|---|
| 1040 |
AC_DEFINE(_PTHREADS_DRAFT_10,) |
|---|
|
|---|