[GRASS-dev] [bug #4764] (grass) Give NetBSD a distinct configuration section in aclocal.m4.

Request Tracker grass-bugs at intevation.de
Thu Jun 29 16:27:43 EDT 2006


this bug's URL: http://intevation.de/rt/webrt?serial_num=4764
-------------------------------------------------------------------------

Subject: Give NetBSD a distinct configuration section in aclocal.m4.

Platform: other
grass obtained from: Trento Italy site
grass binary for platform: Compiled from Sources
GRASS Version: 6.0.2

Currently, the configuration system lumps NetBSD together with very early versions of FreeBSD.  In fact, NetBSD is much more similar to recent FreeBSD than to the early ones.  However, it is distinct.

As a result, it should have its own configuration section, as do the other operating systems.

Because the configuration scripts are created via autoconf, the appropriate place to define the NetBSD section is in aclocal.m4, which is the master copy from which autoconf generates the configure script.  The following patch splits the joint NetBSD/FreeBSD section of that file into two (and relocates the early FreeBSD section to be adjacent to the later one).  The values given in the new NetBSD section yield a successful compilation for a NetBSD/i386 system.  In case they are not perfect, at least this patch will provide a location for tuning NetBSD-specific parameters without worrying about side-effects on other operating systems.

Note that after applying this patch, autoconf must be run so that the new configure script will be distributed.


--- aclocal.m4.orig     2006-01-02 16:36:38.000000000 +0000
+++ aclocal.m4  2006-06-28 23:11:48.000000000 +0000
@@ -836,10 +836,51 @@
            CC_SEARCH_FLAGS=""
            LD_SEARCH_FLAGS=""
            ;;
-       NetBSD-*|FreeBSD-[[1-2]].*)
+       NetBSD-*)
+           # NetBSD/SPARC needs -fPIC, -fpic will not do.
+           SHLIB_CFLAGS="-fPIC"
+           SHLIB_LD="ld -Bshareable -x"
+           SHLIB_LD_LIBS="${LIBS}"
+           SHLIB_SUFFIX=".so"
+           LDFLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR} -export-dynamic'
+           CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+           LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+           if test "${GRASS_THREADS}" = "1" ; then
+               # The -pthread needs to go in the CFLAGS, not LIBS
+               LIBS=`echo $LIBS | sed s/-pthread//`
+               EXTRA_CFLAGS="-pthread"
+               LDFLAGS="$LDFLAGS -pthread"
+           fi
+           UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
+           SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so',
+           GRASS_LIB_VERSIONS_OK=nodots
+           ;;
+       OpenBSD-*)
+           SHLIB_LD="${CC} -shared"
+           SHLIB_LD_LIBS='${LIBS}'
+           SHLIB_SUFFIX=".so"
+           LDFLAGS=""
+           CC_SEARCH_FLAGS=""
+           LD_SEARCH_FLAGS=""
+           AC_MSG_CHECKING(for ELF)
+           AC_EGREP_CPP(yes, [
+#ifdef __ELF__
+       yes
+#endif
+           ],
+               [AC_MSG_RESULT(yes)
+               SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0'],
+               [AC_MSG_RESULT(no)
+               SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0']
+           )
+
+           # OpenBSD doesn't do version numbers with dots.
+           UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
+           GRASS_LIB_VERSIONS_OK=nodots
+           ;;
+       FreeBSD-[[1-2]].*)
            # Not available on all versions:  check for include file.
            AC_CHECK_HEADER(dlfcn.h, [
-               # NetBSD/SPARC needs -fPIC, -fpic will not do.
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LD="ld -Bshareable -x"
                SHLIB_LD_LIBS=""
@@ -874,29 +915,6 @@
            UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
            GRASS_LIB_VERSIONS_OK=nodots
            ;;
-       OpenBSD-*)
-           SHLIB_LD="${CC} -shared"
-           SHLIB_LD_LIBS='${LIBS}'
-           SHLIB_SUFFIX=".so"
-           LDFLAGS=""
-           CC_SEARCH_FLAGS=""
-           LD_SEARCH_FLAGS=""
-           AC_MSG_CHECKING(for ELF)
-           AC_EGREP_CPP(yes, [
-#ifdef __ELF__
-       yes
-#endif
-           ],
-               [AC_MSG_RESULT(yes)
-               SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0'],
-               [AC_MSG_RESULT(no)
-               SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0']
-           )
-
-           # OpenBSD doesn't do version numbers with dots.
-           UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
-           GRASS_LIB_VERSIONS_OK=nodots
-           ;;
        FreeBSD-*)
            # FreeBSD 3.* and greater have ELF.
            SHLIB_CFLAGS="-fPIC"


-------------------------------------------- Managed by Request Tracker




More information about the grass-dev mailing list