aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorumarcor <unai.martinezcorral@ehu.eus>2019-04-25 10:26:53 +0200
committertgingold <tgingold@users.noreply.github.com>2019-04-27 18:31:53 +0200
commit50f8a64b05f5c870cd49470078eb1e34248f87d6 (patch)
treece11ea148d8e377fc47f9fa6281b16a63792a2c6
parent8a88fdfc881ba6c57759065bd8fe9ebcaf922e9e (diff)
downloadghdl-50f8a64b05f5c870cd49470078eb1e34248f87d6.tar.gz
ghdl-50f8a64b05f5c870cd49470078eb1e34248f87d6.tar.bz2
ghdl-50f8a64b05f5c870cd49470078eb1e34248f87d6.zip
add configure option to enable default_pie
-rw-r--r--Makefile.in2
-rwxr-xr-xconfigure10
-rwxr-xr-xdist/travis/build.sh42
-rw-r--r--src/ghdldrv/default_paths.ads.in2
4 files changed, 28 insertions, 28 deletions
diff --git a/Makefile.in b/Makefile.in
index 7e6dea689..70ddb2c1c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -80,7 +80,7 @@ OPT_FLAGS+=-fprofile-arcs -ftest-coverage
endif
GNATFLAGS=-gnaty3befhkmr -gnatwa -gnatf $(OPT_FLAGS) $(ADA_FLAGS)
-GRT_FLAGS=$(OPT_FLAGS)
+GRT_FLAGS=$(OPT_FLAGS) $(PIC_FLAGS)
WARN_CFLAGS=-Wall
diff --git a/configure b/configure
index af67d38c2..af9e1ba37 100755
--- a/configure
+++ b/configure
@@ -6,12 +6,12 @@
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version.
-#
+#
# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GHDL; see the file COPYING. If not, write to the Free
# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
@@ -45,6 +45,7 @@ enable_werror=true
enable_checks=true
enable_openieee=unknown
enable_python=false
+default_pie=false
EXEEXT=
SOEXT=.so
PIC_FLAGS=-fPIC
@@ -106,6 +107,7 @@ for opt do
--disable-openieee) enable_openieee=false;;
--enable-python) enable_python=true;;
--disable-python) enable_python=false;;
+ --enable-default-pie) default_pie=true;;
--enable-coverage) build_mode="coverage";;
-h|-help|--help) show_help=yes;;
*)
@@ -279,9 +281,7 @@ libghdl_version=`echo $ghdl_version | sed -e 's/[-.]/_/g'`
# Check if gcc was configured with --enable-default-pie. In that case -fPIC
# should be added.
if gcc -v 2>&1 | grep -q enable-default-pie; then
- default_pie="yes"
-else
- default_pie="no"
+ default_pie="true"
fi
# Create subdirectories
diff --git a/dist/travis/build.sh b/dist/travis/build.sh
index 27fada799..b9c29399d 100755
--- a/dist/travis/build.sh
+++ b/dist/travis/build.sh
@@ -29,9 +29,9 @@ while getopts ":b:p:cg" opt; do
p) PKG_NAME=$OPTARG;;
g) ISGPL=true;;
\?) printf "$ANSI_RED[GHDL - build] Invalid option: -$OPTARG $ANSI_NOCOLOR\n" >&2
- exit 1 ;;
+ exit 1 ;;
:) printf "$ANSI_RED[GHDL - build] Option -$OPTARG requires an argument. $ANSI_NOCOLOR\n" >&2
- exit 1 ;;
+ exit 1 ;;
esac
done
@@ -86,45 +86,45 @@ case "$BLD" in
travis_finish "configure_gcc"
;;
mcode)
- config_opts=""
+ CONFIG_OPTS+=""
CXX=""
;;
llvm)
- CXX="clang"
- config_opts="--with-llvm-config CXX=$CXX"
+ CXX="clang"
+ CONFIG_OPTS+="--with-llvm-config CXX=$CXX"
;;
llvm-3.5)
- CXX="clang++"
- config_opts="--with-llvm-config=llvm-config-3.5 CXX=$CXX"
+ CXX="clang++"
+ CONFIG_OPTS+="--with-llvm-config=llvm-config-3.5 CXX=$CXX"
;;
llvm-3.8)
- CXX="clang++-3.8"
- config_opts="--with-llvm-config=llvm-config-3.8 CXX=$CXX"
+ CXX="clang++-3.8"
+ CONFIG_OPTS+="--with-llvm-config=llvm-config-3.8 CXX=$CXX"
;;
llvm-3.9)
- CXX="clang++-3.9"
- config_opts="--with-llvm-config=llvm-config-3.9 CXX=$CXX"
+ CXX="clang++-3.9"
+ CONFIG_OPTS+="--with-llvm-config=llvm-config-3.9 CXX=$CXX"
;;
llvm-4.0)
- CXX="clang++-4.0"
- config_opts="--with-llvm-config=llvm-config-4.0 CXX=$CXX"
+ CXX="clang++-4.0"
+ CONFIG_OPTS+="--with-llvm-config=llvm-config-4.0 CXX=$CXX"
;;
llvm-5.0)
- CXX="clang++-5.0"
- config_opts="--with-llvm-config=llvm-config-5.0 CXX=$CXX"
+ CXX="clang++-5.0"
+ CONFIG_OPTS+="--with-llvm-config=llvm-config-5.0 CXX=$CXX"
;;
llvm-6.0)
- CXX="clang++-6.0"
- config_opts="--with-llvm-config=llvm-config-6.0 CXX=$CXX"
+ CXX="clang++-6.0"
+ CONFIG_OPTS+="--with-llvm-config=llvm-config-6.0 CXX=$CXX"
;;
*)
- echo "$ANSI_RED[GHDL - build] Unknown build $BLD $ANSI_NOCOLOR"
- exit 1;;
+ echo "$ANSI_RED[GHDL - build] Unknown build $BLD $ANSI_NOCOLOR"
+ exit 1;;
esac
if [ ! "$(echo $BLD | grep gcc)" ]; then
- echo "../configure --prefix=$prefix $config_opts"
- ../configure "--prefix=$prefix" $config_opts
+ echo "../configure --prefix=$prefix $CONFIG_OPTS"
+ ../configure "--prefix=$prefix" $CONFIG_OPTS
fi
travis_finish "configure" -notime
diff --git a/src/ghdldrv/default_paths.ads.in b/src/ghdldrv/default_paths.ads.in
index e6137789d..a20491c3d 100644
--- a/src/ghdldrv/default_paths.ads.in
+++ b/src/ghdldrv/default_paths.ads.in
@@ -38,5 +38,5 @@ package Default_Paths is
"@POST_PROCESSOR@";
Shared_Library_Extension : constant String := "@SOEXT@";
- Default_Pie : constant Boolean := "@default_pie@" = String'("yes");
+ Default_Pie : constant Boolean := "@default_pie@" = String'("true");
end Default_Paths;