Skip to content

Commit

Permalink
don't use pthreads by default
Browse files Browse the repository at this point in the history
  • Loading branch information
esmil committed Apr 11, 2009
1 parent f20dc4e commit 54a650c
Show file tree
Hide file tree
Showing 8 changed files with 451 additions and 454 deletions.
37 changes: 18 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ CFLAGS ?= -O2 -Wall
INSTALL ?= install
PREFIX ?= /usr/local

# Disable multi threading. This will make the program smaller and a tiny
# bit easier on the system. It will make it slower in real time though,
# as we can't read from the harddisk and calculate hashes simultaneously.
#NO_THREADS = 1
# Use multiple POSIX threads for calculating hashes. This should be slightly
# faster. Much faster on systems with multiple CPUs and fast harddrives.
#USE_PTHREADS = 1

# Use the SHA1 implementation in the OpenSSL library
# Use the SHA1 implementation in the OpenSSL library instead of compiling our
# own.
#USE_OPENSSL = 1

# Disable support for long options. Will make the program smaller
# and perhaps even more portable.
# Disable support for long options. Will make the program smaller and perhaps
# even more portable.
#NO_LONG_OPTIONS = 1

# Disable a redundent check to see if the amount of bytes read from files
# while hashing matches the sum of reported file sizes. I've never seen
# this fail. It will fail if you change files yet to be hashed while
# mktorrent is running, but who'd want to do that?
# Disable a redundent check to see if the amount of bytes read from files while
# hashing matches the sum of reported file sizes. I've never seen this fail. It
# will fail if you change files yet to be hashed while mktorrent is running,
# but who'd want to do that?
#NO_HASH_CHECK = 1

# Set the number of microseconds mktorrent will wait between every progress
Expand All @@ -46,12 +46,12 @@ PREFIX ?= /usr/local
#PROGRESS_PERIOD = 200000

# Maximum number of file descriptors mktorrent will open when scanning the
# directory. Default is 100, but I have no idea what a sane default
# for this value is, so your number is probably better.
# directory. Default is 100, but I have no idea what a sane default for this
# value is, so your number is probably better.
#MAX_OPENFD = 100

# Enable leftover debugging code.
# Usually just spams you with lots of useless information.
# Enable leftover debugging code. Usually just spams you with lots of useless
# information.
#DEBUG = 1


Expand All @@ -65,10 +65,9 @@ SRCS := ftw.c init.c sha1.c hash.c output.c main.c
OBJS = $(SRCS:.c=.o)
LIBS :=

ifdef NO_THREADS
DEFINES += -DNO_THREADS
SRCS := $(SRCS:hash.c=simple_hash.c)
else
ifdef USE_PTHREADS
DEFINES += -DUSE_PTHREADS
SRCS := $(SRCS:hash.c=hash_pthreads.c)
LIBS += -lpthread
endif

Expand Down
Loading

0 comments on commit 54a650c

Please sign in to comment.