Can now disable CD-ROM code on Unix systems at build time if need be. The
configure option is not exposed, but the configure script can check this on a system by system basis.
This commit is contained in:
parent
056046f7e3
commit
1ce70462bd
26
configure.in
26
configure.in
|
@ -207,6 +207,13 @@ if test x$enable_readline = xyes; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl determine if we should use the stubbed CD-ROM detection code.
|
||||||
|
dnl AC_ARG_ENABLE(cdrom,
|
||||||
|
dnl [ --enable-cdrom try standard CD-ROM support [default=yes]],
|
||||||
|
dnl , enable_cdrom=yes)
|
||||||
|
enable_cdrom=yes
|
||||||
|
|
||||||
|
|
||||||
dnl AC_CHECK_HEADER(be/kernel/OS.h, this_is_beos=yes)
|
dnl AC_CHECK_HEADER(be/kernel/OS.h, this_is_beos=yes)
|
||||||
AC_MSG_CHECKING([if this is BeOS])
|
AC_MSG_CHECKING([if this is BeOS])
|
||||||
if test x$build_os = xbeos; then
|
if test x$build_os = xbeos; then
|
||||||
|
@ -263,6 +270,25 @@ if test x$we_have_sed = xyes; then
|
||||||
AC_MSG_RESULT([$this_is_openbsd])
|
AC_MSG_RESULT([$this_is_openbsd])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
this_is_atheos=no
|
||||||
|
if test x$we_have_sed = xyes; then
|
||||||
|
AC_MSG_CHECKING([if this is AtheOS])
|
||||||
|
x=`echo $build_os |tr A-Z a-z |sed "s/.*atheos.*/atheos/"`
|
||||||
|
if test x$x = xatheos; then
|
||||||
|
this_is_atheos=yes
|
||||||
|
enable_cdrom=no
|
||||||
|
LDFLAGS="$LDFLAGS -lpthread"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT([$this_is_atheos])
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl Some platform might disable this, so check this down here...
|
||||||
|
if test x$enable_cdrom != xyes; then
|
||||||
|
AC_DEFINE([PHYSFS_NO_CDROM_SUPPORT], 1, [define if we have no CD support])
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS([stdlib.h string.h])
|
AC_CHECK_HEADERS([stdlib.h string.h])
|
||||||
|
|
|
@ -58,6 +58,19 @@ int __PHYSFS_platformDeinit(void)
|
||||||
} /* __PHYSFS_platformDeinit */
|
} /* __PHYSFS_platformDeinit */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef PHYSFS_NO_CDROM_SUPPORT
|
||||||
|
|
||||||
|
/* Stub version for platforms without CD-ROM support. */
|
||||||
|
char **__PHYSFS_platformDetectAvailableCDs(void)
|
||||||
|
{
|
||||||
|
char **retval = (char **) malloc(sizeof (char *));
|
||||||
|
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||||
|
*retval = NULL;
|
||||||
|
return(retval);
|
||||||
|
} /* __PHYSFS_platformDetectAvailableCDs */
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
|
||||||
#ifdef PHYSFS_HAVE_SYS_UCRED_H
|
#ifdef PHYSFS_HAVE_SYS_UCRED_H
|
||||||
|
|
||||||
|
@ -65,20 +78,21 @@ char **__PHYSFS_platformDetectAvailableCDs(void)
|
||||||
{
|
{
|
||||||
char **retval = (char **) malloc(sizeof (char *));
|
char **retval = (char **) malloc(sizeof (char *));
|
||||||
int cd_count = 1; /* We count the NULL entry. */
|
int cd_count = 1; /* We count the NULL entry. */
|
||||||
struct statfs* mntbufp = NULL;
|
struct statfs *mntbufp = NULL;
|
||||||
int mounts;
|
int mounts;
|
||||||
int ii;
|
int i;
|
||||||
|
|
||||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||||
|
|
||||||
mounts = getmntinfo( &mntbufp, MNT_WAIT );
|
mounts = getmntinfo(&mntbufp, MNT_WAIT);
|
||||||
|
|
||||||
for ( ii=0; ii < mounts; ++ii ) {
|
for (i = 0; i < mounts; i++)
|
||||||
|
{
|
||||||
int add_it = 0;
|
int add_it = 0;
|
||||||
|
|
||||||
if ( strcmp( mntbufp[ii].f_fstypename, "iso9660") == 0 )
|
if (strcmp(mntbufp[i].f_fstypename, "iso9660") == 0)
|
||||||
add_it = 1;
|
add_it = 1;
|
||||||
else if ( strcmp( mntbufp[ii].f_fstypename, "cd9660") == 0 )
|
else if (strcmp( mntbufp[i].f_fstypename, "cd9660") == 0)
|
||||||
add_it = 1;
|
add_it = 1;
|
||||||
|
|
||||||
/* add other mount types here */
|
/* add other mount types here */
|
||||||
|
@ -90,15 +104,15 @@ char **__PHYSFS_platformDetectAvailableCDs(void)
|
||||||
{
|
{
|
||||||
retval = tmp;
|
retval = tmp;
|
||||||
retval[cd_count - 1] = (char *)
|
retval[cd_count - 1] = (char *)
|
||||||
malloc(strlen(mntbufp[ii].f_mntonname) + 1);
|
malloc(strlen(mntbufp[i].f_mntonname) + 1);
|
||||||
if (retval[cd_count - 1])
|
if (retval[cd_count - 1])
|
||||||
{
|
{
|
||||||
strcpy(retval[cd_count - 1], mntbufp[ii].f_mntonname);
|
strcpy(retval[cd_count - 1], mntbufp[i].f_mntonname);
|
||||||
cd_count++;
|
cd_count++;
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* if */
|
} /* if */
|
||||||
}
|
} /* for */
|
||||||
|
|
||||||
retval[cd_count - 1] = NULL;
|
retval[cd_count - 1] = NULL;
|
||||||
return(retval);
|
return(retval);
|
||||||
|
@ -154,6 +168,8 @@ char **__PHYSFS_platformDetectAvailableCDs(void)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* !PHYSFS_NO_CDROM_SUPPORT */
|
||||||
|
|
||||||
|
|
||||||
/* this is in posix.c ... */
|
/* this is in posix.c ... */
|
||||||
extern char *__PHYSFS_platformCopyEnvironmentVariable(const char *varname);
|
extern char *__PHYSFS_platformCopyEnvironmentVariable(const char *varname);
|
||||||
|
@ -242,7 +258,7 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
|
||||||
|
|
||||||
PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
|
PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
|
||||||
{
|
{
|
||||||
return((PHYSFS_uint64) ((PHYSFS_uint32) pthread_self()));
|
return((PHYSFS_uint64) pthread_self());
|
||||||
} /* __PHYSFS_platformGetThreadID */
|
} /* __PHYSFS_platformGetThreadID */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue