Thread: Need for DLLINIT in Makefile.shlib

Need for DLLINIT in Makefile.shlib

From
Bruce Momjian
Date:
I am curious why Cygwin needs DLLINIT in Makefile.shlib, and Win32
doesn't:

    # Cygwin case
    $(shlib) lib$(NAME).a: $(OBJS) $(DLLINIT)
            $(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)
            $(DLLWRAP) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(DLLINIT)
$(SHLIB_LINK)
            $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a

    $(DLLINIT): $(DLLINIT:%.o=%.c)
            $(MAKE) -C $(@D) $(@F)

    endif # PORTNAME == cygwin

    else # PORTNAME == win32

    # win32 case
    $(shlib) lib$(NAME).a: $(OBJS)
            $(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)
            $(DLLWRAP) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(SHLIB_LINK)
            $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a

    endif # PORTNAME == win32

The only difference I see is that Cygwin uses $(DLLINIT) while Win32 does
not.  Is that correct?  Why?

Both set DLLINIT in their makefiles:

    DLLINIT = $(top_builddir)/src/utils/dllinit.o

Could they be merged into a single snipped of code?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Need for DLLINIT in Makefile.shlib

From
Reini Urban
Date:
Bruce Momjian schrieb:
> I am curious why Cygwin needs DLLINIT in Makefile.shlib, and Win32
> doesn't:
>
>     # Cygwin case
>     $(shlib) lib$(NAME).a: $(OBJS) $(DLLINIT)
>             $(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)
>             $(DLLWRAP) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(DLLINIT)
$(SHLIB_LINK)
>             $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a
>
>     $(DLLINIT): $(DLLINIT:%.o=%.c)
>             $(MAKE) -C $(@D) $(@F)
>
>     endif # PORTNAME == cygwin
>
>     else # PORTNAME == win32
>
>     # win32 case
>     $(shlib) lib$(NAME).a: $(OBJS)
>             $(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)
>             $(DLLWRAP) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(SHLIB_LINK)
>             $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a
>
>     endif # PORTNAME == win32
>
> The only difference I see is that Cygwin uses $(DLLINIT) while Win32 does
> not.  Is that correct?  Why?
>
> Both set DLLINIT in their makefiles:
>
>     DLLINIT = $(top_builddir)/src/utils/dllinit.o
>
> Could they be merged into a single snipped of code?

Good point!
Out of my head: I don't think that we (cygwin) don't need that anymore.
With newer binutils it should get autogenerated. But I'll have to test
before you can remove that dir.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

Re: [CYGWIN] Need for DLLINIT in Makefile.shlib

From
Jason Tishler
Date:
On Tue, Oct 12, 2004 at 01:37:48AM +0200, Reini Urban wrote:
> Bruce Momjian schrieb:
> >I am curious why Cygwin needs DLLINIT in Makefile.shlib, and Win32
> >doesn't:
> >
> >    [snip]
> >
> >The only difference I see is that Cygwin uses $(DLLINIT) while Win32
> >does not.  Is that correct?  Why?
> >
> >Both set DLLINIT in their makefiles:
> >
> >    DLLINIT = $(top_builddir)/src/utils/dllinit.o
> >
> >Could they be merged into a single snipped of code?
>
> Good point!  Out of my head: I don't think that we (cygwin) don't need
> that anymore.  With newer binutils it should get autogenerated. But
> I'll have to test before you can remove that dir.

I concur with Reini.  The DLLINIT stuff is a vestige from b20.1.  FWIW,
I attempted to remove it 3 - 4 years ago, but was unsuccessful...

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: [CYGWIN] Need for DLLINIT in Makefile.shlib

From
Reini Urban
Date:
Jason Tishler schrieb:
> On Tue, Oct 12, 2004 at 01:37:48AM +0200, Reini Urban wrote:
>>Bruce Momjian schrieb:
>>
>>>I am curious why Cygwin needs DLLINIT in Makefile.shlib, and Win32
>>>doesn't:
>>>
>>>    [snip]
>>>
>>>The only difference I see is that Cygwin uses $(DLLINIT) while Win32
>>>does not.  Is that correct?  Why?
>>>
>>>Both set DLLINIT in their makefiles:
>>>
>>>    DLLINIT = $(top_builddir)/src/utils/dllinit.o
>>>
>>>Could they be merged into a single snipped of code?
>>
>>Good point!  Out of my head: I don't think that we (cygwin) don't need
>>that anymore.  With newer binutils it should get autogenerated. But
>>I'll have to test before you can remove that dir.
>
>
> I concur with Reini.  The DLLINIT stuff is a vestige from b20.1.  FWIW,
> I attempted to remove it 3 - 4 years ago, but was unsuccessful...

I build successfully without this DLLINIT yestreday, and ran then into
the one remaining regression error, which I reported before (during
inserting some polygons in the parallel suite).

But this is for sure not related, so you can safely clean that mess up,
(remove that dir) and merge the win32 and cygwin makefile recipe.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

Re: [CYGWIN] Need for DLLINIT in Makefile.shlib

From
Bruce Momjian
Date:
OK, I removed DLLINIT from Cygwin Makefile.shlib so it is now the same
as Win32.  I don't see any easy way to use ifeq to test multiple port
strings so I didn't merge the duplicate Win32 and Cygwin Makefile
actions.

---------------------------------------------------------------------------

Reini Urban wrote:
> Jason Tishler schrieb:
> > On Tue, Oct 12, 2004 at 01:37:48AM +0200, Reini Urban wrote:
> >>Bruce Momjian schrieb:
> >>
> >>>I am curious why Cygwin needs DLLINIT in Makefile.shlib, and Win32
> >>>doesn't:
> >>>
> >>>    [snip]
> >>>
> >>>The only difference I see is that Cygwin uses $(DLLINIT) while Win32
> >>>does not.  Is that correct?  Why?
> >>>
> >>>Both set DLLINIT in their makefiles:
> >>>
> >>>    DLLINIT = $(top_builddir)/src/utils/dllinit.o
> >>>
> >>>Could they be merged into a single snipped of code?
> >>
> >>Good point!  Out of my head: I don't think that we (cygwin) don't need
> >>that anymore.  With newer binutils it should get autogenerated. But
> >>I'll have to test before you can remove that dir.
> >
> >
> > I concur with Reini.  The DLLINIT stuff is a vestige from b20.1.  FWIW,
> > I attempted to remove it 3 - 4 years ago, but was unsuccessful...
>
> I build successfully without this DLLINIT yestreday, and ran then into
> the one remaining regression error, which I reported before (during
> inserting some polygons in the parallel suite).
>
> But this is for sure not related, so you can safely clean that mess up,
> (remove that dir) and merge the win32 and cygwin makefile recipe.
> --
> Reini Urban
> http://xarch.tu-graz.ac.at/home/rurban/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073