Forráskód Böngészése

Merge branch 'maint'

* maint:
  Prefix CXX_FLAG_CHECK with ax_, not egg_
  Fix build on OpenBSD, -fstack-protector needed for LDFLAGS as well

Conflicts:
	src/Makefile.in
Bryan Drewery 11 éve
szülő
commit
ce258828bb
4 módosított fájl, 46 hozzáadás és 36 törlés
  1. 5 0
      build/autotools/configure.ac
  2. 4 4
      build/autotools/includes/acinclude.m4
  3. 35 30
      configure
  4. 2 2
      src/Makefile.in

+ 5 - 0
build/autotools/configure.ac

@@ -33,6 +33,11 @@ CXX_FLAG_CHECK([CXXFLAGS], [-fcolor-diagnostics], [colordiagnostics])
 CXX_FLAG_CHECK([CXXFLAGS], [-Wno-invalid-source-encoding], [invalid_source_encoding])
 CXX_FLAG_CHECK([CXXFLAGS], [-fstack-protector], [stackprotector])
 CXX_FLAG_CHECK([CXXFLAGS], [-fstack-protector-strong], [stackprotectorstrong])
+if [[ "${ax_cv_prog_cc_stackprotectorstrong}" = "yes" ]]; then
+  LDFLAGS="${LDFLAGS} -fstack-protector-strong"
+elif [[ "${ax_cv_prog_cc_stackprotector}" = "yes" ]]; then
+  LDFLAGS="${LDFLAGS} -fstack-protector"
+fi
 CXX_FLAG_CHECK([DEBCXXFLAGS], [-fstack-protector-all], [stackprotectorall])
 
 EGG_CHECK_DEPMODE

+ 4 - 4
build/autotools/includes/acinclude.m4

@@ -185,19 +185,19 @@ dnl @synopsis CXX_FLAGS_CHECK [var] [compiler flags] [cache name] [required]
 dnl @summary check whether compiler supports given C++ flags or not
 AC_DEFUN([CXX_FLAG_CHECK],
 [
-  AC_CACHE_CHECK([whether the compiler understands $2], egg_cv_prog_cc_$3, [
+  AC_CACHE_CHECK([whether the compiler understands $2], ax_cv_prog_cc_$3, [
     AC_LANG_PUSH([C++])
     ac_saved_flags="$CXXFLAGS"
     CXXFLAGS="-Werror $2"
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
-      [egg_cv_prog_cc_$3="yes"],
-      [egg_cv_prog_cc_$3="no"],
+      [ax_cv_prog_cc_$3="yes"],
+      [ax_cv_prog_cc_$3="no"],
     )
     CXXFLAGS="$ac_saved_flags"
     AC_LANG_POP([C++])
   ])
 
-  if [[ "$egg_cv_prog_cc_$3" = "yes" ]]; then
+  if [[ "$ax_cv_prog_cc_$3" = "yes" ]]; then
     $1="$$1 $2"
   elif [[ -n "$4" ]]; then
       cat << 'EOF' >&2

+ 35 - 30
configure

@@ -3476,7 +3476,7 @@ $as_echo "$egg_cv_var_ccpipe" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -fcolor-diagnostics" >&5
 $as_echo_n "checking whether the compiler understands -fcolor-diagnostics... " >&6; }
-if ${egg_cv_prog_cc_colordiagnostics+:} false; then :
+if ${ax_cv_prog_cc_colordiagnostics+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -3500,9 +3500,9 @@ main ()
 }
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
-  egg_cv_prog_cc_colordiagnostics="yes"
+  ax_cv_prog_cc_colordiagnostics="yes"
 else
-  egg_cv_prog_cc_colordiagnostics="no"
+  ax_cv_prog_cc_colordiagnostics="no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     CXXFLAGS="$ac_saved_flags"
@@ -3514,10 +3514,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $egg_cv_prog_cc_colordiagnostics" >&5
-$as_echo "$egg_cv_prog_cc_colordiagnostics" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_cc_colordiagnostics" >&5
+$as_echo "$ax_cv_prog_cc_colordiagnostics" >&6; }
 
-  if [ "$egg_cv_prog_cc_colordiagnostics" = "yes" ]; then
+  if [ "$ax_cv_prog_cc_colordiagnostics" = "yes" ]; then
     CXXFLAGS="$CXXFLAGS -fcolor-diagnostics"
   elif [ -n "" ]; then
       cat << 'EOF' >&2
@@ -3534,7 +3534,7 @@ EOF
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -Wno-invalid-source-encoding" >&5
 $as_echo_n "checking whether the compiler understands -Wno-invalid-source-encoding... " >&6; }
