1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-06 12:04:20 +00:00

Make cgminer look in the install directory for the .cl files making make install work correctly.

This commit is contained in:
Con Kolivas 2011-08-25 13:59:46 +10:00
parent 48180b697b
commit 413d97096d
2 changed files with 17 additions and 3 deletions

View File

@ -163,6 +163,12 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([static int __attribute__((warn_unused_result)
AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1], AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1],
[Define if __attribute__((warn_unused_result))])) [Define if __attribute__((warn_unused_result))]))
if test "x$prefix" = xNONE; then
prefix=/usr
fi
AC_DEFINE_UNQUOTED([CGMINER_PREFIX], ["$prefix/bin/"], [Path to cgminer install])
AC_SUBST(OPENCL_LIBS) AC_SUBST(OPENCL_LIBS)
AC_SUBST(JANSSON_LIBS) AC_SUBST(JANSSON_LIBS)
AC_SUBST(PTHREAD_FLAGS) AC_SUBST(PTHREAD_FLAGS)

12
ocl.c
View File

@ -32,11 +32,19 @@ extern int opt_worksize;
char *file_contents(const char *filename, int *length) char *file_contents(const char *filename, int *length)
{ {
FILE *f = fopen(filename, "rb"); char *fullpath = alloca(strlen(CGMINER_PREFIX) + strlen(filename));
void *buffer; void *buffer;
FILE *f;
strcpy(fullpath, CGMINER_PREFIX);
strcat(fullpath, filename);
f = fopen(filename, "rb");
if (!f)
f = fopen(fullpath, "rb");
if (!f) { if (!f) {
applog(LOG_ERR, "Unable to open %s for reading", filename); applog(LOG_ERR, "Unable to open %s or %s for reading", filename, fullpath);
return NULL; return NULL;
} }