Re: [AD] Stripping libraries |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> > Can't we split LDFLAGS into a base LDFLAGS (suited to every shared
> > linking) and a PROGRAM_LDFLAGS suited only to programs? Then each shared
> > lib would be responsible for appending its own specialized option (-pg,
> > -s, -g).
>
> Fine.
Done with this patch, applied to trunk and branch.
--
Eric Botcazou
Index: aclocal.m4
===================================================================
RCS file: /cvsroot/alleg/allegro/aclocal.m4,v
retrieving revision 1.42
diff -u -r1.42 aclocal.m4
--- aclocal.m4 11 May 2003 00:51:31 -0000 1.42
+++ aclocal.m4 17 May 2003 12:51:02 -0000
@@ -505,6 +505,22 @@
AC_MSG_RESULT($allegro_support_constructor)])
dnl
+dnl Test for buggy IRIX linker.
+dnl
+dnl Variables:
+dnl allegro_cv_prog_ld_s
+dnl
+AC_DEFUN(ALLEGRO_ACTEST_PROG_LD_S,
+[AC_MSG_CHECKING(whether linker works with -s option)
+allegro_save_LDFLAGS=$LDFLAGS
+LDFLAGS="-s $LDFLAGS"
+AC_CACHE_VAL(allegro_cv_prog_ld_s, [
+AC_TRY_LINK(,{},allegro_cv_prog_ld_s=yes, allegro_cv_prog_ld_s=no)])
+LDFLAGS=$allegro_save_LDFLAGS
+AC_MSG_RESULT($allegro_cv_prog_ld_s)
+])
+
+dnl
dnl Test for buggy gcc version.
dnl
dnl Variables:
Index: configure.in
===================================================================
RCS file: /cvsroot/alleg/allegro/configure.in,v
retrieving revision 1.59
diff -u -r1.59 configure.in
--- configure.in 11 May 2003 00:51:31 -0000 1.59
+++ configure.in 17 May 2003 12:51:05 -0000
@@ -115,6 +115,7 @@
ALLEGRO_ACTEST_GCC_INCLUDE_PREFIX
ALLEGRO_ACTEST_GCC_PIPE
AC_PROG_CPP
+ALLEGRO_ACTEST_PROG_LD_S
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
@@ -205,19 +206,25 @@
if test "X$allegro_build_debugging_programs" = "Xyes"; then
COMPILE_PROGRAM=COMPILE_DEBUG
COMPILE_S_PROGRAM=COMPILE_S_DEBUG
+ PROG_LDFLAGS="-g \$(LDFLAGS)"
LIB_TO_LINK=alld
PLUGIN_LIB=lib/unix/libaddat.a
allegro_build_debugging_library=yes
elif test "X$allegro_build_profiling_programs" = "Xyes"; then
COMPILE_PROGRAM=COMPILE_PROFILE
COMPILE_S_PROGRAM=COMPILE_S_PROFILE
- LDFLAGS="-pg $LDFLAGS"
+ PROG_LDFLAGS="-pg \$(LDFLAGS)"
LIB_TO_LINK=allp
PLUGIN_LIB=lib/unix/libapdat.a
allegro_build_profiling_library=yes
else
COMPILE_PROGRAM=COMPILE_NORMAL
COMPILE_S_PROGRAM=COMPILE_S_NORMAL
+ if test "X$allegro_cv_prog_ld_s" = "Xyes"; then
+ PROG_LDFLAGS="-s \$(LDFLAGS)"
+ else
+ PROG_LDFLAGS="\$(LDFLAGS)"
+ fi
LIB_TO_LINK=alleg
PLUGIN_LIB=lib/unix/libaldat.a
allegro_build_normal_library=yes
@@ -238,6 +245,7 @@
AC_SUBST(PLUGIN_LIB)
AC_SUBST(COMPILE_PROGRAM)
AC_SUBST(COMPILE_S_PROGRAM)
+AC_SUBST(PROG_LDFLAGS)
AC_SUBST(LIB_TO_LINK)
AC_SUBST(LINK_WITH_STATIC_LIBS)
Index: makefile.in
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.in,v
retrieving revision 1.45
diff -u -r1.45 makefile.in
--- makefile.in 9 Apr 2003 07:23:33 -0000 1.45
+++ makefile.in 17 May 2003 12:51:05 -0000
@@ -61,8 +61,9 @@
DEFS = @DEFS@ -Iinclude -Iinclude/allegro -I$(srcdir)/include -I$(srcdir)/include/allegro -I.
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
+PROG_LDFLAGS = @PROG_LDFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(LDFLAGS)
+LINK = $(CC) $(PROG_LDFLAGS)
CFLAGS = @CFLAGS@
ALLEGRO_DEBUG_CFLAGS = @ALLEGRO_DEBUG_CFLAGS@
Index: misc/deplib.sh
===================================================================
RCS file: /cvsroot/alleg/allegro/misc/deplib.sh,v
retrieving revision 1.7
diff -u -r1.7 deplib.sh
--- misc/deplib.sh 18 Oct 2002 12:20:25 -0000 1.7
+++ misc/deplib.sh 17 May 2003 12:51:06 -0000
@@ -24,7 +24,7 @@
echo " rm -f \$@"
# gf: This bit is obviously gcc-specific
# eb: Yes, but the GNU C Compiler doesn't always spell 'gcc'
- echo " \$(CC) -shared -o \$@ ${shareobj} \$(LDFLAGS) -Wl,-h,lib${1}.so.\$(shared_major_minor) \$(LIBS)"
+ echo " \$(CC) -shared -o \$@ ${shareobj} ${3} \$(LDFLAGS) -Wl,-h,lib${1}.so.\$(shared_major_minor) \$(LIBS)"
echo ""
echo "\$(LIBDIR)/${unsharelib}: ${unshareobj}"
echo " rm -f \$@"
@@ -70,7 +70,7 @@
done
echo "$prev"
echo ""
-write_code alleg LIBALLEG
+write_code alleg LIBALLEG -s
echo ""
echo ""
@@ -101,7 +101,7 @@
done
echo "$prev"
echo ""
-write_code alld LIBALLD
+write_code alld LIBALLD -g
echo ""
echo ""
@@ -132,7 +132,7 @@
done
echo "$prev"
echo ""
-write_code allp LIBALLP
+write_code allp LIBALLP -pg
echo ""
echo ""