summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2021-02-21 16:24:55 +0100
committerRoland Reichwein <mail@reichwein.it>2021-02-21 16:24:55 +0100
commitd30580c14316885e30e0de6a2c365f5623c2dc7f (patch)
tree17f4b5efa3efdcb272dcb920d9b6c9ef0440080c
parent5b951a8fd1b380daab4f9e470425236f70ac0c8f (diff)
Separate libfft0 from libfft-dev
-rw-r--r--Makefile29
-rw-r--r--debian/changelog2
-rw-r--r--debian/control16
-rw-r--r--debian/copyright2
-rw-r--r--debian/libfft-dev.install2
-rw-r--r--debian/libfft0.install2
-rw-r--r--fft.cpp3
7 files changed, 47 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index bba1d16..c414123 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ CXXFLAGS=-O2 -DNDEBUG
endif
CXXFLAGS+=-stdlib=libc++
CXXFLAGS+=-Wall
-CXXFLAGS+=-std=c++17 -fexceptions -Iexternal
+CXXFLAGS+=-std=c++17 -fexceptions -Iexternal -fPIC
#-march=native -mtune=native # is not better for llvm
CC=clang
CFLAGS=-Wall -O2 -Iexternal
@@ -22,7 +22,21 @@ CFLAGS=-Wall -O2 -Iexternal
DESTDIR=/
PREFIX=/usr/bin
-all: tunerdemo testsuite
+SONAME1=libfft.so
+SONAME2=libfft.so.0
+SONAME3=libfft.so.0.0.0
+
+all: staticlib sharedlib tunerdemo testsuite
+
+staticlib: fft.a
+
+fft.a: fft.o util.o
+ ar rcs $@ $^
+
+sharedlib: $(SONAME3)
+
+$(SONAME3): fft.o util.o
+ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(SONAME2) -o $@ $^
tunerdemo: audioio.o external/pa_ringbuffer.o util.o fft.o autocorrelation.o tuner.o tunerdemo.o
$(CXX) $(CXXFLAGS) $(PORTAUDIOLIBS) -o $@ $^
@@ -62,8 +76,15 @@ install:
install tunerdemo $(DESTDIR)/$(PREFIX)/tunerdemo
mkdir -p $(DESTDIR)/usr/include
install fft.h $(DESTDIR)/usr/include/fft.h
+ mkdir -p $(DESTDIR)/usr/lib
+ install $(SONAME3) $(DESTDIR)/usr/lib/$(SONAME3)
+ ln -sf $(SONAME3) $(DESTDIR)/usr/lib/$(SONAME2)
+ ln -sf $(SONAME2) $(DESTDIR)/usr/lib/$(SONAME1)
+
+deb:
+ dpkg-buildpackage -us -uc
clean:
- rm -f tunerdemo testsuite *.o external/*.o
+ rm -f tunerdemo testsuite *.o external/*.o $(SONAME1) $(SONAME2) $(SONAME3) *.a
-.PHONY: clean install all test
+.PHONY: clean install all test staticlib sharedlib
diff --git a/debian/changelog b/debian/changelog
index e66003e..8969a9d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,4 +2,4 @@ fft (1.0) unstable; urgency=medium
* First version
- -- Roland Reichwein <mail@reichwein.it> Thu, 20 Jan 2021 18:59:59 +0200
+ -- Roland Reichwein <mail@reichwein.it> Sun, 21 Feb 2021 16:17:08 +0100
diff --git a/debian/control b/debian/control
index 811dcf8..b4091b1 100644
--- a/debian/control
+++ b/debian/control
@@ -11,4 +11,18 @@ Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Homepage: http://www.reichwein.it/unicode/
Description: FFT library for C++
- libfft is a Fast Fourier Transform library for C++. It supports C++17 and C++20.
+ libfft is a Fast Fourier Transform library for C++. It supports C++17 and
+ C++20.
+ .
+ This is the package for developers for compiling code against libfft. It
+ includes the header files and static library.
+
+Package: libfft0
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Homepage: http://www.reichwein.it/unicode/
+Description: FFT library for C++
+ libfft is a Fast Fourier Transform library for C++. It supports C++17 and
+ C++20.
+ .
+ This is the runtime library package including the shared library.
diff --git a/debian/copyright b/debian/copyright
index 850d014..d1dbdca 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -3,3 +3,5 @@ Author: Roland Reichwein <mail@reichwein.it>, 2021
Both upstream source code and Debian packaging is available
under the conditions of CC0 1.0 Universal
https://creativecommons.org/publicdomain/zero/1.0/
+
+I.e. the package is in the public domain, where applicable.
diff --git a/debian/libfft-dev.install b/debian/libfft-dev.install
new file mode 100644
index 0000000..7b868eb
--- /dev/null
+++ b/debian/libfft-dev.install
@@ -0,0 +1,2 @@
+usr/include/fft.h
+usr/lib/libfft.so
diff --git a/debian/libfft0.install b/debian/libfft0.install
new file mode 100644
index 0000000..00c98df
--- /dev/null
+++ b/debian/libfft0.install
@@ -0,0 +1,2 @@
+usr/lib/libfft.so.0
+usr/lib/libfft.so.0.0.0
diff --git a/fft.cpp b/fft.cpp
index 12aeece..c89c3a3 100644
--- a/fft.cpp
+++ b/fft.cpp
@@ -16,9 +16,6 @@
#include <string>
-namespace { // Helper functions
-}
-
RIT::FFT::FFT(int size, bool halfOnly): mSize(size), order(size), expLUT(size/2), mFlagHalfOnly(halfOnly) {
if (!is_power_of_two(size))