logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Problem configuring apache 2.4's config.m4 in linux
Author
totszwai



Joined: 18 Aug 2016
Posts: 3
Location: Quebec

PostPosted: Thu 18 Aug '16 15:51    Post subject: Problem configuring apache 2.4's config.m4 in linux Reply with quote

Hi guys,

I'm in the process of upgrading from 2.2 to 2.4, and trying to migrate custom modules however running into a weird problem when regenerating the configure.

So in modules/ssl, it has the config.m4 file that add its checks for mod_ssl. Previously I add my own ssl related changes in there so that it will expand the macros when running autoreconf... but with 2.4 it doesn't seems to expand them properly anymore.

Even if I run the vanilla config.m4, it still prints out some weird character.

So this is the vanilla config.m4, the section that I am interested in...
Code:

dnl #  hook module into the Autoconf mechanism (--enable-ssl option)
APACHE_MODULE(ssl, [SSL/TLS support (mod_ssl)], $ssl_objs, , most, [
    APACHE_CHECK_OPENSSL
    if test "$ac_cv_openssl" = "yes" ; then
        if test "x$enable_ssl" = "xshared"; then
           # The only symbol which needs to be exported is the module
           # structure, so ask libtool to hide everything else:
           APR_ADDTO(MOD_SSL_LDADD, [-export-symbols-regex ssl_module])
        fi
    else
        enable_ssl=no
    fi

    // I need to add my stuff here
    // AC_SUBST(HELLOWORLD_CFLAGS)
    // AC_SUBST(HELLOWORLD_LIBS)
])


However, running autoreconf is giving me this, with a dangling colon...
Code:

      done
      if test $apr_addto_duplicate = "0"; then
        test "x$silent" != "xyes" && echo "  adding \"$i\" to MOD_SSL_LDADD"
        MOD_SSL_LDADD="$MOD_SSL_LDADD $i"
      fi
    done
  fi

        fi
    else
        enable_ssl=no
    fi

            :


So firstly, I'd like to know where the heck the dangling colon is coming from...
Secondly, did they change the macros? the AC_SUBST won't expand...
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 18 Aug '16 17:05    Post subject: Reply with quote

if I remember correctly the compiler flags are in modules/ssl/modules.mk
but that file will be rewritten bei the configure script. The configure script will read the env variables CC, CFLAGS, CPP, CPPFLAGS and LDFLAGS

that is why I set my custom SSL build directory to the LDFLAGS flag. See

Code:

./buildconf
export LDFLAGS="-Wl,-rpath,/opt/openssl/lib"
./configure --prefix=/opt/apache2 --enable-pie --enable-mods-shared=all --enable-so --disable-include --enable-lua --enable-deflate --enable-headers --enable-expires --enable-http2 --with-nghttp2=/opt/nghttp2 --enable-ssl=shared --with-ssl=/opt/openssl --with-openssl=/opt/openssl --with-crypto --enable-module=ssl --enable-mpms-shared=all --with-mpm=event --enable-rewrite --with-z=${HOME}/apache24/httpd-${HTTPD_VERSION}/srclib/zlib --enable-fcgid --with-included-apr
make


See also https://httpd.apache.org/docs/2.4/programs/configure.html#env
and
https://httpd.apache.org/docs/trunk/developer/new_api_2_4.html
Back to top
totszwai



Joined: 18 Aug 2016
Posts: 3
Location: Quebec

PostPosted: Thu 18 Aug '16 18:25    Post subject: Reply with quote

Yeah I could do that, but the feature can be enable by switch, so I don't really want to hardcode the flags there.

Code:

    AC_ARG_WITH(helloworld,
        APACHE_HELP_STRING([--with-helloworld],[with helloworld support]))
    if test "$with_helloworld" != "no"; then
        PKG_CHECK_MODULES([HELLOWORLD], [helloworld-blah])
        if test -n "$HELLOWORLD_CFLAGS$HELLOWORLD_LIBS"; then
            AC_DEFINE(HAVE_HELLOWORLD, 1, [we have helloworld])
        fi
        AC_SUBST(HELLOWORLD_CFLAGS)
        AC_SUBST(HELLOWORLD_LIBS)
    fi


The thing is, it expanded the AC_DEFINE correctly, it just won't expand the AC_SUBST... also that dangling colon is still a mystery..

Edit: Also, another thing is that, it doesn't understand the PKG_CHECK_MODULES macro after it generated the configure...
Back to top


Reply to topic   Topic: Problem configuring apache 2.4's config.m4 in linux View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads