From 6ac34ac6ab92ab391c6b65215ce76a0cb521d4af Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 11 Oct 2003 01:05:18 +0000 Subject: [PATCH] Define an LDDLL command to link dlls, instead of using LDDLLFLAGS. --- Make.rules.in | 1 + configure | 14 +++++++------- configure.ac | 8 ++++---- dlls/Makedll.rules.in | 12 ++---------- dlls/Maketest.rules.in | 3 +-- programs/Makeprog.rules.in | 3 +-- programs/avitools/Makefile.in | 7 +++---- 7 files changed, 19 insertions(+), 29 deletions(-) diff --git a/Make.rules.in b/Make.rules.in index 456399a3772..822b4510aaa 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -35,6 +35,7 @@ LIBEXT = @LIBEXT@ DLLEXT = @DLLEXT@ IMPLIBEXT = @IMPLIBEXT@ LDSHARED = @LDSHARED@ +LDDLL = @LDDLL@ DLLTOOL = @DLLTOOL@ DLLWRAP = @DLLWRAP@ AR = @AR@ rc diff --git a/configure b/configure index 975495218ec..2d149cc2863 100755 --- a/configure +++ b/configure @@ -308,7 +308,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS WIN16_FILES WIN16_INSTALL LIBPTHREAD build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP TOOLSDIR X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS YACC LEX LEXLIB LEX_OUTPUT_ROOT XYACC XLEX AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS DB2HTML DB2PDF DB2PS DB2TXT JPEGLIB EGREP GIFLIB XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS NASLIBS CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS ft_devel ft_devel2 FREETYPEINCL ARTSCCONFIG ARTSLIBS ARTSINCL ALSALIBS AUDIOIOLIBS EXTRACFLAGS DLLEXT DLLFLAGS DLLIBS LDDLLFLAGS LDSHARED LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS CROSSTEST CROSSCC CROSSWINDRES LDPATH CRTLIBS LDD ALLOCA LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS WIN16_FILES WIN16_INSTALL LIBPTHREAD build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP TOOLSDIR X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS YACC LEX LEXLIB LEX_OUTPUT_ROOT XYACC XLEX AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS DB2HTML DB2PDF DB2PS DB2TXT JPEGLIB EGREP GIFLIB XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS NASLIBS CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS ft_devel ft_devel2 FREETYPEINCL ARTSCCONFIG ARTSLIBS ARTSINCL ALSALIBS AUDIOIOLIBS EXTRACFLAGS DLLEXT DLLFLAGS DLLIBS LDSHARED LDDLL LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS CROSSTEST CROSSCC CROSSWINDRES LDPATH CRTLIBS LDD ALLOCA LIBOBJS LTLIBOBJS' ac_subst_files='MAKE_RULES MAKE_DLL_RULES MAKE_TEST_RULES MAKE_LIB_RULES MAKE_PROG_RULES' # Initialize some variables set by options. @@ -11675,10 +11675,10 @@ DLLFLAGS="-D_REENTRANT" DLLIBS="" -LDDLLFLAGS="" - LDSHARED="" +LDDLL="" + LIBEXT="so" IMPLIBEXT="def" @@ -12202,7 +12202,7 @@ echo "${ECHO_T}$ac_cv_c_dll_gnuelf" >&6 if test "$ac_cv_c_dll_gnuelf" = "yes" then LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)" - LDDLLFLAGS="-Wl,-Bsymbolic" + LDDLL="\$(CC) -shared -Wl,-Bsymbolic" echo "$as_me:$LINENO: checking whether the linker accepts -z defs" >&5 echo $ECHO_N "checking whether the linker accepts -z defs... $ECHO_C" >&6 if test "${ac_cv_c_dll_zdefs+set}" = set; then @@ -12252,7 +12252,7 @@ echo "$as_me:$LINENO: result: $ac_cv_c_dll_zdefs" >&5 echo "${ECHO_T}$ac_cv_c_dll_zdefs" >&6 if test "$ac_cv_c_dll_zdefs" = "yes" then - LDDLLFLAGS="$LDDLLFLAGS,-z,defs" + LDDLL="$LDDLL,-z,defs" fi echo "$as_me:$LINENO: checking whether we can relocate the executable to 0x3c000000" >&5 echo $ECHO_N "checking whether we can relocate the executable to 0x3c000000... $ECHO_C" >&6 @@ -12356,7 +12356,7 @@ echo "${ECHO_T}$ac_cv_c_dll_unixware" >&6 if test "$ac_cv_c_dll_unixware" = "yes" then LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)" - LDDLLFLAGS="-Wl,-B,symbolic" + LDDLL="\$(CC) -Wl,-G,-B,symbolic" fi fi fi @@ -17767,8 +17767,8 @@ s,@EXTRACFLAGS@,$EXTRACFLAGS,;t t s,@DLLEXT@,$DLLEXT,;t t s,@DLLFLAGS@,$DLLFLAGS,;t t s,@DLLIBS@,$DLLIBS,;t t -s,@LDDLLFLAGS@,$LDDLLFLAGS,;t t s,@LDSHARED@,$LDSHARED,;t t +s,@LDDLL@,$LDDLL,;t t s,@LIBEXT@,$LIBEXT,;t t s,@IMPLIBEXT@,$IMPLIBEXT,;t t s,@DLLTOOL@,$DLLTOOL,;t t diff --git a/configure.ac b/configure.ac index cef65fdd9c9..acb71d3779b 100644 --- a/configure.ac +++ b/configure.ac @@ -810,8 +810,8 @@ dnl **** Check for working dll **** AC_SUBST(DLLEXT,"") AC_SUBST(DLLFLAGS,"-D_REENTRANT") AC_SUBST(DLLIBS,"") -AC_SUBST(LDDLLFLAGS,"") AC_SUBST(LDSHARED,"") +AC_SUBST(LDDLL,"") AC_SUBST(LIBEXT,"so") AC_SUBST(IMPLIBEXT,"def") @@ -846,13 +846,13 @@ case $host_os in if test "$ac_cv_c_dll_gnuelf" = "yes" then LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)" - LDDLLFLAGS="-Wl,-Bsymbolic" + LDDLL="\$(CC) -shared -Wl,-Bsymbolic" AC_CACHE_CHECK([whether the linker accepts -z defs], ac_cv_c_dll_zdefs, [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs], ac_cv_c_dll_zdefs="yes",ac_cv_c_dll_zdefs="no")]) if test "$ac_cv_c_dll_zdefs" = "yes" then - LDDLLFLAGS="$LDDLLFLAGS,-z,defs" + LDDLL="$LDDLL,-z,defs" fi AC_CACHE_CHECK([whether we can relocate the executable to 0x3c000000], ac_cv_ld_reloc_exec, [saved_CFLAGS="$CFLAGS" @@ -874,7 +874,7 @@ case $host_os in if test "$ac_cv_c_dll_unixware" = "yes" then LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)" - LDDLLFLAGS="-Wl,-B,symbolic" + LDDLL="\$(CC) -Wl,-G,-B,symbolic" fi fi fi diff --git a/dlls/Makedll.rules.in b/dlls/Makedll.rules.in index 14aac959c4c..c2baf6973ab 100644 --- a/dlls/Makedll.rules.in +++ b/dlls/Makedll.rules.in @@ -29,7 +29,7 @@ $(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(IMPORTLIBS) $(WINEB $(WINEBUILD) $(DEFS) $(DLLFLAGS) -o $@ --spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:.rc=.res) $(ALL_OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%) $(MODULE).so: $(MAINSPEC).o $(ALL_OBJS) Makefile.in - $(LDSHARED) $(LDDLLFLAGS) $(MAINSPEC).o $(ALL_OBJS) -o $@ $(ALL_LIBS) -lc + $(LDDLL) $(MAINSPEC).o $(ALL_OBJS) -o $@ $(ALL_LIBS) -lc # Rules for .dll files @@ -40,14 +40,12 @@ $(SPEC_DEF): $(WINEBUILD) # Rules for checking that no imports are missing -CHECKLINK_RPATH = dlls libs/unicode libs/wine - .PHONY: checklink16 $(WIN16_FILES:%=__checklink16__%) $(WIN16_FILES:%=__checklink16__%): checklink16 checklink16:: $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o dummy - $(CC) -o checklink $(CHECKLINK_RPATH:%=-Wl,-rpath,$(TOPOBJDIR)/%) $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o $(ALL_LIBS) && $(RM) checklink + $(CC) -o checklink -Wl,-rpath,$(TOPOBJDIR)/libs $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o $(ALL_LIBS) && $(RM) checklink checklink:: $(WIN16_FILES:%=__checklink16__%) @@ -70,12 +68,6 @@ doc-sgml: $(C_SRCS) .PHONY: man doc-html doc-sgml -# Sanity check - -Makedll.rules: $(TOPSRCDIR)/dlls/Makedll.rules.in $(TOPSRCDIR)/configure - @echo $? is newer than 'Makedll.rules', please rerun ./configure! - @exit 1 - # Rules for installation WIN16_INSTALL = $(ALTNAMES:%=_install_/%$(DLLEXT)) diff --git a/dlls/Maketest.rules.in b/dlls/Maketest.rules.in index 53971fb4671..a7e6f3c077c 100644 --- a/dlls/Maketest.rules.in +++ b/dlls/Maketest.rules.in @@ -11,7 +11,6 @@ DEFS = $(EXTRADEFS) DLLFLAGS = @DLLFLAGS@ -LDDLLFLAGS = @LDDLLFLAGS@ MODULE = $(TESTDLL:%.dll=%)_test.exe TESTLIST = testlist.c @@ -42,7 +41,7 @@ $(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(OBJS) $(IMPORTLIBS) $(WINEBUILD) # Rules for .so main module $(MODULE).so: $(MODULE).spec.o $(OBJS) Makefile.in - $(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(OBJS) -o $@ $(ALL_LIBS) -lc + $(LDDLL) $(MODULE).spec.o $(OBJS) -o $@ $(ALL_LIBS) -lc # Rules for .exe main module diff --git a/programs/Makeprog.rules.in b/programs/Makeprog.rules.in index d632fe701b8..164d1dd99b8 100644 --- a/programs/Makeprog.rules.in +++ b/programs/Makeprog.rules.in @@ -11,7 +11,6 @@ DEFS = $(EXTRADEFS) DLLFLAGS = @DLLFLAGS@ -LDDLLFLAGS = @LDDLLFLAGS@ ALL_OBJS = $(OBJS) $(MODULE).dbg.o ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS) BASEMODULE = $(MODULE:.exe=) @@ -30,7 +29,7 @@ $(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(WINEBUILD) # Rules for .so main module $(MODULE).so: $(MODULE).spec.o $(ALL_OBJS) Makefile.in - $(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(ALL_OBJS) -o $@ $(ALL_LIBS) -lc + $(LDDLL) $(MODULE).spec.o $(ALL_OBJS) -o $@ $(ALL_LIBS) -lc $(BASEMODULE): $(WINEWRAPPER) $(RM) $@ && $(LN_S) $(WINEWRAPPER) $@ diff --git a/programs/avitools/Makefile.in b/programs/avitools/Makefile.in index 7bb536728ea..ba8fdda68e1 100644 --- a/programs/avitools/Makefile.in +++ b/programs/avitools/Makefile.in @@ -1,6 +1,5 @@ DEFS = $(EXTRADEFS) DLLFLAGS = @DLLFLAGS@ -LDDLLFLAGS = @LDDLLFLAGS@ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ @@ -28,13 +27,13 @@ icinfo.exe.spec.c: icinfo.o $(WINEBUILD) $(WINEBUILD) $(DEFS) $(DLLFLAGS) -o $@ --exe icinfo.exe --exe-mode gui icinfo.o -L$(DLLDIR) -lmsvfw32 -lkernel32 aviinfo.exe.so: aviinfo.o aviinfo.exe.spec.o - $(LDSHARED) $(LDDLLFLAGS) -o $@ aviinfo.o aviinfo.exe.spec.o $(ALL_LIBS) -lc + $(LDDLL) -o $@ aviinfo.o aviinfo.exe.spec.o $(ALL_LIBS) -lc aviplay.exe.so: aviplay.o aviplay.exe.spec.o - $(LDSHARED) $(LDDLLFLAGS) -o $@ aviplay.o aviplay.exe.spec.o $(ALL_LIBS) -lc + $(LDDLL) -o $@ aviplay.o aviplay.exe.spec.o $(ALL_LIBS) -lc icinfo.exe.so: icinfo.o icinfo.exe.spec.o - $(LDSHARED) $(LDDLLFLAGS) -o $@ icinfo.o icinfo.exe.spec.o $(ALL_LIBS) -lc + $(LDDLL) -o $@ icinfo.o icinfo.exe.spec.o $(ALL_LIBS) -lc aviinfo.exe: aviinfo.o $(CC) -o $@ aviinfo.o -lkernel32 $(ALL_LIBS)