Fix library soname.

Index: configure
--- configure.orig
+++ configure
@@ -10,6 +10,7 @@
 prefix = '/usr/local'
 clean = True
 darwin = platform.system() == 'Darwin'
+soversion = '0.0'
 
 def hostsanitize(host):
   host = host.split('-')[0]
@@ -43,6 +44,9 @@
   if arg.startswith('--host='):
     host = hostsanitize(arg[7:])
     continue
+  if arg.startswith('--soversion='):
+    soversion = arg[12:]
+    continue
   if arg == '--clean':
     clean = True
     continue
@@ -60,6 +64,7 @@
 echoargs = './configure'
 echoargs += ' --prefix=%s' % prefix
 echoargs += ' --host=%s' % host
+echoargs += ' --soversion=%s' % soversion
 if clean: echoargs += ' --clean'
 if not clean: echoargs += ' --noclean'
 if darwin: echoargs += ' --darwin'
@@ -96,7 +101,7 @@
 # ----- shared-library variations
 
 so = 'dylib' if darwin else 'so'
-so1 = '1.dylib' if darwin else 'so.1'
+so1 = f'so.{soversion}'
 soname = 'install_name' if darwin else 'soname'
 syslibs = '-lm' if darwin else '-lm -lrt'
 
@@ -245,17 +250,11 @@
   f.write(f'chmod 644 package/lib/libcpucycles.{so1}\n')
 os.chmod('build/%s/scripts/sharedlib' % host,0o755)
 
-M = f'package/lib/libcpucycles.{so1}: scripts/sharedlib %s\n' % ' '.join(cpucyclesofiles)
+M = f'package/lib/libcpucycles.so.$(LIBcpucycles_VERSION): scripts/sharedlib %s\n' % ' '.join(cpucyclesofiles)
 M += '\tscripts/sharedlib %s\n' % ' '.join(cpucyclesofiles)
 M += '\n'
 makefile = M + makefile
 
-M = f'package/lib/libcpucycles.{so}: package/lib/libcpucycles.{so1}\n'
-M += f'\trm -f package/lib/libcpucycles.{so}\n'
-M += f'\tln -s libcpucycles.{so1} package/lib/libcpucycles.{so}\n'
-M += '\n'
-makefile = M + makefile
-
 # ----- command
 
 os.makedirs('build/%s/command'%host)
@@ -284,8 +283,8 @@
   M += '\tscripts/compiledefault command %s c -I include\n' % base
   M += '\n'
   makefile = M + makefile
-  M = 'package/bin/%s: command/%s.o%s\n' % (base,base,''.join(' package/lib/%s.%s' % (x,so) for x in libs))
-  M += f'\tcd command && ./link bin/%s %s.o%s {syslibs}\n' % (base,base,''.join(' lib/%s.%s' % (x,so) for x in libs))
+  M = 'package/bin/%s: command/%s.o%s.$(LIBcpucycles_VERSION)\n' % (base,base,''.join(' package/lib/%s.%s' % (x,so) for x in libs))
+  M += f'\tcd command && ./link bin/%s %s.o%s.$(LIBcpucycles_VERSION) {syslibs}\n' % (base,base,''.join(' lib/%s.%s' % (x,so) for x in libs))
   M += '\n'
   makefile = M + makefile
   commands += ['package/bin/%s' % base]
@@ -303,7 +302,7 @@
 
 # ----- make default
 
-M = f'default: package/lib/libcpucycles.a package/lib/libcpucycles.{so} package/lib/libcpucycles.{so1} \\\n'
+M = f'default: package/lib/libcpucycles.a package/lib/libcpucycles.so.$(LIBcpucycles_VERSION) \\\n'
 M += 'commands\n'
 M += '\n'
 makefile = M + makefile