-if ${egg_cv_prog_cc_invalid_source_encoding+:} false; then :
+if ${ax_cv_prog_cc_invalid_source_encoding+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -3558,9 +3558,9 @@ main ()
 }
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
-  egg_cv_prog_cc_invalid_source_encoding="yes"
+  ax_cv_prog_cc_invalid_source_encoding="yes"
 else
-  egg_cv_prog_cc_invalid_source_encoding="no"
+  ax_cv_prog_cc_invalid_source_encoding="no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     CXXFLAGS="$ac_saved_flags"
@@ -3572,10 +3572,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $egg_cv_prog_cc_invalid_source_encoding" >&5
-$as_echo "$egg_cv_prog_cc_invalid_source_encoding" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_cc_invalid_source_encoding" >&5
+$as_echo "$ax_cv_prog_cc_invalid_source_encoding" >&6; }
 
-  if [ "$egg_cv_prog_cc_invalid_source_encoding" = "yes" ]; then
+  if [ "$ax_cv_prog_cc_invalid_source_encoding" = "yes" ]; then
     CXXFLAGS="$CXXFLAGS -Wno-invalid-source-encoding"
   elif [ -n "" ]; then
       cat << 'EOF' >&2
@@ -3591,7 +3591,7 @@ EOF
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -fstack-protector" >&5
 $as_echo_n "checking whether the compiler understands -fstack-protector... " >&6; }
-if ${egg_cv_prog_cc_stackprotector+:} false; then :
+if ${ax_cv_prog_cc_stackprotector+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -3615,9 +3615,9 @@ main ()
 }
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
-  egg_cv_prog_cc_stackprotector="yes"
+  ax_cv_prog_cc_stackprotector="yes"
 else
-  egg_cv_prog_cc_stackprotector="no"
+  ax_cv_prog_cc_stackprotector="no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     CXXFLAGS="$ac_saved_flags"
@@ -3629,10 +3629,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $egg_cv_prog_cc_stackprotector" >&5
-$as_echo "$egg_cv_prog_cc_stackprotector" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_cc_stackprotector" >&5
+$as_echo "$ax_cv_prog_cc_stackprotector" >&6; }
 
-  if [ "$egg_cv_prog_cc_stackprotector" = "yes" ]; then
+  if [ "$ax_cv_prog_cc_stackprotector" = "yes" ]; then
     CXXFLAGS="$CXXFLAGS -fstack-protector"
   elif [ -n "" ]; then
       cat << 'EOF' >&2
@@ -3648,7 +3648,7 @@ EOF
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -fstack-protector-strong" >&5
 $as_echo_n "checking whether the compiler understands -fstack-protector-strong... " >&6; }
-if ${egg_cv_prog_cc_stackprotectorstrong+:} false; then :
+if ${ax_cv_prog_cc_stackprotectorstrong+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -3672,9 +3672,9 @@ main ()
 }
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
-  egg_cv_prog_cc_stackprotectorstrong="yes"
+  ax_cv_prog_cc_stackprotectorstrong="yes"
 else
