File: modify-install-paths

package info (click to toggle)
ghdl 2.0.0%2Bdfsg-6.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 72,852 kB
  • sloc: ada: 238,924; vhdl: 196,551; ansic: 24,457; python: 17,483; sh: 11,399; cpp: 2,283; makefile: 1,440; pascal: 516; exp: 40; asm: 25
file content (196 lines) | stat: -rw-r--r-- 8,196 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
Description: Patch installation paths for Debian packaging
Author: Andreas Bombe <aeb@debian.org>
Forwarded: not-needed
Last-Update: 2022-11-26
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Makefile.in
+++ b/Makefile.in
@@ -27,6 +27,7 @@
 backend=@backend@
 libdirsuffix=@libdirsuffix@
 libdirreverse=@libdirreverse@
+incdirsuffix=@incdirsuffix@
 EXEEXT=@EXEEXT@
 SOEXT=@SOEXT@
 PIC_FLAGS=@PIC_FLAGS@
@@ -49,8 +50,8 @@
 PWD=$(CURDIR)
 DESTDIR=
 bindir=$(prefix)/bin
-libdir=$(prefix)/lib
-incdir=$(prefix)/include
+libdir=$(prefix)/$(libdirsuffix)
+incdir=$(prefix)/$(incdirsuffix)
 MKDIR=mkdir
 LN=ln -s
 CP=cp
@@ -59,7 +60,7 @@
 GRT_RANLIB=ranlib
 GHDL_DESC?=tarball
 
-VHDL_LIB_DIR=$(prefix)/$(libdirsuffix)
+VHDL_LIB_DIR=$(prefix)/$(libdirsuffix)/vhdl
 
 ifeq "$(enable_checks)" "true"
  # Debug + checks
@@ -137,9 +138,9 @@
 
 install: install.$(backend) install.vhdllib install.vpi install.libghdl install.ghw
 #       Generate std.standard package VHDL source
-	$(DESTDIR)$(bindir)/ghdl$(EXEEXT) --disp-standard --std=87 > $(DESTDIR)$(VHDL_LIB_DIR)/src/std/v87/standard.vhdl
-	$(DESTDIR)$(bindir)/ghdl$(EXEEXT) --disp-standard --std=93 > $(DESTDIR)$(VHDL_LIB_DIR)/src/std/v93/standard.vhdl
-	$(DESTDIR)$(bindir)/ghdl$(EXEEXT) --disp-standard --std=08 > $(DESTDIR)$(VHDL_LIB_DIR)/src/std/v08/standard.vhdl
+	$(DESTDIR)$(bindir)/ghdl-$(backend)$(EXEEXT) --disp-standard --std=87 > $(DESTDIR)$(VHDL_LIB_DIR)/src/std/v87/standard.vhdl
+	$(DESTDIR)$(bindir)/ghdl-$(backend)$(EXEEXT) --disp-standard --std=93 > $(DESTDIR)$(VHDL_LIB_DIR)/src/std/v93/standard.vhdl
+	$(DESTDIR)$(bindir)/ghdl-$(backend)$(EXEEXT) --disp-standard --std=08 > $(DESTDIR)$(VHDL_LIB_DIR)/src/std/v08/standard.vhdl
 
 uninstall: uninstall.$(backend) uninstall.vhdllib uninstall.vpi uninstall.libghdl uninstall.ghw
 
@@ -210,7 +211,7 @@
 	$(MAKE) -f $(srcdir)/libraries/Makefile.inc $(LIBVHDL_FLAGS_TO_PASS) GHDL=$(PWD)/ghdl_mcode$(EXEEXT) GHDL_FLAGS="" VHDL_COPY_OBJS=no vhdl.libs.all
 
 install.mcode.program: install.dirs ghdl_mcode$(EXEEXT)
-	$(INSTALL_PROGRAM) ghdl_mcode$(EXEEXT) $(DESTDIR)$(bindir)/ghdl$(EXEEXT)
+	$(INSTALL_PROGRAM) ghdl_mcode$(EXEEXT) $(DESTDIR)$(bindir)/ghdl-mcode$(EXEEXT)
 
 uninstall.mcode.program:
 	$(RM) $(DESTDIR)$(bindir)/ghdl$(EXEEXT)
@@ -385,8 +386,8 @@
 	 LLVM_CONFIG="$(LLVM_CONFIG)" CXX="$(CXX)"
 
 install.llvm.program: install.dirs ghdl1-llvm$(EXEEXT) ghdl_llvm$(EXEEXT)
