configure.in
author Ryan C. Gordon <icculus@icculus.org>
Sat, 29 Jun 2002 10:23:17 +0000
changeset 310 f8bca4a93fd5
parent 307 babb5487b60a
child 323 6da51f38cfd8
permissions -rw-r--r--
Patched to compile on Cygwin.
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
237
2abc99254366 Upped version to 0.1.6
Ryan C. Gordon <icculus@icculus.org>
parents: 234
diff changeset
    18
MICRO_VERSION=6
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"
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    78
  AC_DEFINE(DEBUG)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    79
  AC_DEFINE(DEBUG_CHATTER)
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"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    82
  AC_DEFINE(NDEBUG)
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
261
9e1647c75ae0 64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents: 252
diff changeset
    99
dnl !!! FIXME: Not sure how to detect this...
9e1647c75ae0 64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents: 252
diff changeset
   100
dnl check for 64-bit llseek()...
9e1647c75ae0 64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents: 252
diff changeset
   101
dnl AC_CHECK_LIB(c, llseek, have_llseek=yes)
9e1647c75ae0 64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents: 252
diff changeset
   102
if test x$have_llseek = xyes; then
9e1647c75ae0 64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents: 252
diff changeset
   103
  AC_DEFINE(PHYSFS_HAVE_LLSEEK)
9e1647c75ae0 64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents: 252
diff changeset
   104
fi
9e1647c75ae0 64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents: 252
diff changeset
   105
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   106
require_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   107
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   108
dnl Check for zip archiver inclusion...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   109
AC_ARG_ENABLE(zip,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   110
[  --enable-zip               enable ZIP support [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
              , enable_zip=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
if test x$enable_zip = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
  AC_DEFINE(PHYSFS_SUPPORTS_ZIP)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   114
  require_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   116
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   117
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   118
dnl Check for zip archiver inclusion...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   119
AC_ARG_ENABLE(grp,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   120
[  --enable-grp               enable Build Engine GRP support [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   121
              , enable_grp=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   122
if test x$enable_grp = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   123
  AC_DEFINE(PHYSFS_SUPPORTS_GRP)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   124
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   127
AC_ARG_ENABLE(internal-zlib,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   128
[  --enable-internal-zlib     use included zlib [default=only if needed]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   129
              , enable_internal_zlib=maybe)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   130
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   131
dnl Check for zlib if needed.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   132
have_external_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   133
if test x$enable_internal_zlib != xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   134
  if test x$require_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   135
    AC_CHECK_HEADER(zlib.h, have_zlib_hdr=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   136
    AC_CHECK_LIB(z, zlibVersion, have_zlib_lib=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   137
    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
   138
      have_external_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   139
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   140
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   141
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   142
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   143
AC_MSG_CHECKING([what zlib to use])
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
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
   146
if test x$require_zlib = xno; 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="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   149
  AC_MSG_RESULT([no zlib needed])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   150
else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   151
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   152
  if test x$enable_internal_zlib = xmaybe; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   153
    if test x$have_external_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   154
      enable_internal_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   155
      enable_external_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   156
    else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   157
      enable_internal_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   158
      enable_external_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   159
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   160
  else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   161
    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
   162
      enable_internal_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   163
      enable_external_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   164
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   165
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   166
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   167
  if test x$enable_internal_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   168
    AC_MSG_RESULT([internal zlib])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   169
  else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   170
    if test x$enable_external_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   171
      AC_MSG_RESULT([external zlib])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   172
      LIBS="$LIBS -lz"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   173
    else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   174
      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
   175
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   176
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   177
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   178
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   179
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   180
dnl determine if we should include readline support...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   181
AC_ARG_ENABLE(readline,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   182
[  --enable-readline          use GNU readline in test program [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   183
              , enable_readline=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   184
if test x$enable_readline = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   185
  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
   186
  AC_CHECK_LIB(readline, readline, have_readline_lib=yes, , -lcurses)
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   187
  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
   188
  AC_CHECK_LIB(readline, add_history, have_history_lib=yes, , -lcurses)
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   189
  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
   190
    if test x$have_history_hdr = xyes -a x$have_history_lib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   191
      AC_DEFINE(PHYSFS_HAVE_READLINE)
218
9415dcace296 readline detection fixes by Edward Rudd.
Ryan C. Gordon <icculus@icculus.org>
parents: 216
diff changeset
   192
      LIBS="$LIBS -lreadline -lcurses"
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   193
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   194
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   195
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   196
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   197
dnl AC_CHECK_HEADER(be/kernel/OS.h, this_is_beos=yes)
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   198
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
   199
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
   200
  this_is_beos=yes
234
2710ee66a482 BeOS support.
Ryan C. Gordon <icculus@icculus.org>
parents: 231
diff changeset
   201
  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
   202
else
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   203
  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
   204
fi
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   205
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   206
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
   207
310
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   208
AC_MSG_CHECKING([if this is Cygwin])
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   209
if test x$build_os = xcygwin; then
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   210
  this_is_cygwin=yes
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   211
  CFLAGS="$CFLAGS -DWIN32"
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   212
else
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   213
  this_is_cygwin=no
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   214
fi
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   215
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   216
AC_MSG_RESULT([$this_is_cygwin])
f8bca4a93fd5 Patched to compile on Cygwin.
Ryan C. Gordon <icculus@icculus.org>
parents: 307
diff changeset
   217
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   218
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
   219
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
   220
  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
   221
  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
   222
  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
   223
    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
   224
  fi
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   225
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   226
  AC_MSG_RESULT([$this_is_macosx])
234
2710ee66a482 BeOS support.
Ryan C. Gordon <icculus@icculus.org>
parents: 231
diff changeset
   227
fi
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   228
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   229
# Checks for header files.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   230
AC_HEADER_STDC
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   231
AC_CHECK_HEADERS([stdlib.h string.h])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   232
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   233
# 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
   234
dnl AC_C_CONST
d41c0a399a99 Removed some unnecessary things that broke BeOS builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 261
diff changeset
   235
dnl AC_TYPE_SIZE_T
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   236
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   237
# Checks for library functions.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   238
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   239
# This is only in the bleeding edge autoconf distro...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   240
#AC_FUNC_MALLOC
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   241
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   242
AC_FUNC_MEMCMP
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   243
AC_CHECK_FUNCS([memset strrchr])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   244
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   245
dnl Add Makefile conditionals
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   246
AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   247
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
   248
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
   249
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
   250
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
   251
289
a0bca1a03a54 Can now build shared libraries under BeOS, and probably Cygwin, too.
Ryan C. Gordon <icculus@icculus.org>
parents: 285
diff changeset
   252
LDFLAGS="$LDFLAGS -no-undefined"
a0bca1a03a54 Can now build shared libraries under BeOS, and probably Cygwin, too.
Ryan C. Gordon <icculus@icculus.org>
parents: 285
diff changeset
   253
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   254
AC_OUTPUT([
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   255
Makefile
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   256
archivers/Makefile
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   257
platform/Makefile
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   258
zlib114/Makefile
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   259
test/Makefile
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   260
extras/Makefile
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   261
])
231
e4f81b0f1c93 Corrected to fix "make dist".
Ryan C. Gordon <icculus@icculus.org>
parents: 224
diff changeset
   262
296
32658d27c62f Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents: 289
diff changeset
   263
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
   264