-  egg_cv_prog_cc_stackprotectorstrong="no"
+  ax_cv_prog_cc_stackprotectorstrong="no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     CXXFLAGS="$ac_saved_flags"
@@ -3686,10 +3686,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $egg_cv_prog_cc_stackprotectorstrong" >&5
-$as_echo "$egg_cv_prog_cc_stackprotectorstrong" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_cc_stackprotectorstrong" >&5
+$as_echo "$ax_cv_prog_cc_stackprotectorstrong" >&6; }
 
-  if [ "$egg_cv_prog_cc_stackprotectorstrong" = "yes" ]; then
+  if [ "$ax_cv_prog_cc_stackprotectorstrong" = "yes" ]; then
     CXXFLAGS="$CXXFLAGS -fstack-protector-strong"
   elif [ -n "" ]; then
       cat << 'EOF' >&2
@@ -3702,10 +3702,15 @@ EOF
     exit 1
   fi
 
+if [ "${ax_cv_prog_cc_stackprotectorstrong}" = "yes" ]; then
+  LDFLAGS="${LDFLAGS} -fstack-protector-strong"
+elif [ "${ax_cv_prog_cc_stackprotector}" = "yes" ]; then
+  LDFLAGS="${LDFLAGS} -fstack-protector"
+fi
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -fstack-protector-all" >&5
 $as_echo_n "checking whether the compiler understands -fstack-protector-all... " >&6; }
-if ${egg_cv_prog_cc_stackprotectorall+:} false; then :
+if ${ax_cv_prog_cc_stackprotectorall+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -3729,9 +3734,9 @@ main ()
 }
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
-  egg_cv_prog_cc_stackprotectorall="yes"
+  ax_cv_prog_cc_stackprotectorall="yes"
 else
-  egg_cv_prog_cc_stackprotectorall="no"
+  ax_cv_prog_cc_stackprotectorall="no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     CXXFLAGS="$ac_saved_flags"
@@ -3743,10 +3748,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $egg_cv_prog_cc_stackprotectorall" >&5
-$as_echo "$egg_cv_prog_cc_stackprotectorall" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_cc_stackprotectorall" >&5
+$as_echo "$ax_cv_prog_cc_stackprotectorall" >&6; }
 
-  if [ "$egg_cv_prog_cc_stackprotectorall" = "yes" ]; then
+  if [ "$ax_cv_prog_cc_stackprotectorall" = "yes" ]; then
     DEBCXXFLAGS="$DEBCXXFLAGS -fstack-protector-all"
   elif [ -n "" ]; then
       cat << 'EOF' >&2

+ 2 - 2
src/Makefile.in

@@ -10,6 +10,7 @@ VPATH = @srcdir@
 CXXFLAGS = $(CXXFLAGS)
 CFLAGS = $(CFLGS)
 CPPFLAGS = @CPPFLAGS@ -I. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_srcdir)/pack @DEFS@ $(INCLUDES) '-DCOMMIT="$(COMMIT)"' '-DBRANCH="$(BRANCH)"' -DBUILDTS=$(BUILDTS) '-DVERSION="$(VERSION)"'
+LDFLAGS = @LDFLAGS@
 
 include $(top_srcdir)/build/build.mk
 
@@ -106,8 +107,7 @@ stringfix: stringfix.cc common.h config.h eggdrop.h
 	@echo ""
 	@echo "Linking wraith... $(EGGBUILD)"
 	@echo ""
-	$(LD) -o ../$(EGGEXEC) $(OBJS) $(MODOBJS) compat/*.o crypto/*.o ../lib/bdlib/libbdlib.a $(LIBS) @LIBELF_LIB@
-#	$(LD) -o ../$(EGGEXEC) $(OBJS) $(MODOBJS) $(LIBS) compat/*.o crypto/*.o
+	$(LD) $(LDFLAGS) -o ../$(EGGEXEC) $(OBJS) $(MODOBJS) compat/*.o crypto/*.o ../lib/bdlib/libbdlib.a $(LIBS) @LIBELF_LIB@
 	@$(STRIP) ../$(EGGEXEC)
 	@$(OBJCOPY) ../$(EGGEXEC)
 	@echo "Successful compile: $(EGGEXEC)"