Browse Source

some changes to prepare 1.8 and VS2015 support

also move vstudio specific cpuminer-config.h in compat/
master
Tanguy Pruvot 9 years ago
parent
commit
a7905e6802
  1. 4
      .gitignore
  2. 2
      Makefile.am
  3. 4
      ccminer.cpp
  4. 14
      ccminer.vcxproj
  5. 9
      ccminer.vcxproj.filters
  6. 11
      compat.h
  7. 18
      compat/ccminer-config.h
  8. 3
      compat/jansson/jansson_config.h
  9. 4
      compat/pthreads/pthread.h
  10. 4
      configure.ac
  11. 2
      miner.h
  12. 8
      res/ccminer.rc
  13. 1
      sph/sha2.c
  14. 2
      util.cpp

4
.gitignore vendored

@ -15,7 +15,7 @@ depcomp
missing missing
install-sh install-sh
stamp-h1 stamp-h1
cpuminer-config.h* ccminer-config.h*
compile compile
config.log config.log
config.status config.status
@ -41,6 +41,8 @@ x64/Release/
*.opensdf *.opensdf
*.sdf *.sdf
*.pdb *.pdb
*.VC.opendb
*.VC.db
.settings/ .settings/
.project .project

2
Makefile.am

@ -9,7 +9,7 @@ endif
EXTRA_DIST = autogen.sh README.md README.txt LICENSE.txt \ EXTRA_DIST = autogen.sh README.md README.txt LICENSE.txt \
ccminer.sln ccminer.vcxproj ccminer.vcxproj.filters \ ccminer.sln ccminer.vcxproj ccminer.vcxproj.filters \
compat/gettimeofday.c compat/getopt/getopt_long.c cpuminer-config.h.in compat/gettimeofday.c compat/getopt/getopt_long.c
SUBDIRS = compat SUBDIRS = compat

4
ccminer.cpp

