From 6df98280bb9f762bf29b0d8ff7d81fc6d76ee1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Mon, 27 Oct 2014 09:22:48 +0000 Subject: [PATCH] Missing -fPIC error in build of cardgui; refs #33 --- ax_check_qt.m4 | 16 ++++++++++++---- configure.in | 6 +++--- doc/examples/makefile.am | 2 -- src/makefile.am | 9 +++------ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index 232aad1..673330f 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -63,17 +63,25 @@ AC_DEFUN([AX_CXX_CHECK_QT], [ PKG_CHECK_MODULES([$1], [${qt_modules//Qt/Qt5}], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) - CPPFLAGS+=" ${$1_CFLAGS}" - CXXFLAGS+=" ${$1_CFLAGS}" + AM_CPPFLAGS+=" ${$1_CFLAGS}" + AM_CXXFLAGS+=" ${$1_CFLAGS}" LIBS+=" ${$1_LIBS}" ], [ PKG_CHECK_MODULES([$1], [${qt_modules}], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) - CPPFLAGS+=" ${$1_CFLAGS}" - CXXFLAGS+=" ${$1_CFLAGS}" + AM_CPPFLAGS+=" ${$1_CFLAGS}" + AM_CXXFLAGS+=" ${$1_CFLAGS}" LIBS+=" ${$1_LIBS}" ]) ]) AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) + AC_SUBST(AM_CPPFLAGS) + AC_SUBST(AM_CXXFLAGS) + AX_CHECK_COMPILE_FLAG(-fPIC, [AM_CXXFLAGS+=" -fPIC"]) + AX_CHECK_COMPILE_FLAG(-DPIC, [AM_CXXFLAGS+=" -DPIC"]) + AX_CHECK_COMPILE_FLAG(-fPIE, [AM_CXXFLAGS+=" -fPIE"]) + AX_CHECK_LINK_FLAG(-fPIC, [LDFLAGS+=" -fPIC"]) + AX_CHECK_LINK_FLAG(-DPIC, [LDFLAGS+=" -DPIC"]) + AX_CHECK_LINK_FLAG(-fPIE, [LDFLAGS+=" -fPIE"]) ]) diff --git a/configure.in b/configure.in index 8e98e86..0ccc06d 100644 --- a/configure.in +++ b/configure.in @@ -74,7 +74,7 @@ AC_SUBST_FILE(README) CHANGE_LOG=ChangeLog AC_SUBST_FILE(CHANGE_LOG) -CPPFLAGS="${CPPFLAGS} -DPACKAGEVERSION='\"${VERSION}\"' -DPACKAGENAME='\"${PACKAGENAME}\"'" +AM_CPPFLAGS+="-DPACKAGEVERSION='\"${VERSION}\"' -DPACKAGENAME='\"${PACKAGENAME}\"'" # Get rid of that stupid -O2 -g options! CXXFLAGS="${CXXFLAGS:-}" @@ -105,7 +105,7 @@ AC_ARG_ENABLE(pkcs11-download, for f in $(wget -q -O- ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/ 2>&1 | html2 | sed -n 's,.*/a/@href=\(.*\.h\)$,\1,gp'); do wget --unlink $f done - CPPFLAGS="${CPPFLAGS} -I$(pwd)" + AM_CPPFLAGS+="-I$(pwd)" cd - fi ]) @@ -121,7 +121,7 @@ AC_ARG_ENABLE(pedantic, [AS_HELP_STRING([--enable-pedantic], [enable all warnings and checks, abort on warnings])], [have_pedantic="$enableval"; test "$enableval" = "yes" && \ - AM_CXXFLAGS="${AM_CXXFLAGS:-} -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror -Wshadow -Wcast-qual -Wno-ctor-dtor-privacy"]) + AM_CXXFLAGS+=" -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror -Wshadow -Wcast-qual -Wno-ctor-dtor-privacy"]) dnl problem in libs: -Wshadow -Wcast-qual dnl auto.hpp: -Wno-ctor-dtor-privacy (removed) AM_CONDITIONAL(PEDANTIC, test "$enableval" = "yes") diff --git a/doc/examples/makefile.am b/doc/examples/makefile.am index c4ff17a..d7301b3 100644 --- a/doc/examples/makefile.am +++ b/doc/examples/makefile.am @@ -40,8 +40,6 @@ if HAVE_QTNETWORK noinst_PROGRAMS += suisse-id-demo noinst_HEADERS = suisse-id-demo.hxx suisse_id_demo_SOURCES = suisse-id-demo.cxx -suisse_id_demo_CXXFLAGS = ${QT_NETWORK_CFLAGS} -suisse_id_demo_LDADD = ${QT_NETWORK_LIBS} endif %_ui.hxx: %.ui diff --git a/src/makefile.am b/src/makefile.am index d0a0f4d..fbbb68f 100644 --- a/src/makefile.am +++ b/src/makefile.am @@ -17,10 +17,8 @@ AM_LDFLAGS = -lwinscard endif if !MINGW32 if MAC -AM_CPPFLAGS += -I/opt/local/include -I/Library/OpenSC/include -AM_LDFLAGS = -F/System/Library/Frameworks/PCSC.framework -L/opt/local/lib -framework PCSC -else -AM_CPPFLAGS += -I/usr/include/PCSC +AM_CPPFLAGS += -I/Library/OpenSC/include +AM_LDFLAGS = -F/System/Library/Frameworks/PCSC.framework -framework PCSC endif endif @@ -54,8 +52,7 @@ cardgui_SOURCES = cardgui.cxx cardgui.hxx password.hxx cardgui-model.hxx \ nodist_cardgui_SOURCES = cardgui_ui.hxx password_ui.hxx \ moc_cardgui.cxx moc_password.cxx moc_cardgui-model.cxx BUILT_SOURCES = ${nodist_cardgui_SOURCES} -cardgui_CXXFLAGS = ${QT_GUI_CFLAGS} -cardgui_LDADD = ${QT_GUI_LIBS} libpcscxx.la ${libpcscxx_la_LIBADD} +cardgui_LDADD = libpcscxx.la ${libpcscxx_la_LIBADD} endif noinst_PROGRAMS = versiontest