configure.in
author Ryan C. Gordon <icculus@icculus.org>
Tue, 30 Jul 2002 05:49:57 +0000
changeset 441 12831102c972
parent 435 c4daca3b09b9
child 444 06f6a31057a0
permissions -rw-r--r--
French support in build system.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
# Process this file with autoconf to produce a configure script.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
AC_INIT(physfs.c)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
dnl System/version info
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
# Making releases:
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
#   MICRO_VERSION += 1;
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
#   INTERFACE_AGE += 1;
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
#   BINARY_AGE += 1;
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
# if any functions have been added, set INTERFACE_AGE to 0.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
# if backwards compatibility has been broken,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
# set BINARY_AGE and INTERFACE_AGE to 0.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
MAJOR_VERSION=0
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
MINOR_VERSION=1
323
6da51f38cfd8 Upped version to 0.1.7.
Ryan C. Gordon <icculus@icculus.org>
parents: 310
diff changeset
    18
MICRO_VERSION=7
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
INTERFACE_AGE=0
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
BINARY_AGE=0
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
AC_SUBST(MAJOR_VERSION)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
AC_SUBST(MINOR_VERSION)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
AC_SUBST(MICRO_VERSION)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
AC_SUBST(INTERFACE_AGE)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
AC_SUBST(BINARY_AGE)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
AC_SUBST(VERSION)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
# libtool versioning
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
LT_REVISION=$INTERFACE_AGE
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    35
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    36
AC_SUBST(LT_RELEASE)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    37
AC_SUBST(LT_CURRENT)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    38
AC_SUBST(LT_REVISION)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
AC_SUBST(LT_AGE)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
dnl Detect the canonical host and target build environment
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
    42
AC_CANONICAL_BUILD
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
AC_CANONICAL_HOST
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
AC_CANONICAL_TARGET
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    45
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
dnl Setup for automake
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    47
AM_CONFIG_HEADER(config.h)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    48
AM_INIT_AUTOMAKE(physfs, $VERSION)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    49
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    50
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    51
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    52
dnl Compilers and other tools
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    53
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    54
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    55
AC_PROG_CC
234
2710ee66a482 BeOS support.
Ryan C. Gordon <icculus@icculus.org>
parents: 231
diff changeset
    56
AC_PROG_CXX
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    57
AC_PROG_INSTALL
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    58
AC_PROG_LN_S
289
a0bca1a03a54 Can now build shared libraries under BeOS, and probably Cygwin, too.
Ryan C. Gordon <icculus@icculus.org>
parents: 285
diff changeset
    59
AC_LIBTOOL_WIN32_DLL 
302
b6fe2b615045 Build dance continues.
Ryan C. Gordon <icculus@icculus.org>
parents: 296
diff changeset
    60
LIBTOOL="libtool"
b6fe2b615045 Build dance continues.
Ryan C. Gordon <icculus@icculus.org>
parents: 296
diff changeset
    61
AM_PROG_LIBTOOL
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
    62
AC_CHECK_PROG(we_have_sed, sed, yes, no)
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    63
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    64
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    65
dnl Debug mode?
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    66
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    67
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    68
AC_ARG_ENABLE(debug,
216
d297da72cd4e --enable-debug is default.
Ryan C. Gordon <icculus@icculus.org>
parents: 214
diff changeset
    69
[  --enable-debug             enable debug mode [default=yes]],
d297da72cd4e --enable-debug is default.
Ryan C. Gordon <icculus@icculus.org>
parents: 214
diff changeset
    70
              , enable_debug=yes)
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    71
if test x$enable_debug = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    72
  if test x$ac_cv_prog_cc_g = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    73
    CFLAGS="-g -O0"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    74
  else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    75
    CFLAGS="-O0"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    76
  fi
252
5e537265e682 Added -Wall to debug builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 241
diff changeset
    77
  CFLAGS="$CFLAGS -Werror -Wall"
331
822f78a88aba Now makes newer autoconfs happier.
Ryan C. Gordon <icculus@icculus.org>
parents: 323
diff changeset
    78
  AC_DEFINE([DEBUG], 1, [define if debug build is enabled])
822f78a88aba Now makes newer autoconfs happier.
Ryan C. Gordon <icculus@icculus.org>
parents: 323
diff changeset
    79
  AC_DEFINE([DEBUG_CHATTER], 1, [define if debug chatter is enabled])
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    80
else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    81
  CFLAGS="-O2"