@ -9,7 +9,7 @@
* any later version. See COPYING for more details. * any later version. See COPYING for more details.
*/ */
#include "cpuminer-config.h" #include <ccminer-config.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -3244,7 +3244,7 @@ int main(int argc, char *argv[])
printf("*** ccminer " PACKAGE_VERSION " for nVidia GPUs by tpruvot@github ***\n"); printf("*** ccminer " PACKAGE_VERSION " for nVidia GPUs by tpruvot@github ***\n");
#ifdef _MSC_VER #ifdef _MSC_VER
printf(" Built with VC++ 2013 and nVidia CUDA SDK %d.%d\n\n", printf(" Built with VC++ %d and nVidia CUDA SDK %d.%d\n\n", msver(),
#else #else
printf(" Built with the nVidia CUDA Toolkit %d.%d\n\n", printf(" Built with the nVidia CUDA Toolkit %d.%d\n\n",
#endif #endif

14
ccminer.vcxproj

@ -23,22 +23,19 @@
<RootNamespace>ccminer</RootNamespace> <RootNamespace>ccminer</RootNamespace>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset> <PlatformToolset>v120</PlatformToolset>
<CLRSupport>false</CLRSupport> <CLRSupport>false</CLRSupport>
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<CLRSupport>false</CLRSupport>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" Condition="'$(Platform)'=='Win32'"> <ImportGroup Label="ExtensionSettings" Condition="'$(Platform)'=='Win32'">
@ -227,6 +224,7 @@
<ClCompile Include="compat\jansson\strconv.c" /> <ClCompile Include="compat\jansson\strconv.c" />
<ClCompile Include="compat\jansson\utf.c" /> <ClCompile Include="compat\jansson\utf.c" />
<ClCompile Include="compat\jansson\value.c" /> <ClCompile Include="compat\jansson\value.c" />
<ClInclude Include="compat\pthreads\pthread.h" />
<ClCompile Include="compat\winansi.c" /> <ClCompile Include="compat\winansi.c" />
<ClCompile Include="ccminer.cpp"> <ClCompile Include="ccminer.cpp">
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
@ -310,7 +308,7 @@
<ClInclude Include="compat\sys\time.h" /> <ClInclude Include="compat\sys\time.h" />
<ClInclude Include="compat\unistd.h" /> <ClInclude Include="compat\unistd.h" />
<ClInclude Include="compat\winansi.h" /> <ClInclude Include="compat\winansi.h" />
<ClInclude Include="cpuminer-config.h" /> <ClInclude Include="compat\ccminer-config.h" />
<ClInclude Include="cuda_groestlcoin.h" /> <ClInclude Include="cuda_groestlcoin.h" />
<ClInclude Include="cuda_helper.h" /> <ClInclude Include="cuda_helper.h" />
<ClInclude Include="cuda_vector_uint2x4.h" /> <ClInclude Include="cuda_vector_uint2x4.h" />

9
ccminer.vcxproj.filters

@ -219,6 +219,9 @@
<ClCompile Include="compat\jansson\error.c"> <ClCompile Include="compat\jansson\error.c">
<Filter>Source Files\jansson</Filter> <Filter>Source Files\jansson</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="compat\pthreads\pthread.h">
<Filter>Header Files\compat</Filter>
</ClInclude>
<ClCompile Include="lyra2\Lyra2.c"> <ClCompile Include="lyra2\Lyra2.c">
<Filter>Source Files\sph</Filter> <Filter>Source Files\sph</Filter>
</ClCompile> </ClCompile>
@ -267,7 +270,7 @@
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="compat.h"> <ClInclude Include="compat.h">
<Filter>Header Files</Filter> <Filter>Header Files\compat</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="elist.h"> <ClInclude Include="elist.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
@ -290,8 +293,8 @@
<ClInclude Include="compat\stdbool.h"> <ClInclude Include="compat\stdbool.h">
<Filter>Header Files\compat</Filter> <Filter>Header Files\compat</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="cpuminer-config.h"> <ClInclude Include="compat\ccminer-config.h">
<Filter>Header Files</Filter> <Filter>Header Files\compat</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="uint256.h"> <ClInclude Include="uint256.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>

11
compat.h

@ -51,6 +51,17 @@ static __inline int setpriority(int which, int who, int prio)
#define strcasecmp(x,y) _stricmp(x,y) #define strcasecmp(x,y) _stricmp(x,y)
typedef int ssize_t; typedef int ssize_t;
__inline int msver(void) {
switch (_MSC_VER) {
case 1500: return 2008;
case 1600: return 2010;
case 1700: return 2012;
case 1800: return 2013;
case 1900: return 2015;
default: return (_MSC_VER/100);
}
}
#include <stdlib.h> #include <stdlib.h>
static __inline char * dirname(char *file) { static __inline char * dirname(char *file) {
char buffer[_MAX_PATH] = { 0 }; char buffer[_MAX_PATH] = { 0 };

18
cpuminer-config.h → compat/ccminer-config.h

@ -1,5 +1,4 @@
/* cpuminer-config.h. Generated from cpuminer-config.h.in by configure. */ /* CONFIG ONLY FOR MS VC++ BUILD */
/* cpuminer-config.h.in. Generated from configure.ac by autoheader. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems. systems. This function is required for `alloca.c' support on those systems.
@ -161,17 +160,11 @@
/* Define to the full name of this package. */ /* Define to the full name of this package. */
#define PACKAGE_NAME "ccminer" #define PACKAGE_NAME "ccminer"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "ccminer 1.7.6"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "ccminer"
/* Define to the home page for this package. */ /* Define to the home page for this package. */
#define PACKAGE_URL "http://github.com/tpruvot/ccminer" #define PACKAGE_URL "http://github.com/tpruvot/ccminer"
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "1.7.6" #define PACKAGE_VERSION "1.8-dev"
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
@ -184,11 +177,12 @@
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Version number of package */
#define VERSION "1.7.6"
/* Define curl_free() as free() if our version of curl lacks curl_free. */ /* Define curl_free() as free() if our version of curl lacks curl_free. */
/* #undef curl_free */ /* #undef curl_free */
/* Define to `unsigned int' if <sys/types.h> does not define. */ /* Define to `unsigned int' if <sys/types.h> does not define. */
//#define size_t unsigned int //#define size_t unsigned int
#if !defined(HAVE_STRUCT_TIMESPEC) && _MSC_VER >= 1900
#define HAVE_STRUCT_TIMESPEC
#endif

3
compat/jansson/jansson_config.h

@ -23,6 +23,9 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#define inline __inline #define inline __inline
#if !defined(HAVE_STRUCT_TIMESPEC) && _MSC_VER >= 1900
#define HAVE_STRUCT_TIMESPEC
#endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

4
compat/pthreads/pthread.h

@ -37,6 +37,10 @@
#if !defined( PTHREAD_H ) #if !defined( PTHREAD_H )
#define PTHREAD_H #define PTHREAD_H
#if !defined(HAVE_STRUCT_TIMESPEC) && _MSC_VER >= 1900
#define HAVE_STRUCT_TIMESPEC
#endif
/* /*
* See the README file for an explanation of the pthreads-win32 version * See the README file for an explanation of the pthreads-win32 version
* numbering scheme and how the DLL is named etc. * numbering scheme and how the DLL is named etc.

4
configure.ac

@ -1,10 +1,10 @@
AC_INIT([ccminer], [1.7.6], [], [ccminer], [http://github.com/tpruvot/ccminer]) AC_INIT([ccminer], [1.8-dev], [], [ccminer], [http://github.com/tpruvot/ccminer])
AC_PREREQ([2.59c]) AC_PREREQ([2.59c])
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([ccminer.cpp]) AC_CONFIG_SRCDIR([ccminer.cpp])
AM_INIT_AUTOMAKE([foreign subdir-objects]) AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_HEADERS([cpuminer-config.h]) AC_CONFIG_HEADERS([ccminer-config.h])
dnl Make sure anyone changing configure.ac/Makefile.am has a clue dnl Make sure anyone changing configure.ac/Makefile.am has a clue
AM_MAINTAINER_MODE AM_MAINTAINER_MODE

2
miner.h

@ -5,7 +5,7 @@
extern "C" { extern "C" {
#endif #endif
#include "cpuminer-config.h" #include <ccminer-config.h>
#include <stdbool.h> #include <stdbool.h>
#include <inttypes.h> #include <inttypes.h>

8
res/ccminer.rc

@ -60,8 +60,8 @@ IDI_ICON1 ICON "ccminer.ico"
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,7,6,0 FILEVERSION 1,8,0,0
PRODUCTVERSION 1,7,6,0 PRODUCTVERSION 1,8,0,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x21L FILEFLAGS 0x21L
@ -76,10 +76,10 @@ BEGIN
BEGIN BEGIN
BLOCK "040904e4" BLOCK "040904e4"
BEGIN BEGIN
VALUE "FileVersion", "1.7.6" VALUE "FileVersion", "1.8.rc"
VALUE "LegalCopyright", "Copyright (C) 2016" VALUE "LegalCopyright", "Copyright (C) 2016"
VALUE "ProductName", "ccminer" VALUE "ProductName", "ccminer"
VALUE "ProductVersion", "1.7.6" VALUE "ProductVersion", "1.8.rc"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

1
sph/sha2.c

@ -8,7 +8,6 @@
* any later version. See COPYING for more details. * any later version. See COPYING for more details.
*/ */
#include "cpuminer-config.h"
#include "miner.h" #include "miner.h"
#include <string.h> #include <string.h>

2
util.cpp

@ -10,7 +10,7 @@
*/ */
//#define _GNU_SOURCE //#define _GNU_SOURCE
#include "cpuminer-config.h" #include <ccminer-config.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

Loading…
Cancel
Save