浏览代码

add optional debugging support

Ralf S. Engelschall 22 年之前
父节点
当前提交
118f073f6e
共有 1 个文件被更改,包括 31 次插入1 次删除
  1. 31 1
      apache/apache.spec

+ 31 - 1
apache/apache.spec

@@ -60,7 +60,7 @@ Distribution: OpenPKG [BASE]
 Group:        Web
 License:      ASF
 Version:      %{V_apache}
-Release:      20031002
+Release:      20031007
 
 #   package options (suexec related)
 %option       with_suexec               yes
@@ -133,6 +133,9 @@ Release:      20031002
 %option       with_shared_core          no
 %option       with_shared_chain         no
 
+#   package options (debugging)
+%option       with_debug                no
+
 #   fixing implicit inter-module dependencies and correlations
 %if "%{with_mod_php}" == "yes"
 %if "%{with_mod_php3}" == "yes"
@@ -427,7 +430,11 @@ AutoReqProv:  no
 %if "%{with_mod_php}" == "yes" || "%{with_mod_php3}" == "yes" || "%{with_mod_dav}" == "yes"
     ( cd apache_%{V_apache}
       CC="%{l_cc}" \
+%if "%{with_debug}" == "yes"
+      CFLAGS="%{l_cflags} -g" \
+%else
       CFLAGS="%{l_cflags -O}" \
+%endif
       ./configure \
 %if "%{with_mod_ssl}" == "yes"
           --enable-rule=EAPI \
@@ -486,9 +493,15 @@ AutoReqProv:  no
 %if "%{with_mod_php}" == "yes"
     ( cd php-%{V_mod_php}
       CC="%{l_cc}"; export CC
+%if "%{with_debug}" == "yes"
       CFLAGS="%{l_cflags -O} %{l_cppflags}"; export CFLAGS
       CPPFLAGS="%{l_cflags -O} %{l_cppflags}"; export CPPFLAGS
       LDFLAGS="%{l_cflags -O} %{l_ldflags}"; export LDFLAGS
+%else
+      CFLAGS="%{l_cflags} -g %{l_cppflags}"; export CFLAGS
+      CPPFLAGS="%{l_cflags} -g %{l_cppflags}"; export CPPFLAGS
+      LDFLAGS="%{l_cflags} -g %{l_ldflags}"; export LDFLAGS
+%endif
       LIBS=""; export LIBS
 %if "%{with_mod_ssl}" == "yes"
       CFLAGS="$CFLAGS -DEAPI"
@@ -690,10 +703,18 @@ AutoReqProv:  no
 %if "%{with_mod_dav}" == "yes"
     ( cd mod_dav-%{V_mod_dav}
       CC="%{l_cc}" \
+%if "%{with_debug}" == "yes"
+%if "%{with_mod_ssl}" == "yes"
+      CFLAGS="%{l_cflags} -g" \
+%else
+      CFLAGS="%{l_cflags} -g -DEAPI" \
+%endif
+%else
 %if "%{with_mod_ssl}" == "yes"
       CFLAGS="%{l_cflags -O}" \
 %else
       CFLAGS="%{l_cflags -O} -DEAPI" \
+%endif
 %endif
       LDFLAGS="%{l_cflags -O}" \
       ./configure \
@@ -777,7 +798,11 @@ AutoReqProv:  no
 
     #   configure Apache
     ( cd apache_%{V_apache}
+%if "%{with_debug}" == "yes"
+      cflags="%{l_cflags} -g"
+%else
       cflags="%{l_cflags -O}"
+%endif
       ldflags=""
       libs=""
 %if "%{with_mod_auth_pam}" == "yes"
@@ -819,6 +844,9 @@ AutoReqProv:  no
           --libexecdir=%{l_prefix}/lib/apache \
           --datadir=%{l_prefix}/share/apache \
           --localstatedir=%{l_prefix}/var/apache \
+%if "%{with_debug}" == "yes"
+          --without-execstrip \
+%endif
 %if "%{with_suexec}" == "yes"
           --enable-suexec \
           --suexec-caller=%{with_suexec_caller} \
@@ -944,8 +972,10 @@ AutoReqProv:  no
         %{SOURCE rc.apache} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
 
     #   strip installation binaries
+%if "%{with_debug}" != "yes"
     strip $RPM_BUILD_ROOT%{l_prefix}/bin/*  2>/dev/null || true
     strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true
+%endif
 
     #   determine installation tree files
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \