configure.in
author Ryan C. Gordon <icculus@icculus.org>
Fri, 10 May 2002 09:28:25 +0000
changeset 216 d297da72cd4e
parent 214 19846c18071b
child 218 9415dcace296
permissions -rw-r--r--
--enable-debug is default.
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
214
19846c18071b Initial autoconf support.
Ryan C. Gordon <icculus@icculus.org>
parents: 213
diff changeset
    18
MICRO_VERSION=5
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
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    42
AC_CANONICAL_HOST
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
AC_CANONICAL_TARGET
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    45
dnl Setup for automake
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
AM_CONFIG_HEADER(config.h)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    47
AM_INIT_AUTOMAKE(physfs, $VERSION)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    48
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
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    51
dnl Compilers and other tools
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    52
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    53
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    54
AC_PROG_CC
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    55
AC_PROG_INSTALL
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    56
AC_PROG_LN_S
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    57
AC_PROG_LIBTOOL
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    58
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    59
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    60
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    61
dnl Debug mode?
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    62
dnl ---------------------------------------------------------------------
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
AC_ARG_ENABLE(debug,
216
d297da72cd4e --enable-debug is default.
Ryan C. Gordon <icculus@icculus.org>
parents: 214
diff changeset
    65
[  --enable-debug             enable debug mode [default=yes]],
d297da72cd4e --enable-debug is default.
Ryan C. Gordon <icculus@icculus.org>
parents: 214
diff changeset
    66
              , enable_debug=yes)
213
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    67
if test x$enable_debug = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    68
  if test x$ac_cv_prog_cc_g = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    69
    CFLAGS="-g -O0"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    70
  else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    71
    CFLAGS="-O0"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    72
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    73
  CFLAGS="$CFLAGS -Werror"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    74
  AC_DEFINE(DEBUG)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    75
  AC_DEFINE(DEBUG_CHATTER)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    76
else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    77
  CFLAGS="-O2"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    78
  AC_DEFINE(NDEBUG)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    79
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    80
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    81
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    82
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    83
dnl Build test program?
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    84
dnl ---------------------------------------------------------------------
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
AC_ARG_ENABLE(testprog,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    87
[  --enable-testprog          build test program [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    88
              , enable_testprog=yes)
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
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    91
dnl ---------------------------------------------------------------------
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    92
dnl Checks for libraries.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    93
dnl ---------------------------------------------------------------------
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
require_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    96
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    97
dnl Check for zip archiver inclusion...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    98
AC_ARG_ENABLE(zip,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    99
[  --enable-zip               enable ZIP support [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   100
              , enable_zip=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   101
if test x$enable_zip = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   102
  AC_DEFINE(PHYSFS_SUPPORTS_ZIP)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   103
  require_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   104
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   105
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   106
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   107
dnl Check for zip archiver inclusion...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   108
AC_ARG_ENABLE(grp,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   109
[  --enable-grp               enable Build Engine GRP support [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   110
              , enable_grp=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
if test x$enable_grp = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
  AC_DEFINE(PHYSFS_SUPPORTS_GRP)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   114
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   116
AC_ARG_ENABLE(internal-zlib,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   117
[  --enable-internal-zlib     use included zlib [default=only if needed]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   118
              , enable_internal_zlib=maybe)
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
dnl Check for zlib if needed.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   121
have_external_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   122
if test x$enable_internal_zlib != xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   123
  if test x$require_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   124
    AC_CHECK_HEADER(zlib.h, have_zlib_hdr=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
    AC_CHECK_LIB(z, zlibVersion, have_zlib_lib=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
    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
   127
      have_external_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   128
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   129
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   130
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   131
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   132
AC_MSG_CHECKING([what zlib to use])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   133
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   134
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
   135
if test x$require_zlib = xno; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   136
  enable_internal_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   137
  enable_external_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   138
  AC_MSG_RESULT([no zlib needed])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   139
else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   140
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   141
  if test x$enable_internal_zlib = xmaybe; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   142
    if test x$have_external_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   143
      enable_internal_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   144
      enable_external_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   145
    else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   146
      enable_internal_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   147
      enable_external_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   148
    fi
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
    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
   151
      enable_internal_zlib="no"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   152
      enable_external_zlib="yes"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   153
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   154
  fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   155
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   156
  if test x$enable_internal_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   157
    AC_MSG_RESULT([internal zlib])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   158
  else
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   159
    if test x$enable_external_zlib = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   160
      AC_MSG_RESULT([external zlib])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   161
      LIBS="$LIBS -lz"
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
      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
   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
fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   167
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   168
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   169
dnl !!! FIXME: separate checks for history and readline...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   170
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   171
dnl determine if we should include readline support...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   172
AC_ARG_ENABLE(readline,
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   173
[  --enable-readline          use GNU readline in test program [default=yes]],
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   174
              , enable_readline=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   175
if test x$enable_readline = xyes; then
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   176
  AC_CHECK_HEADER(readline/readline.h, have_readline_hdr=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   177
  AC_CHECK_LIB(readline, readline, have_readline_lib=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   178
  AC_CHECK_HEADER(readline/history.h, have_history_hdr=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   179
  AC_CHECK_LIB(readline, add_history, have_history_lib=yes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   180
  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
   181
    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
   182
      AC_DEFINE(PHYSFS_HAVE_READLINE)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   183
      LIBS="$LIBS -lreadline"
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   184
    fi
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   185
  fi
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
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   188
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   189
# Checks for header files.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   190
AC_HEADER_STDC
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   191
AC_CHECK_HEADERS([stdlib.h string.h])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   192
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   193
# Checks for typedefs, structures, and compiler characteristics.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   194
AC_C_CONST
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   195
AC_TYPE_SIZE_T
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   196
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   197
# Checks for library functions.
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   198
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   199
# This is only in the bleeding edge autoconf distro...
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   200
#AC_FUNC_MALLOC
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   201
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   202
AC_FUNC_MEMCMP
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   203
AC_CHECK_FUNCS([memset strrchr])
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   204
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   205
dnl Add Makefile conditionals
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   206
AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   207
AM_CONDITIONAL(BUILD_TEST_PHYSFS, test x$enable_testprog = xyes)
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   208
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   209
AC_OUTPUT([
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   210
Makefile
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   211
platform/Makefile
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   212
archivers/Makefile
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   213
test/Makefile
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   214
zlib114/Makefile
9e3f734586ac Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   215
])