-	$(INSTALL_PROGRAM) ghdl_llvm$(EXEEXT) $(DESTDIR)$(bindir)/ghdl$(EXEEXT)
-	$(INSTALL_PROGRAM) ghdl1-llvm$(EXEEXT) $(DESTDIR)$(bindir)/ghdl1-llvm$(EXEEXT)
+	$(INSTALL_PROGRAM) ghdl_llvm$(EXEEXT) $(DESTDIR)$(bindir)/ghdl-llvm$(EXEEXT)
+	$(INSTALL_PROGRAM) ghdl1-llvm$(EXEEXT) $(DESTDIR)$(libdir)/ghdl1-llvm$(EXEEXT)
 
 test.llvm: ghdl_llvm$(EXEEXT)
 	cd $(srcdir)/testsuite; GHDL=$(CURDIR)/ghdl_llvm$(EXEEXT) ./testsuite.sh
@@ -594,6 +595,7 @@
 	$(MKDIR) -p $(DESTDIR)$(bindir)
 	$(MKDIR) -p $(DESTDIR)$(libdir)
 	$(MKDIR) -p $(DESTDIR)$(prefix)/$(libdirsuffix)
+	$(MKDIR) -p $(DESTDIR)$(prefix)/$(libdirsuffix)/vhdl
 	$(MKDIR) -p $(DESTDIR)$(incdir)
 	$(MKDIR) -p $(DESTDIR)$(incdir)/ghdl
 
--- a/configure
+++ b/configure
@@ -34,6 +34,7 @@
 LDFLAGS=${LDFLAGS:-}
 prefix=/usr/local
 libdirsuffix=lib/ghdl
+incdirsuffix=include
 libdirreverse=../..
 gcc_src_dir=
 llvm_config=
@@ -54,7 +55,7 @@
 show_help=no
 progname=$0
 
-subst_vars="CC CXX GNATMAKE ADA_FLAGS MAKE CFLAGS CXXFLAGS LDFLAGS build srcdir abs_srcdir prefix backend libdirsuffix libdirreverse gcc_src_dir llvm_config llvm_be backtrace_lib build_mode EXEEXT SOEXT PIC_FLAGS default_pic enable_werror enable_checks enable_gplcompat enable_libghdl libghdl_version ghdl_version"
+subst_vars="CC CXX GNATMAKE ADA_FLAGS MAKE CFLAGS CXXFLAGS LDFLAGS build srcdir abs_srcdir prefix backend libdirsuffix libdirreverse incdirsuffix gcc_src_dir llvm_config llvm_be backtrace_lib build_mode EXEEXT SOEXT PIC_FLAGS default_pic enable_werror enable_checks enable_gplcompat enable_libghdl libghdl_version ghdl_version"
 
 # Find srcdir
 srcdir=`dirname $progname`
@@ -93,6 +94,8 @@
       ;;
     --prefix=*)             prefix="$optarg";;
     --srcdir=*)             srcdir="$optarg";;
+    --libdir=*)             libdirsuffix="$optarg";;
+    --incdir=*)             incdirsuffix="$optarg";;
     --with-gcc=*)           gcc_src_dir="$optarg";     backend=gcc;;
     --with-llvm=*)
       echo "--with-llvm is deprecated, use --with-llvm-config"
@@ -128,6 +131,8 @@
 Options [defaults in brackets]:
   --prefix=PREFIX             install in PREFIX [$prefix]
   --srcdir=SRCDIR             source code path [$srcdir]
+  --libdir=LIBDIR             lib dir path relative to PREFIX [$libdirsuffix]
+  --incdir=INCDIR             C include dir path relative to PREFIX [$incdirsuffix]
   --with-gcc=DIR              use gcc backend from DIR
   --with-llvm-config[=LLVM-CONFIG]  use llvm backend [llvm-config]
   --with-backtrace-lib=LIB.a  link with libbacktrace LIB.a to display a
@@ -410,10 +415,11 @@
 sed -e "s%@COMPILER_GCC@%ghdl1-gcc$EXEEXT%" \
     -e "s%@COMPILER_DEBUG@%ghdl1-debug$EXEEXT%" \
     -e "s%@COMPILER_MCODE@%ghdl1-mcode$EXEEXT%" \
