Просмотр исходного кода

* Disable static compiling on Darwin/Solaris

These operating systems have ideological reasons for restricting static compiling.
Solaris [1], Mac OSX [2] [3]

Wraith uses static binaries for convenience and maximum binary compatibility
when upgrading. You compile the binary once per operating system, then distribute
it, not having to worry that they all have the same shared libraries.

This change will allow pre-compiled binaries to be distributed, however the
problem of needing the same version of shared libraries then exists.

Compiling per-server will always work correctly, but will break the convenience
of quick auto-updating from the hub with 1 binary per operating system.

[1] http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4470917
[2] http://developer.apple.com/mac/library/qa/qa2001/qa1118.html
[3] gcc(1) -static description
Bryan Drewery 16 лет назад
Родитель
Сommit
e91524c066
3 измененных файлов с 28 добавлено и 11 удалено
  1. 2 2
      Makefile.in
  2. 13 4
      autotools/includes/acinclude.m4
  3. 13 5
      configure

+ 2 - 2
Makefile.in

@@ -30,8 +30,8 @@ SETTINGSFILE = doc/settings.txt
 RESPONSESFILE = doc/responses.txt
 
 # defaults
-CXX = @CCACHE@ @DISTCC@ @CXX@ -static
-LD = @CXX@ -static
+CXX = @CCACHE@ @DISTCC@ @CXX@ @STATIC@
+LD = @CXX@ @STATIC@
 CCDEBUG = @CCACHE@ @DISTCC@ @CCDEBUG@ 
 LDDEBUG = @CCDEBUG@
 STRIP = @STRIP@

+ 13 - 4
autotools/includes/acinclude.m4

@@ -143,7 +143,7 @@ dnl
 dnl  Checks whether the compiler supports the `-static' flag.
 AC_DEFUN([EGG_CHECK_CCSTATIC],
 [
-if test -z "$no_static"
+if test "$USE_STATIC" = "yes"
 then
   if test -n "$GXX"
   then
@@ -162,14 +162,19 @@ then
       cat << 'EOF' >&2
 configure: error:
 
-  Your C compiler does not support -static.
-  This compile flag is required for the botpack.
+  Your OS or C++ compiler does not support -static.
+  This compile flag is required for the botpack on this OS.
 
 EOF
   exit 1
     fi
   fi
+
+  STATIC="-static"
+else
+  STATIC=""
 fi
+AC_SUBST(STATIC)dnl
 ])
 
 dnl EGG_PROG_HEAD_1()
@@ -264,6 +269,7 @@ dnl
 AC_DEFUN([EGG_CHECK_OS],
 [
 EGG_CYGWIN=no
+USE_STATIC=yes
 AC_CACHE_CHECK(system type, egg_cv_var_system_type, egg_cv_var_system_type=`$UNAME -s`)
 AC_CACHE_CHECK(system release, egg_cv_var_system_release, egg_cv_var_system_release=`$UNAME -r`)
 AC_CACHE_CHECK(system machine, egg_cv_var_system_machine, egg_cv_var_system_machine=`$UNAME -m`)
@@ -331,6 +337,10 @@ case "$egg_cv_var_system_type" in
   ;;
   SunOS)
     SUNOS="yes"
+    USE_STATIC="no"
+  ;;
+  Darwin)
+    USE_STATIC="no"
   ;;
   *BSD)
     # FreeBSD/OpenBSD/NetBSD
@@ -350,7 +360,6 @@ case "$egg_cv_var_system_type" in
       else
         AC_MSG_RESULT(no)
         AC_MSG_RESULT(Something unknown!)
-        AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)])
       fi
     fi
   ;;

+ 13 - 5
configure

@@ -649,6 +649,7 @@ LIBOBJS
 SSL_LIBS
 SSL_INCLUDES
 CCDEBUG
+STATIC
 BUILDARCH
 BUILDOS
 DISTCC
@@ -4347,6 +4348,7 @@ fi
 # Test the os and set the module linking settings
 
 EGG_CYGWIN=no
+USE_STATIC=yes
 { $as_echo "$as_me:$LINENO: checking system type" >&5
 $as_echo_n "checking system type... " >&6; }
 if test "${egg_cv_var_system_type+set}" = set; then
@@ -4595,6 +4597,10 @@ _ACEOF
   ;;
   SunOS)
     SUNOS="yes"
+    USE_STATIC="no"
+  ;;
+  Darwin)
+    USE_STATIC="no"
   ;;
   *BSD)
     # FreeBSD/OpenBSD/NetBSD
@@ -4624,8 +4630,6 @@ $as_echo "yes" >&6; }
 $as_echo "no" >&6; }
         { $as_echo "$as_me:$LINENO: result: Something unknown!" >&5
 $as_echo "Something unknown!" >&6; }
-        { $as_echo "$as_me:$LINENO: result: If you get dynamic modules to work, be sure to let the devel team know HOW :)" >&5
-$as_echo "If you get dynamic modules to work, be sure to let the devel team know HOW :)" >&6; }
       fi
     fi
   ;;
@@ -4771,7 +4775,7 @@ _ACEOF
 
 # Create static binaries
 
-if test -z "$no_static"
+if test "$USE_STATIC" = "yes"
 then
   if test -n "$GXX"
   then
@@ -4838,13 +4842,17 @@ $as_echo "$egg_cv_var_ccstatic" >&6; }
       cat << 'EOF' >&2
 configure: error:
 
-  Your C compiler does not support -static.
-  This compile flag is required for the botpack.
+  Your OS or C++ compiler does not support -static.
+  This compile flag is required for the botpack on this OS.
 
 EOF
   exit 1
     fi
   fi
+
+  STATIC="-static"
+else
+  STATIC=""
 fi