From f4e52b15debf4a732c428a23253bfe9127f2a24f Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Wed, 11 Dec 2013 15:21:38 +0900 Subject: [PATCH] autotools: update to simplified quicklaunch build. --- configure.ac | 1 + m4/elm_quicklaunch.m4 | 24 ++++++++++++++++++++++++ src/bin/Makefile.am | 14 +------------- 3 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 m4/elm_quicklaunch.m4 diff --git a/configure.ac b/configure.ac index 2bb438d..e591168 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,7 @@ AC_CONFIG_HEADERS(config.h) AC_GNU_SOURCE AC_PROG_LIBTOOL AM_PROG_CC_C_O +ELM_QUICKLAUNCH ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## diff --git a/m4/elm_quicklaunch.m4 b/m4/elm_quicklaunch.m4 new file mode 100644 index 0000000..3db9945 --- /dev/null +++ b/m4/elm_quicklaunch.m4 @@ -0,0 +1,24 @@ +dnl Copyright (C) 2013 Cedric Bail +dnl That code is public domain and can be freely used or copied + +dnl Macro that check if -pie -rdynamic can be given to ld + +dnl Usage: ELM_QUICKLAUNCH +dnl add -pie -rdynamic to LDFLAGS and -fpie to CFLAGS + +AC_DEFUN([ELM_QUICKLAUNCH], +[ +AC_MSG_CHECKING([If the compiler as what it takes to do quicklaunch (-pie -rdynamic)]) +old_LDFLAGS="$LDFLAGS" +old_CFLAGS="$CFLAGS" + +LDFLAGS="$LDFLAGS -pie -rdynamic" +CFLAGS="$CFLAGS -fpie" + +AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])], + [AC_MSG_RESULT([yes])], + [LDFLAGS="$old_LDFLAGS" + CFLAGS="$old_CFLAGS" + AC_MSG_RESULT([no]) + ]) +]) diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 726d8e7..6d1a76c 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -1,6 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in -bin_PROGRAMS = enventor enventorql +bin_PROGRAMS = enventor AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ @@ -27,18 +27,6 @@ enventor_SOURCES = \ build.c \ globals.c -# QuickLaunch -enventorql_SOURCES = $(enventor_SOURCES) -enventorql_LTLIBRARIES = enventorql.la -enventorql_CFLAGS = -DELM_LIB_QUICKLAUNCH=1 -enventorql_LDFLAGS = @ENVENTOR_LIBS@ - -enventorqldir = $(libdir) -enventorql_la_LIBADD = @ENVENTOR_LIBS@ -enventorql_la_CFLAGS = -enventorql_la_LDFLAGS = -module -avoid-version -no-undefined -enventorql_la_SOURCES = $(enventor_SOURCES) - enventor_LDADD = @ENVENTOR_LIBS@ enventor_LDFLAGS = $(LTLIBINTL)