-    -e "s%@COMPILER_LLVM@%ghdl1-llvm$EXEEXT%" \
+    -e "s%@COMPILER_LLVM@%lib/ghdl/llvm/ghdl1-llvm$EXEEXT%" \
     -e "s%@POST_PROCESSOR@%oread-$backend%" \
     -e "s%@INSTALL_PREFIX@%$prefix%" \
     -e "s%@LIB_PREFIX@%$libdirsuffix%" \
+    -e "s%@INC_PREFIX@%$incdirsuffix%" \
     -e "s%@SOEXT@%$SOEXT%" \
     -e "s%@default_pic@%$default_pic%" \
     < $srcdir/src/ghdldrv/default_paths.ads.in > default_paths.ads
--- a/scripts/gcc/Make-lang.in
+++ b/scripts/gcc/Make-lang.in
@@ -104,7 +104,9 @@
 	echo "   Compiler_Llvm  : constant String := \"\";" >> tmp-dpaths.ads
 	echo "   Post_Processor : constant String := \"\";" >> tmp-dpaths.ads
 	echo "   Lib_Prefix     : constant String :=">> tmp-dpaths.ads
-	echo "     \"lib/ghdl\";" >> tmp-dpaths.ads
+	echo "     \"lib/ghdl/gcc\";" >> tmp-dpaths.ads
+	echo "   Inc_Prefix     : constant String :=" >> tmp-dpaths.ads
+	echo "     \"lib/ghdl/include\";" >> tmp-dpaths.ads
 	echo "   Shared_Library_Extension : constant String :=">> tmp-dpaths.ads
 	echo "     \"$(VHDL_SOEXT)\";" >> tmp-dpaths.ads
 	echo "   Default_Pie : constant Boolean := False;" >> tmp-dpaths.ads
@@ -159,8 +161,8 @@
 # Install the driver program as ghdl.
 vhdl.install-common: ghdl$(exeext) ghdl1$(exeext)
 	-mkdir $(DESTDIR)$(bindir)
-	-$(RM) $(DESTDIR)$(bindir)/ghdl$(exeext)
-	$(INSTALL_PROGRAM) ghdl$(exeext) $(DESTDIR)$(bindir)/ghdl$(exeext)
+	-$(RM) $(DESTDIR)$(bindir)/ghdl-gcc$(exeext)
+	$(INSTALL_PROGRAM) ghdl$(exeext) $(DESTDIR)$(bindir)/ghdl-gcc$(exeext)
 	-mkdir $(DESTDIR)$(libdir)
 	-mkdir $(DESTDIR)$(libdir)/ghdl
 	$(INSTALL_DATA) ../libbacktrace/.libs/libbacktrace.a $(DESTDIR)$(libdir)/ghdl
--- a/src/ghdldrv/default_paths.ads.in
+++ b/src/ghdldrv/default_paths.ads.in
@@ -23,6 +23,8 @@
      "@INSTALL_PREFIX@";
    Lib_Prefix : constant String :=
      "@LIB_PREFIX@";
+   Inc_Prefix : constant String :=
+     "@INC_PREFIX@";
 
    Compiler_Gcc : constant String :=
      "@COMPILER_GCC@";
--- a/src/ghdldrv/ghdllocal.adb
+++ b/src/ghdldrv/ghdllocal.adb
@@ -373,9 +373,9 @@
    function Get_Machine_Path_Prefix return String is
    begin
       if Flag_32bit then
-         return Lib_Prefix_Path.all & "32";
+         return Lib_Prefix_Path.all & "32" & Directory_Separator & "vhdl";
       else
-         return Lib_Prefix_Path.all;
+         return Lib_Prefix_Path.all & Directory_Separator & "vhdl";
       end if;
    end Get_Machine_Path_Prefix;
 
--- a/src/ghdldrv/ghdlvpi.adb
+++ b/src/ghdldrv/ghdlvpi.adb
@@ -38,7 +38,7 @@
       Ghdllocal.Set_Exec_Prefix_From_Program_Name;
 
       return Ghdllocal.Exec_Prefix.all
-        & Directory_Separator & "include"
+        & Directory_Separator & Inc_Prefix
         & Directory_Separator & "ghdl";
    end Get_Vpi_Include_Dir;
 
@@ -50,7 +50,7 @@
          Ghdllocal.Set_Exec_Prefix_From_Program_Name;
       end if;
 
-      return Ghdllocal.Exec_Prefix.all & Directory_Separator & "lib";
+      return Ghdllocal.Exec_Prefix.all & Directory_Separator & Lib_Prefix;
    end Get_Vpi_Lib_Dir;
 
    --  Return the lib directory, but unixify the path (for a unix shell in