aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac118
1 files changed, 59 insertions, 59 deletions
diff --git a/configure.ac b/configure.ac
index 40a35c2..5b4422a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,12 +155,9 @@ mingw*)
155 EXT_LIB_PATH="-L$with_plibc/lib $EXT_LIB_PATH" 155 EXT_LIB_PATH="-L$with_plibc/lib $EXT_LIB_PATH"
156 plibc=1))]) 156 plibc=1))])
157 157
158 if test $plibc -ne 1; 158 AS_IF([test $plibc -ne 1],
159 then 159 [AC_MSG_ERROR([libextractor requires PlibC])],
160 AC_MSG_ERROR([libextractor requires PlibC]) 160 [LIBS="$LIBS -lplibc"])
161 else
162 LIBS="$LIBS -lplibc"
163 fi
164 161
165 AM_LDFLAGS="$AM_LDFLAGS -Wl,--export-all-symbols" 162 AM_LDFLAGS="$AM_LDFLAGS -Wl,--export-all-symbols"
166 AM_CONDITIONAL(HAVE_GNU_LD, true) 163 AM_CONDITIONAL(HAVE_GNU_LD, true)
@@ -211,10 +208,8 @@ AM_CONDITIONAL(MINGW, test "$build_os" = "mingw32")
211 208
212 209
213# use '-fno-strict-aliasing', but only if the compiler can take it 210# use '-fno-strict-aliasing', but only if the compiler can take it
214if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; 211AS_IF([gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1],
215then 212 [AM_CFLAGS="-fno-strict-aliasing $AM_CFLAGS"])
216 AM_CFLAGS="-fno-strict-aliasing $AM_CFLAGS"
217fi
218 213
219AM_CONDITIONAL(HAVE_CXX, test "x$HAVE_CXX" = "xyes") 214AM_CONDITIONAL(HAVE_CXX, test "x$HAVE_CXX" = "xyes")
220 215
@@ -222,27 +217,47 @@ AM_CONDITIONAL(HAVE_CXX, test "x$HAVE_CXX" = "xyes")
222# Adam shostack suggests the following for Windows: 217# Adam shostack suggests the following for Windows:
223# -D_FORTIFY_SOURCE=2 -fstack-protector-all 218# -D_FORTIFY_SOURCE=2 -fstack-protector-all
224AC_ARG_ENABLE(gcc-hardening, 219AC_ARG_ENABLE(gcc-hardening,
225 AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks), 220 [AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks)],
226[if test x$enableval = xyes; then 221 [AS_IF([test x$enableval = xyes],
227 AM_CFLAGS="$AM_CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all" 222 [AM_CFLAGS="$AM_CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
228 AM_CFLAGS="$AM_CFLAGS -fwrapv -fPIE -Wstack-protector" 223 AM_CFLAGS="$AM_CFLAGS -fwrapv -fPIE -Wstack-protector"
229 AM_CFLAGS="$AM_CFLAGS --param ssp-buffer-size=1" 224 AM_CFLAGS="$AM_CFLAGS --param ssp-buffer-size=1"
230 AM_LDFLAGS="$AM_LDFLAGS -pie" 225 AM_LDFLAGS="$AM_LDFLAGS -pie"])])
231fi])
232 226
233 227
234# Linker hardening options 228# Linker hardening options
235# Currently these options are ELF specific - you can't use this with MacOSX 229# Currently these options are ELF specific - you can't use this with MacOSX
236AC_ARG_ENABLE(linker-hardening, 230AC_ARG_ENABLE(linker-hardening,
237 AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups), 231 [AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups)],
238[if test x$enableval = xyes; then 232 [AS_IF([x$enableval = xyes],
239 AM_LDFLAGS="$AM_LDFLAGS -z relro -z now" 233 [AM_LDFLAGS="$AM_LDFLAGS -z relro -z now"])])
240fi]) 234
235
236# Support for hiding non-public symbols
237HIDDEN_VISIBILITY_CFLAGS=""
238case "$host" in
239 *-*-mingw*)
240 dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
241 AC_DEFINE([_EXTRACTOR_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
242 [defines how to decorate public symbols while building])
243 HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
244 ;;
245 *)
246 dnl on other compilers, check if we can do -fvisibility=hidden
247 AX_CHECK_LINK_FLAG([-fvisibility=hidden],
248 [AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
249 [AC_DEFINE([_EXTRACTOR_EXTERN], [__attribute__((visibility("default"))) extern],
250 [defines how to decorate public symbols while building])
251 HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"])])
252 ;;
253esac
254AC_SUBST(HIDDEN_VISIBILITY_CFLAGS)
255
241 256
242 257
243# Checks for libraries. 258# Checks for libraries.
244 259
245AC_CHECK_HEADERS(langinfo.h) 260AC_CHECK_HEADERS([langinfo.h])
246 261
247# Check for libltdl header (#2999) 262# Check for libltdl header (#2999)
248ltdl=0 263ltdl=0
@@ -274,12 +289,9 @@ AC_ARG_WITH(ltdl,
274 AC_CHECK_HEADERS(ltdl.h, 289 AC_CHECK_HEADERS(ltdl.h,
275 AC_CHECK_LIB([ltdl], [lt_dlopenext], 290 AC_CHECK_LIB([ltdl], [lt_dlopenext],
276 ltdl=1))]) 291 ltdl=1))])
277if test x$ltdl = x1 292AS_IF([test x$ltdl = x1],
278then 293 [AC_MSG_RESULT([libltdl found])],
279 AC_MSG_RESULT([libltdl found]) 294 [AC_MSG_ERROR([libextractor requires libltdl (from GNU libtool), try installing libltdl-dev])])
280else
281 AC_MSG_ERROR([libextractor requires libltdl (from GNU libtool), try installing libltdl-dev])
282fi
283 295
284# check for apparmor 296# check for apparmor
285AC_CHECK_LIB(apparmor, aa_change_profile, 297AC_CHECK_LIB(apparmor, aa_change_profile,
@@ -542,10 +554,8 @@ AC_LINK_IFELSE(
542LIBS="$SAVED_LIBS $SOCKET_LIBS" 554LIBS="$SAVED_LIBS $SOCKET_LIBS"
543AC_LANG_POP(C) 555AC_LANG_POP(C)
544AC_MSG_RESULT([$sockets]) 556AC_MSG_RESULT([$sockets])
545if test "x$sockets" = "xno" 557AS_IF([test "x$sockets" = "xno"],
546then 558 [AC_MSG_ERROR([libextractor requires some kind of socket library])])
547 AC_MSG_ERROR([libextractor requires some kind of socket library])
548fi
549AC_SUBST([SOCKET_LIBS],[$SOCKET_LIBS]) 559AC_SUBST([SOCKET_LIBS],[$SOCKET_LIBS])
550 560
551LE_LIB_LIBS=$LIBS 561LE_LIB_LIBS=$LIBS
@@ -574,22 +584,16 @@ AC_ARG_ENABLE(glib,
574 esac], 584 esac],
575 AC_MSG_RESULT(allowed)) 585 AC_MSG_RESULT(allowed))
576 586
577if test x$without_glib != xtrue 587AS_IF([test x$without_glib != xtrue],
578then 588 [AS_IF([test $with_gnu_ld = yes],
579 if test $with_gnu_ld = yes 589 [# We need both GNU LD and GLIB here!
580 then 590 AM_CONDITIONAL(HAVE_GLIB,true)
581# We need both GNU LD and GLIB here! 591 AC_DEFINE(HAVE_GLIB, 1, [Have glib])],
582 AM_CONDITIONAL(HAVE_GLIB,true) 592 [# We may have GLIB, but without GNU LD we must not use it!
583 AC_DEFINE(HAVE_GLIB, 1, [Have glib]) 593 AM_CONDITIONAL(HAVE_GLIB,false)
584 else 594 AC_DEFINE(HAVE_GLIB, 0, [Have glib, but not GNU LD])])],
585# We may have GLIB, but without GNU LD we must not use it! 595 [AM_CONDITIONAL(HAVE_GLIB,false)
586 AM_CONDITIONAL(HAVE_GLIB,false) 596 AC_DEFINE(HAVE_GLIB, 0, [Have glib])])
587 AC_DEFINE(HAVE_GLIB, 0, [Have glib, but not GNU LD])
588 fi
589else
590 AM_CONDITIONAL(HAVE_GLIB,false)
591 AC_DEFINE(HAVE_GLIB, 0, [Have glib])
592fi
593 597
594# smf requires glib.h 598# smf requires glib.h
595CFLAGS_OLD="$CFLAGS" 599CFLAGS_OLD="$CFLAGS"
@@ -609,13 +613,10 @@ AC_MSG_CHECKING(for gdk-pixbuf)
609PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0 >= 2.4], [have_gdk_pixbuf=yes], [have_gdk_pixbuf=no]) 613PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0 >= 2.4], [have_gdk_pixbuf=yes], [have_gdk_pixbuf=no])
610 614
611AM_CONDITIONAL(HAVE_GDK_PIXBUF, test x$have_gdk_pixbuf != xno) 615AM_CONDITIONAL(HAVE_GDK_PIXBUF, test x$have_gdk_pixbuf != xno)
612if test $have_gdk_pixbuf != no 616AS_IF([test $have_gdk_pixbuf != no],
613then 617 [have_gdk_pixbuf=1],
614 have_gdk_pixbuf=1 618 [have_gdk_pixbuf=0
615else 619 AC_MSG_NOTICE([Cannot find Gdk-pixbuf: Is pkg-config in path?])])
616 have_gdk_pixbuf=0
617 AC_MSG_NOTICE([Cannot find Gdk-pixbuf: Is pkg-config in path?])
618fi
619AC_DEFINE_UNQUOTED([HAVE_GDK_PIXBUF], [$have_gdk_pixbuf], [We have Gdk-pixbuf]) 620AC_DEFINE_UNQUOTED([HAVE_GDK_PIXBUF], [$have_gdk_pixbuf], [We have Gdk-pixbuf])
620 621
621CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS" 622CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
@@ -670,9 +671,8 @@ AC_ARG_ENABLE(ffmpeg,
670 esac], 671 esac],
671 [ AC_MSG_RESULT(yes) 672 [ AC_MSG_RESULT(yes)
672 ffmpeg_enabled=1]) 673 ffmpeg_enabled=1])
673if test x$ffmpeg_enabled = x1 674AS_IF([test x$ffmpeg_enabled = x1],
674then 675 [ffmpeg_enabled=0
675 ffmpeg_enabled=0
676 new_ffmpeg=0 676 new_ffmpeg=0
677 AC_CHECK_HEADERS([libavutil/avutil.h libavformat/avformat.h libavcodec/avcodec.h libavutil/frame.h], 677 AC_CHECK_HEADERS([libavutil/avutil.h libavformat/avformat.h libavcodec/avcodec.h libavutil/frame.h],
678 AC_CHECK_HEADERS([libavresample/avresample.h], 678 AC_CHECK_HEADERS([libavresample/avresample.h],
@@ -683,7 +683,7 @@ then
683 AC_CHECK_LIB(avcodec, avcodec_alloc_context3, 683 AC_CHECK_LIB(avcodec, avcodec_alloc_context3,
684 ffmpeg_enabled=1)) 684 ffmpeg_enabled=1))
685 AC_CHECK_HEADERS([libavutil/avutil.h ffmpeg/avutil.h libavformat/avformat.h ffmpeg/avformat.h libavcodec/avcodec.h ffmpeg/avcodec.h libswscale/swscale.h ffmpeg/swscale.h]) 685 AC_CHECK_HEADERS([libavutil/avutil.h ffmpeg/avutil.h libavformat/avformat.h ffmpeg/avformat.h libavcodec/avcodec.h ffmpeg/avcodec.h libswscale/swscale.h ffmpeg/swscale.h])
686fi 686 ])
687AM_CONDITIONAL(HAVE_FFMPEG, test x$ffmpeg_enabled != x0) 687AM_CONDITIONAL(HAVE_FFMPEG, test x$ffmpeg_enabled != x0)
688AM_CONDITIONAL(HAVE_FFMPEG_NEW, test x$new_ffmpeg != x0) 688AM_CONDITIONAL(HAVE_FFMPEG_NEW, test x$new_ffmpeg != x0)
689 689