331
822f78a88aba Now makes newer autoconfs happier.
Ryan C. Gordon <icculus@icculus.org>
parents: 323
diff changeset
    82
  AC_DEFINE([NDEBUG], 1, [define if debug build is disabled])
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    83
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    84
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    85
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    86
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    87
dnl Build test program?
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    88
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    89
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    90
AC_ARG_ENABLE(testprog,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    91
[  --enable-testprog          build test program [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    92
              , enable_testprog=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    93
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    94
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    95
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    96
dnl Checks for libraries.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    97
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    98
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    99
require_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   100
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   101
dnl Check for zip archiver inclusion...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   102
AC_ARG_ENABLE(zip,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   103
[  --enable-zip               enable ZIP support [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   104
              , enable_zip=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   105
if test x$enable_zip = xyes; then
331
822f78a88aba Now makes newer autoconfs happier.
Ryan C. Gordon <icculus@icculus.org>
parents: 323
diff changeset
   106
  AC_DEFINE([PHYSFS_SUPPORTS_ZIP], 1, [define if zip support is enabled])
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   107
  require_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   108
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   109
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   110
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
dnl Check for zip archiver inclusion...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
AC_ARG_ENABLE(grp,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
[  --enable-grp               enable Build Engine GRP support [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   114
              , enable_grp=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
if test x$enable_grp = xyes; then
331
822f78a88aba Now makes newer autoconfs happier.
Ryan C. Gordon <icculus@icculus.org>
parents: 323
diff changeset
   116
  AC_DEFINE([PHYSFS_SUPPORTS_GRP], 1, [define if grp support is enabled])
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   117
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   118
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   119
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   120
AC_ARG_ENABLE(internal-zlib,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   121
[  --enable-internal-zlib     use included zlib [default=only if needed]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   122
              , enable_internal_zlib=maybe)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   123
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   124
dnl Check for zlib if needed.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
have_external_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
if test x$enable_internal_zlib != xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   127
  if test x$require_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   128
    AC_CHECK_HEADER(zlib.h, have_zlib_hdr=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   129
    AC_CHECK_LIB(z, zlibVersion, have_zlib_lib=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   130
    if test x$have_zlib_hdr = xyes -a x$have_zlib_lib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   131
      have_external_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   132
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   133
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   134
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   135
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   136
AC_MSG_CHECKING([what zlib to use])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   137
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   138
dnl no zlib is needed at all if we aren't supporting ZIP files.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   139
if test x$require_zlib = xno; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   140
  enable_internal_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   141
  enable_external_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   142
  AC_MSG_RESULT([no zlib needed])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   143
else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   144
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   145
  if test x$enable_internal_zlib = xmaybe; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   146
    if test x$have_external_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   147
      enable_internal_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   148
      enable_external_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   149
    else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   150
      enable_internal_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   151
      enable_external_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   152
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   153
  else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   154
    if test x$enable_internal_zlib = xno -a x$have_external_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   155
      enable_internal_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   156
      enable_external_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   157
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   158
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   159
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   160
  if test x$enable_internal_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   161
    AC_MSG_RESULT([internal zlib])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   162
  else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   163
    if test x$enable_external_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   164
      AC_MSG_RESULT([external zlib])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   165
      LIBS="$LIBS -lz"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   166
    else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   167
      AC_MSG_ERROR([Need zlib, but you disabled our copy and have no system lib])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   168
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   169
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   170
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   171
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   172
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   173
dnl determine if we should include readline support...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   174
AC_ARG_ENABLE(readline,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   175
[  --enable-readline          use GNU readline in test program [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   176
              , enable_readline=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   177
if test x$enable_readline = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   178
  AC_CHECK_HEADER(readline/readline.h, have_readline_hdr=yes)
218
9415dcace296 readline detection fixes by Edward Rudd.
Ryan C. Gordon <icculus@icculus.org>
parents: 216
diff changeset
   179
  AC_CHECK_LIB(readline, readline, have_readline_lib=yes, , -lcurses)
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   180
  AC_CHECK_HEADER(readline/history.h, have_history_hdr=yes)
218
9415dcace296 readline detection fixes by Edward Rudd.
Ryan C. Gordon <icculus@icculus.org>
parents: 216
diff changeset
   181
  AC_CHECK_LIB(readline, add_history, have_history_lib=yes, , -lcurses)
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   182
  if test x$have_readline_hdr = xyes -a x$have_readline_lib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   183
    if test x$have_history_hdr = xyes -a x$have_history_lib = xyes; then
331
822f78a88aba Now makes newer autoconfs happier.
Ryan C. Gordon <icculus@icculus.org>
parents: 323
diff changeset
   184
      AC_DEFINE([PHYSFS_HAVE_READLINE], 1, [define if we have readline])
218
9415dcace296 readline detection fixes by Edward Rudd.
Ryan C. Gordon <icculus@icculus.org>
parents: 216
diff changeset
   185
      LIBS="$LIBS -lreadline -lcurses"
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   186
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   187
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   188
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   189
382
7c63d65fd179 Made CD-ROM stuff a bit more automatic.
Ryan C. Gordon <icculus@icculus.org>
parents: 381
diff changeset
   190
dnl !!! FIXME: Not sure how to detect this...
7c63d65fd179 Made CD-ROM stuff a bit more automatic.
Ryan C. Gordon <icculus@icculus.org>
parents: 381
diff changeset
   191
dnl check for 64-bit llseek()...
7c63d65fd179 Made CD-ROM stuff a bit more automatic.
Ryan C. Gordon <icculus@icculus.org>
parents: 381
diff changeset
   192
dnl AC_CHECK_LIB(c, llseek, have_llseek=yes)
7c63d65fd179 Made CD-ROM stuff a bit more automatic.
Ryan C. Gordon <icculus@icculus.org>
parents: 381
diff changeset
   193
if test x$have_llseek = xyes; then
7c63d65fd179 Made CD-ROM stuff a bit more automatic.
Ryan C. Gordon <icculus@icculus.org>
parents: 381
diff changeset
   194
  AC_DEFINE([PHYSFS_HAVE_LLSEEK], 1, [define if we have llseek])
7c63d65fd179 Made CD-ROM stuff a bit more automatic.
Ryan C. Gordon <icculus@icculus.org>
parents: 381
diff changeset
   195
fi
7c63d65fd179 Made CD-ROM stuff a bit more automatic.
Ryan C. Gordon <icculus@icculus.org>
parents: 381
diff changeset
   196
384
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   197
390
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   198
dnl determine if we should use the stubbed pthread code.
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   199
AC_ARG_ENABLE(pthreads,
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   200
[  --enable-pthreads          include POSIX threads support [default=yes]],
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   201
              , enable_pthreads=yes)
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   202
if test x$enable_pthreads = xyes; then
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   203
  AC_CHECK_HEADER(pthread.h, have_pthread_hdr=yes)
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   204
  if test x$have_pthread_hdr != xyes; then
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   205
    enable_pthreads=no
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   206
  fi
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   207
fi
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   208
381
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   209
dnl determine if we should use the stubbed CD-ROM detection code.
384
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   210
AC_ARG_ENABLE(cdrom,
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   211
[  --enable-cdrom             include CD-ROM support [default=yes]],
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   212
              , enable_cdrom=yes)
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   213
if test x$enable_cdrom = xyes; then
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   214
  dnl reset this and let header detection reenable...
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   215
  enable_cdrom=no
382
7c63d65fd179 Made CD-ROM stuff a bit more automatic.
Ryan C. Gordon <icculus@icculus.org>
parents: 381
diff changeset
   216
384
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   217
  dnl BSD systems use sys/ucred.h for getting mounted volumes.
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   218
  dnl Linux and others use mntent.h.
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   219
  AC_CHECK_HEADER(sys/ucred.h, have_ucred_hdr=yes)
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   220
  if test x$have_ucred_hdr = xyes; then
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   221
    AC_DEFINE([PHYSFS_HAVE_SYS_UCRED_H], 1, [define if we have sys/ucred.h])
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   222
    enable_cdrom=yes
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   223
  fi
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   224
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   225
  AC_CHECK_HEADER(mntent.h, have_mntent_hdr=yes)
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   226
  if test x$have_mntent_hdr = xyes; then
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   227
    AC_DEFINE([PHYSFS_HAVE_MNTENT_H], 1, [define if we have mntent.h])
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   228
    enable_cdrom=yes
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   229
  fi
382
7c63d65fd179 Made CD-ROM stuff a bit more automatic.
Ryan C. Gordon <icculus@icculus.org>
parents: 381
diff changeset
   230
fi
7c63d65fd179 Made CD-ROM stuff a bit more automatic.
Ryan C. Gordon <icculus@icculus.org>
parents: 381
diff changeset
   231
427
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   232
dnl determine language.
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   233
physfslang=english
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   234
AC_ARG_ENABLE(language,
435
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   235
[  --enable-language=lang     Select natural language. [default=english]],
427
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   236
              physfslang=`echo $enable_language |tr A-Z a-z`)
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   237
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   238
AC_MSG_CHECKING([if language choice is supported])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   239
physfs_valid_lang=no
435
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   240
427
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   241
if test x$physfslang = xenglish; then
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   242
  physfs_valid_lang=yes
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   243
  AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_ENGLISH, [define desired natural language])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   244
fi
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   245
434
19a16ec64f82 Changed russian to russian-koi8-r.
Ryan C. Gordon <icculus@icculus.org>
parents: 431
diff changeset
   246
if test x$physfslang = xrussian-koi8-r; then
431
a1cb2bf24ce5 Added Russian translation by Ed Sinjiashvili.
Ryan C. Gordon <icculus@icculus.org>
parents: 427
diff changeset
   247
  physfs_valid_lang=yes
434
19a16ec64f82 Changed russian to russian-koi8-r.
Ryan C. Gordon <icculus@icculus.org>
parents: 431
diff changeset
   248
  AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_RUSSIAN_KOI8_R, [define desired natural language])
431
a1cb2bf24ce5 Added Russian translation by Ed Sinjiashvili.
Ryan C. Gordon <icculus@icculus.org>
parents: 427
diff changeset
   249
fi
a1cb2bf24ce5 Added Russian translation by Ed Sinjiashvili.
Ryan C. Gordon <icculus@icculus.org>
parents: 427
diff changeset
   250
435
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   251
if test x$physfslang = xspanish; then
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   252
  physfs_valid_lang=yes
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   253
  AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_SPANISH, [define desired natural language])
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   254
fi
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   255
441
12831102c972 French support in build system.
Ryan C. Gordon <icculus@icculus.org>
parents: 435
diff changeset
   256
if test x$physfslang = xfrench; then
12831102c972 French support in build system.
Ryan C. Gordon <icculus@icculus.org>
parents: 435
diff changeset
   257
  physfs_valid_lang=yes
12831102c972 French support in build system.
Ryan C. Gordon <icculus@icculus.org>
parents: 435
diff changeset
   258
  AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_FRENCH, [define desired natural language])
12831102c972 French support in build system.
Ryan C. Gordon <icculus@icculus.org>
parents: 435
diff changeset
   259
fi
12831102c972 French support in build system.
Ryan C. Gordon <icculus@icculus.org>
parents: 435
diff changeset
   260
435
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   261
427
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   262
dnl Add other language checks here...
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   263
435
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   264
427
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   265
AC_MSG_RESULT([$physfs_valid_lang])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   266
if test x$physfs_valid_lang = xno; then
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   267
  AC_MSG_WARN([***])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   268
  AC_MSG_WARN([*** You've asked for "$physfslang" language support...])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   269
  AC_MSG_WARN([***  ...but we don't support that.])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   270
  AC_MSG_WARN([*** You could choose another language,])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   271
  AC_MSG_WARN([***   but is this what you REALLY wanted?])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   272
  AC_MSG_WARN([*** Please see the LANG section of physfs_internal.h])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   273
  AC_MSG_WARN([***  for info on writing a translation.])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   274
  AC_MSG_WARN([***])
435
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   275
  AC_MSG_WARN([*** Currently known languages:])
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   276
  AC_MSG_WARN([***   --enable-language=english])
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   277
  AC_MSG_WARN([***   --enable-language=spanish])
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   278
  AC_MSG_WARN([***   --enable-language=russian-koi8-r])
441
12831102c972 French support in build system.
Ryan C. Gordon <icculus@icculus.org>
parents: 435
diff changeset
   279
  AC_MSG_WARN([***   --enable-language=french])
435
c4daca3b09b9 Spanish translation added by Pedro J. P�rez.
Ryan C. Gordon <icculus@icculus.org>
parents: 434
diff changeset
   280
  AC_MSG_WARN([***])
427
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   281
  AC_MSG_ERROR([*** unsupported language. stop.])
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   282
fi
c38ace41039f Natural language #defines and build system support.
Ryan C. Gordon <icculus@icculus.org>
parents: 390
diff changeset
   283
390
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   284
have_non_posix_threads=no
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   285
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   286
AC_MSG_CHECKING([if this is BeOS])
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   287
if test x$build_os = xbeos; then
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   288
  this_is_beos=yes
390
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   289
  enable_pthreads=no
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   290
  have_non_posix_threads=yes
234
2710ee66a482 BeOS support.
Ryan C. Gordon <icculus@icculus.org>
parents: 231
diff changeset
   291
  LIBS="$LIBS -lroot -lbe"
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   292
else
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   293
  this_is_beos=no
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   294
fi
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   295
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   296
AC_MSG_RESULT([$this_is_beos])
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   297
310
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   298
AC_MSG_CHECKING([if this is Cygwin])
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   299
if test x$build_os = xcygwin; then
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   300
  this_is_cygwin=yes
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   301
  CFLAGS="$CFLAGS -DWIN32"
390
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   302
  enable_pthreads=no
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   303
  have_non_posix_threads=yes
310
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   304
else
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   305
  this_is_cygwin=no
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   306
fi
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   307
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   308
AC_MSG_RESULT([$this_is_cygwin])
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   309
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   310
this_is_macosx=no
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   311
if test x$we_have_sed = xyes; then
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   312
  AC_MSG_CHECKING([if this is MacOS X])
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   313
  x=`echo $build_os |sed "s/darwin.*/darwin/"`
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   314
  if test x$x = xdarwin -a x$build_vendor = xapple; then
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   315
    this_is_macosx=yes
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   316
  fi
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   317
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   318
  AC_MSG_RESULT([$this_is_macosx])
234
2710ee66a482 BeOS support.
Ryan C. Gordon <icculus@icculus.org>
parents: 231
diff changeset
   319
fi
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   320
347
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   321
this_is_freebsd=no
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   322
if test x$we_have_sed = xyes; then
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   323
  AC_MSG_CHECKING([if this is FreeBSD])
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   324
  x=`echo $build_os |tr A-Z a-z |sed "s/.*freebsd.*/freebsd/"`
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   325
  if test x$x = xfreebsd; then
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   326
    this_is_freebsd=yes
353
7adb20841f11 More FreeBSD build fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 351
diff changeset
   327
    LDFLAGS="$LDFLAGS -pthread"
347
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   328
  fi
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   329
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   330
  AC_MSG_RESULT([$this_is_freebsd])
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   331
fi
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   332
378
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   333
this_is_openbsd=no
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   334
if test x$we_have_sed = xyes; then
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   335
  AC_MSG_CHECKING([if this is OpenBSD])
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   336
  x=`echo $build_os |tr A-Z a-z |sed "s/.*openbsd.*/openbsd/"`
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   337
  if test x$x = xopenbsd; then
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   338
    this_is_openbsd=yes
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   339
    LDFLAGS="$LDFLAGS -pthread"
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   340
  fi
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   341
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   342
  AC_MSG_RESULT([$this_is_openbsd])
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   343
fi
41cda991e23a Added build system support for OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 353
diff changeset
   344
381
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   345
this_is_atheos=no
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   346
if test x$we_have_sed = xyes; then
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   347
  AC_MSG_CHECKING([if this is AtheOS])
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   348
  x=`echo $build_os |tr A-Z a-z |sed "s/.*atheos.*/atheos/"`
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   349
  if test x$x = xatheos; then
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   350
    this_is_atheos=yes
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   351
    enable_cdrom=no
390
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   352
    enable_pthreads=no
381
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   353
  fi
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   354
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   355
  AC_MSG_RESULT([$this_is_atheos])
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   356
fi
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   357
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   358
dnl Some platform might disable this, so check this down here...
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   359
if test x$enable_cdrom != xyes; then
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   360
  AC_DEFINE([PHYSFS_NO_CDROM_SUPPORT], 1, [define if we have no CD support])
384
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   361
  AC_MSG_WARN([***])
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   362
  AC_MSG_WARN([*** There is no CD-ROM support in this build!])
390
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   363
  AC_MSG_WARN([*** PhysicsFS will just pretend there are no discs.])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   364
  AC_MSG_WARN([*** This may be fine, depending on how PhysicsFS is used,])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   365
  AC_MSG_WARN([***   but is this what you REALLY wanted?])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   366
  AC_MSG_WARN([*** (Maybe fix configure.in, or write a platform driver?)])
384
9f6761c089fa Changed cd detection stuff again. More robust.
Ryan C. Gordon <icculus@icculus.org>
parents: 382
diff changeset
   367
  AC_MSG_WARN([***])
381
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   368
fi
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   369
390
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   370
if test x$enable_pthreads != xyes; then
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   371
  AC_DEFINE([PHYSFS_NO_PTHREADS_SUPPORT], 1, [define if we have no POSIX threads support])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   372
  if test x$have_non_posix_threads != xyes; then
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   373
    AC_MSG_WARN([***])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   374
    AC_MSG_WARN([*** There is no thread support in this build!])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   375
    AC_MSG_WARN([*** PhysicsFS will NOT be reentrant!])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   376
    AC_MSG_WARN([*** This may be fine, depending on how PhysicsFS is used,])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   377
    AC_MSG_WARN([***   but is this what you REALLY wanted?])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   378
    AC_MSG_WARN([*** (Maybe fix configure.in, or write a platform driver?)])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   379
    AC_MSG_WARN([***])
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   380
  fi
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   381
fi
6649d6caecf2 Stub code for platforms without functional pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 389
diff changeset
   382
381
b65d27fdc8a9 Can now disable CD-ROM code on Unix systems at build time if need be. The
Ryan C. Gordon <icculus@icculus.org>
parents: 378
diff changeset
   383
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   384
# Checks for header files.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   385
AC_HEADER_STDC
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   386
AC_CHECK_HEADERS([stdlib.h string.h])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   387
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   388
# Checks for typedefs, structures, and compiler characteristics.
269
d41c0a399a99 Removed some unnecessary things that broke BeOS builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 261
diff changeset
   389
dnl AC_C_CONST
d41c0a399a99 Removed some unnecessary things that broke BeOS builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 261
diff changeset
   390
dnl AC_TYPE_SIZE_T
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   391
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   392
# Checks for library functions.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   393
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   394
# This is only in the bleeding edge autoconf distro...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   395
#AC_FUNC_MALLOC
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   396
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   397
AC_FUNC_MEMCMP
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   398
AC_CHECK_FUNCS([memset strrchr])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   399
347
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   400
CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   401
LDFLAGS="$LDFLAGS -no-undefined"
56ce50a62241 FreeBSD patches; appears to be fully functional now.
Ryan C. Gordon <icculus@icculus.org>
parents: 331
diff changeset
   402
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   403
dnl Add Makefile conditionals
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   404
AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   405
AM_CONDITIONAL(BUILD_TEST_PHYSFS, test x$enable_testprog = xyes)
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   406
AM_CONDITIONAL(BUILD_MACOSX, test x$this_is_macosx = xyes)
307
babb5487b60a More build stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 302
diff changeset
   407
AM_CONDITIONAL(BUILD_BEOS, test x$this_is_beos = xyes)
310
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   408
AM_CONDITIONAL(BUILD_CYGWIN, test x$this_is_cygwin = xyes)
302
b6fe2b615045 Build dance continues.
Ryan C. Gordon <icculus@icculus.org>
parents: 296
diff changeset
   409
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   410
AC_OUTPUT([
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   411
Makefile
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   412
archivers/Makefile
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   413
platform/Makefile
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   414
zlib114/Makefile
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   415
test/Makefile
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   416
extras/Makefile
389
b35668cd8b3e Moved the RPM spec file to spec.in, so version dynamically keeps up.
Ryan C. Gordon <icculus@icculus.org>
parents: 384
diff changeset
   417
physfs.spec
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   418
])
231
e4f81b0f1c93 Corrected to fix "make dist".
Ryan C. Gordon <icculus@icculus.org>
parents: 224
diff changeset
   419
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   420
dnl end of configure.in ...
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   421