Install pkg-config files for Spike
authorPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>
Wed, 13 May 2015 21:54:24 +0000 (14:54 -0700)
committerPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>
Wed, 13 May 2015 22:18:27 +0000 (15:18 -0700)
The actual Spike package consists of a whole bunch of libraries.  This
installs a pkg-config file for each generated library, and a meta
pkg-config file (riscv-spike.pc) that links in all the other Spike
libraries except dummy_rocc (which I figure isn't interesting).

This allows me to package and install spike, and then use that package
to build an extension library (so I don't have to fork Spike for my
own ISA extension).

Makefile.in
configure.ac
riscv-dummy_rocc.pc.in [new file with mode: 0644]
riscv-hwacha.pc.in [new file with mode: 0644]
riscv-riscv.pc.in [new file with mode: 0644]
riscv-softfloat.pc.in [new file with mode: 0644]
riscv-spike.pc.in [new file with mode: 0644]
riscv-spike_main.pc.in [new file with mode: 0644]

index 1d8d9b251d10b1081bded1476143e9c219209725..4dfc07b769555d7ec1e16aed5d54d5a6319548a4 100644 (file)
@@ -307,6 +307,7 @@ test_outs += $$($(2)_test_outs)
 install_hdrs += $$(addprefix $(src_dir)/$(1)/, $$($(2)_hdrs)) $$($(2)_gen_hdrs)
 install_libs += lib$(1).so
 install_exes += $$($(2)_install_prog_exes)
+install_pcs  += riscv-$(1).pc
 
 endef
 
@@ -358,7 +359,14 @@ install-exes : $(install_exes)
     $(INSTALL_EXE) $$file $(install_exes_dir); \
   done
 
-install : install-hdrs install-libs install-exes
+install-pc : $(install_pcs)
+       $(MKINSTALLDIRS) $(install_libs_dir)/pkgconfig/
+       for file in $^; \
+  do \
+    $(INSTALL_HDR) $$file $(install_libs_dir)/pkgconfig/; \
+  done
+
+install : install-hdrs install-libs install-exes install-pc
 ifeq ($(enable_stow),yes)
        $(MKINSTALLDIRS) $(stow_pkg_dir)
        cd $(stow_pkg_dir) && \
index 03b50484014714aef8293a89858fe6d63ab8666c..d0c26b6a1c2affa7a0c659251f0f060ce1f3418d 100644 (file)
@@ -100,4 +100,10 @@ MCPPBS_SUBPROJECTS([ riscv, hwacha, dummy_rocc, softfloat, spike_main ])
 
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([riscv-spike.pc])
+AC_CONFIG_FILES([riscv-riscv.pc])
+AC_CONFIG_FILES([riscv-hwacha.pc])
+AC_CONFIG_FILES([riscv-softfloat.pc])
+AC_CONFIG_FILES([riscv-dummy_rocc.pc])
+AC_CONFIG_FILES([riscv-spike_main.pc])
 AC_OUTPUT
diff --git a/riscv-dummy_rocc.pc.in b/riscv-dummy_rocc.pc.in
new file mode 100644 (file)
index 0000000..31635f6
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@prefix@
+libdir=${prefix}/@libdir@
+includedir=${prefix}/@includedir@
+
+Name: riscv-dummy_rocc
+Description: Example RISC-V ROCC accelerator
+Version: git
+Libs: -Wl,-rpath,${libdir} -L${libdir} -ldummy_rocc
+Cflags: -I${includedir}
+URL: http://riscv.org/download.html#tab_spike
diff --git a/riscv-hwacha.pc.in b/riscv-hwacha.pc.in
new file mode 100644 (file)
index 0000000..cad4e29
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@prefix@
+libdir=${prefix}/@libdir@
+includedir=${prefix}/@includedir@
+
+Name: riscv-hwacha
+Description: RISC-V Hwacha binary library
+Version: git
+Libs: -Wl,-rpath,${libdir} -L${libdir} -lhwacha
+Cflags: -I${includedir}
+URL: http://riscv.org/download.html#tab_spike
diff --git a/riscv-riscv.pc.in b/riscv-riscv.pc.in
new file mode 100644 (file)
index 0000000..5e86b1c
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@prefix@
+libdir=${prefix}/@libdir@
+includedir=${prefix}/@includedir@
+
+Name: riscv-riscv
+Description: RISC-V 
+Version: git
+Libs: -Wl,-rpath,${libdir} -L${libdir} -lriscv
+Cflags: -I${includedir}
+URL: http://riscv.org/download.html#tab_spike
diff --git a/riscv-softfloat.pc.in b/riscv-softfloat.pc.in
new file mode 100644 (file)
index 0000000..6b18e88
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@prefix@
+libdir=${prefix}/@libdir@
+includedir=${prefix}/@includedir@
+
+Name: riscv-softfloat
+Description: RISC-V softfloat library
+Version: git
+Libs: -Wl,-rpath,${libdir} -L${libdir} -lsoftfloat
+Cflags: -I${includedir}
+URL: http://riscv.org/download.html#tab_spike
diff --git a/riscv-spike.pc.in b/riscv-spike.pc.in
new file mode 100644 (file)
index 0000000..ee2ab99
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@prefix@
+libdir=${prefix}/@libdir@
+includedir=${prefix}/@includedir@
+
+Name: riscv-spike
+Description: RISC-V spike meta library
+Version: git
+Depends: riscv-spike_main riscv-riscv riscv-hwacha riscv-softfloat
+URL: http://riscv.org/download.html#tab_spike
diff --git a/riscv-spike_main.pc.in b/riscv-spike_main.pc.in
new file mode 100644 (file)
index 0000000..14a6f65
--- /dev/null
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@prefix@
+libdir=${prefix}/@libdir@
+includedir=${prefix}/@includedir@
+
+Name: riscv-spike_main
+Description: RISC-V ISA simulator library
+Version: git
+Depends: riscv-riscv riscv-hwacha riscv-softfloat
+Libs: -Wl,-rpath,${libdir} -L${libdir} -lspike_main
+Cflags: -I${includedir}
+URL: http://riscv.org/download.html#tab_spike