configure.in
changeset 459 5fa02060a63f
parent 454 e1353730f8c6
child 461 3340aee8ba50
equal deleted inserted replaced
458:4eb9811905c0 459:5fa02060a63f
    68 AC_ARG_ENABLE(debug,
    68 AC_ARG_ENABLE(debug,
    69 [  --enable-debug             enable debug mode [default=yes]],
    69 [  --enable-debug             enable debug mode [default=yes]],
    70               , enable_debug=yes)
    70               , enable_debug=yes)
    71 if test x$enable_debug = xyes; then
    71 if test x$enable_debug = xyes; then
    72   if test x$ac_cv_prog_cc_g = xyes; then
    72   if test x$ac_cv_prog_cc_g = xyes; then
    73     CFLAGS="-g -O0"
    73     PHYSFSCFLAGS="-g -O0"
    74   else
    74   else
    75     CFLAGS="-O0"
    75     PHYSFSCFLAGS="-O0"
    76   fi
    76   fi
    77   CFLAGS="$CFLAGS -Werror -Wall"
    77   PHYSFSCFLAGS="$PHYSFSCFLAGS -Werror -Wall"
    78   AC_DEFINE([DEBUG], 1, [define if debug build is enabled])
    78   AC_DEFINE([DEBUG], 1, [define if debug build is enabled])
    79   AC_DEFINE([DEBUG_CHATTER], 1, [define if debug chatter is enabled])
    79   AC_DEFINE([DEBUG_CHATTER], 1, [define if debug chatter is enabled])
    80 else
    80 else
    81   CFLAGS="-O2"
    81   PHYSFSCFLAGS="-O2"
    82   AC_DEFINE([NDEBUG], 1, [define if debug build is disabled])
    82   AC_DEFINE([NDEBUG], 1, [define if debug build is disabled])
    83 fi
    83 fi
    84 
    84 
    85 
    85 
    86 dnl ---------------------------------------------------------------------
    86 dnl ---------------------------------------------------------------------
   323 AC_MSG_RESULT([$this_is_beos])
   323 AC_MSG_RESULT([$this_is_beos])
   324 
   324 
   325 AC_MSG_CHECKING([if this is Cygwin])
   325 AC_MSG_CHECKING([if this is Cygwin])
   326 if test x$build_os = xcygwin; then
   326 if test x$build_os = xcygwin; then
   327   this_is_cygwin=yes
   327   this_is_cygwin=yes
   328   CFLAGS="$CFLAGS -DWIN32"
   328   PHYSFSCFLAGS="$PHYSFSCFLAGS -DWIN32"
   329   enable_pthreads=no
   329   enable_pthreads=no
   330   have_non_posix_threads=yes
   330   have_non_posix_threads=yes
   331 else
   331 else
   332   this_is_cygwin=no
   332   this_is_cygwin=no
   333 fi
   333 fi
   349 if test x$we_have_sed = xyes; then
   349 if test x$we_have_sed = xyes; then
   350   AC_MSG_CHECKING([if this is FreeBSD])
   350   AC_MSG_CHECKING([if this is FreeBSD])
   351   x=`echo $build_os |tr A-Z a-z |sed "s/.*freebsd.*/freebsd/"`
   351   x=`echo $build_os |tr A-Z a-z |sed "s/.*freebsd.*/freebsd/"`
   352   if test x$x = xfreebsd; then
   352   if test x$x = xfreebsd; then
   353     this_is_freebsd=yes
   353     this_is_freebsd=yes
   354     LDFLAGS="$LDFLAGS -pthread"
   354     PHYSFSLDFLAGS="$PHYSFSLDFLAGS -pthread"
   355   fi
   355   fi
   356 
   356 
   357   AC_MSG_RESULT([$this_is_freebsd])
   357   AC_MSG_RESULT([$this_is_freebsd])
   358 fi
   358 fi
   359 
   359 
   361 if test x$we_have_sed = xyes; then
   361 if test x$we_have_sed = xyes; then
   362   AC_MSG_CHECKING([if this is OpenBSD])
   362   AC_MSG_CHECKING([if this is OpenBSD])
   363   x=`echo $build_os |tr A-Z a-z |sed "s/.*openbsd.*/openbsd/"`
   363   x=`echo $build_os |tr A-Z a-z |sed "s/.*openbsd.*/openbsd/"`
   364   if test x$x = xopenbsd; then
   364   if test x$x = xopenbsd; then
   365     this_is_openbsd=yes
   365     this_is_openbsd=yes
   366     LDFLAGS="$LDFLAGS -pthread"
   366     PHYSFSLDFLAGS="$PHYSFSLDFLAGS -pthread"
   367   fi
   367   fi
   368 
   368 
   369   AC_MSG_RESULT([$this_is_openbsd])
   369   AC_MSG_RESULT([$this_is_openbsd])
   370 fi
   370 fi
   371 
   371 
   386 if test x$we_have_sed = xyes; then
   386 if test x$we_have_sed = xyes; then
   387   AC_MSG_CHECKING([if this is OS/2])
   387   AC_MSG_CHECKING([if this is OS/2])
   388   x=`echo $build_os |tr A-Z a-z |sed "s/.*os2.*/os2/"`
   388   x=`echo $build_os |tr A-Z a-z |sed "s/.*os2.*/os2/"`
   389   if test x$x = xos2; then
   389   if test x$x = xos2; then
   390     this_is_os2=yes
   390     this_is_os2=yes
   391     CFLAGS="$CFLAGS -DOS2"
   391     PHYSFSCFLAGS="$PHYSFSCFLAGS -DOS2"
   392   fi
   392   fi
   393 
   393 
   394   AC_MSG_RESULT([$this_is_os2])
   394   AC_MSG_RESULT([$this_is_os2])
   395 fi
   395 fi
   396 
   396 
   438 AC_FUNC_MEMCMP
   438 AC_FUNC_MEMCMP
   439 AC_CHECK_FUNCS([memset strrchr])
   439 AC_CHECK_FUNCS([memset strrchr])
   440 
   440 
   441 AC_CHECK_SIZEOF(int, 4)
   441 AC_CHECK_SIZEOF(int, 4)
   442 
   442 
   443 CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"
   443 CFLAGS="$CFLAGS $PHYSFSCFLAGS -D_REENTRANT -D_THREAD_SAFE"
   444 LDFLAGS="$LDFLAGS -no-undefined"
   444 LDFLAGS="$LDFLAGS $PHYSFSLDFLAGS -no-undefined"
   445 
   445 
   446 dnl Add Makefile conditionals
   446 dnl Add Makefile conditionals
   447 AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes)
   447 AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes)
   448 AM_CONDITIONAL(BUILD_TEST_PHYSFS, test x$enable_testprog = xyes)
   448 AM_CONDITIONAL(BUILD_TEST_PHYSFS, test x$enable_testprog = xyes)
   449 AM_CONDITIONAL(BUILD_MACOSX, test x$this_is_macosx = xyes)
   449 AM_CONDITIONAL(BUILD_MACOSX, test x$this_is_macosx = xyes)