]> Cypherpunks repositories - keks.git/commitdiff
Generate .pc
authorSergey Matveev <stargrave@stargrave.org>
Sun, 29 Jun 2025 07:18:09 +0000 (10:18 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 29 Jun 2025 07:18:09 +0000 (10:18 +0300)
c/conf/.gitignore [new file with mode: 0644]
c/conf/version.do [new file with mode: 0644]
c/lib/.gitignore
c/lib/clean
c/lib/install.do
c/lib/keks.pc.do [new file with mode: 0644]

diff --git a/c/conf/.gitignore b/c/conf/.gitignore
new file mode 100644 (file)
index 0000000..ffcde75
--- /dev/null
@@ -0,0 +1 @@
+/version
diff --git a/c/conf/version.do b/c/conf/version.do
new file mode 100644 (file)
index 0000000..26420c9
--- /dev/null
@@ -0,0 +1,8 @@
+v=../../VERSION
+if [ -s $v ] ; then
+    redo-ifchange $v
+    cat $v
+else
+    redo-ifcreate $v
+    echo unknown
+fi
index c0812035efd664ff57ccdc95b94199e476741321638e8c4f06a16ae42bd76f37..1ff176cfa0763f872e6432676441ff3c1f93335556b5bbe3a6c25e8deac840de 100644 (file)
@@ -1,3 +1,4 @@
 /*.o
 /compile_flags.txt
+/keks.pc
 /libkeks.a
index e633c5a199d24a9f603ef2be85e1e9c5e8bbdc7dfbdd7f5dad3c985812d242a8..bcbe772175017efc7a28e0de1169d9898ffeedc29d2657515de26292a1b1dd6a 100755 (executable)
@@ -2,4 +2,4 @@
 
 cd "$(dirname "$(realpath -- "$0")")"
 cm/clean
-exec rm -f *.o *.a compile_flags.txt
+exec rm -f *.o *.a compile_flags.txt keks.pc
index a24b1077d789eb50e312ba2df324f497c854b92353726a67eb705e55531bdfc9..1dfc28327e4ad04b2eb554d4c3f6507b7d6d5cd7a6db709285e9021e407236b9 100644 (file)
@@ -1,4 +1,4 @@
-redo-ifchange *.h libkeks.a ../conf/prefix
+redo-ifchange *.h libkeks.a keks.pc ../conf/prefix
 read PREFIX <../conf/prefix
 mkdir -p $PREFIX/include/keks $PREFIX/lib
 cp -f *.h $PREFIX/include/keks
diff --git a/c/lib/keks.pc.do b/c/lib/keks.pc.do
new file mode 100644 (file)
index 0000000..78d02a9
--- /dev/null
@@ -0,0 +1,17 @@
+redo-ifchange ../conf/prefix ../conf/version
+read PREFIX <../conf/prefix
+read VERSION <../conf/version
+perl -npe "s/ +/ /g ; s/ +$//" <<EOF
+prefix=$PREFIX
+exec_prefix=\${prefix}
+includedir=\${prefix}/include
+libdir=\${exec_prefix}/lib
+
+Name: keks
+Description: KEKS codec
+Version: $VERSION
+Requires:
+Cflags: -I\${includedir}
+Libs: -L\${libdir} -lkeks
+EOF
+