AC_MSG_CHECKING(what additional CFLAGS are needed to link statically)
if test X"$GCC" = Xyes ; then
case "$target" in
- *-*-hpux*) CFLAGS_STATIC="-Wl,-a,archive_shared";; #works better
- *-*-*) CFLAGS_STATIC="-static";;
+ *-*-hpux*) LDFLAGS_STATIC="-Wl,-a,archive_shared";; #works better
+ *-*-*) LDFLAGS_STATIC="-static";;
esac
elif test X"$CC" = Xcc ; then
case "$target" in
- *-*-linux*) CFLAGS_STATIC="-static";;
- *-*-freebsd*) CFLAGS_STATIC="-static";;
- *-*-osf*) CFLAGS_STATIC="-non_shared";;
- *-*-aix*) CFLAGS_STATIC="";; # -Wl,-bnso doesn't seem to work...
- *-*-hpux*) CFLAGS_STATIC="-Wl,-a,archive_shared";;
- *-*-solaris*) CFLAGS_STATIC="-B static";;
- *-*-irix*) CFLAGS_STATIC="";; #should be -non_shared, but can't
+ *-*-linux*) LDFLAGS_STATIC="-static";;
+ *-*-freebsd*) LDFLAGS_STATIC="-static";;
+ *-*-osf*) LDFLAGS_STATIC="-non_shared";;
+ *-*-aix*) LDFLAGS_STATIC="";; # -Wl,-bnso doesn't seem to work...
+ *-*-hpux*) LDFLAGS_STATIC="-Wl,-a,archive_shared";;
+ *-*-solaris*) LDFLAGS_STATIC="-B static";;
+ *-*-irix*) LDFLAGS_STATIC="";; #should be -non_shared, but can't
# link because of crt1.o then.
- *-*-ultrix*) CFLAGS_STATIC="";; #ultrix doesn't have shared libs.
- *-*-*) CFLAGS_STATIC=""
+ *-*-ultrix*) LDFLAGS_STATIC="";; #ultrix doesn't have shared libs.
+ *-*-*) LDFLAGS_STATIC=""
AC_MSG_WARN([
Unable to guess what option to pass to $CC to generate a static
-executable. You will need to set the CFLAGS_STATIC macro in Makefile.inc to
+executable. You will need to set the LDFLAGS_STATIC macro in Makefile.inc to
the appropriate argument(s) if you want to build a static rpm executable.
])
;;
esac
else
- # a shot in the dark...
- CFLAGS_STATIC="-static"
+ # just link it dynamically
+ LDFLAGS_STATIC=""
fi
-AC_MSG_RESULT($CFLAGS_STATIC)
-AC_SUBST(CFLAGS_STATIC)
+AC_MSG_RESULT($LDFLAGS_STATIC)
+if test -n "$LDFLAGS_STATIC"; then
+ RPM=rpm
+else
+ RPM=rpm.shared
+fi
AC_MSG_CHECKING(POSIX chmod...)
touch foo.chmodtest
fi
fi
-#This test will obviate a special case for at least Solaris;
-#possibly others also.
-AC_CHECK_FUNC(dlopen,RPM=rpm,RPM=rpm.shared)
-
if echo "$build_os" | grep sco > /dev/null; then
echo "hacking things up for sco"
RPM=rpm.shared
AC_SUBST(MISCPATH)
AC_SUBST(RPMCONFIGDIR)
AC_SUBST(MKDIR_P)
+AC_SUBST(LDFLAGS_STATIC)
if test -d newbuild ; then
NBMAKEFILE=newbuild/Makefile