summaryrefslogtreecommitdiff
path: root/src/makefiles/Makefile.freebsd
AgeCommit message (Collapse)Author
2022-12-06autoconf: Move export_dynamic determination to configureAndres Freund
Previously export_dynamic was set in src/makefiles/Makefile.$port. For solaris this required exporting with_gnu_ld. The determination of with_gnu_ld would be nontrivial to copy for meson PGXS compatibility. It's also nice to delete libtool.m4. This uses -Wl,--export-dynamic on all platforms, previously all platforms but FreeBSD used -Wl,-E. The likelihood of a name conflict seems lower with the longer spelling. Discussion: https://postgr.es/m/20221005200710.luvw5evhwf6clig6@awork3.anarazel.de
2022-10-07autoconf: Rely on ar supporting index creationAndres Freund
This way we don't need RANLIB anymore, making it a bit simpler for the meson build to generate Makefile.global for PGXS compatibility. FreeBSD, NetBSD, OpenBSD, the only platforms where we didn't use AROPT=crs, all have supported the 's' option for a long time. On macOS we ran ranlib after installing a static library. This was added a long time ago, in 58ad65ec2def. I cannot reproduce an issue in more recent macOS versions. This is removed now. Based on discussion with Tom, I left the 'touch' at the end of static libraries generation, added in 826eff57c4c, in place. While it looks like current versions of Apple's ar/ranlib don't need it, it was needed not too long ago. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/20221005200710.luvw5evhwf6clig6@awork3.anarazel.de
2022-03-25Refactor DLSUFFIX handlingPeter Eisentraut
Move DLSUFFIX from makefiles into header files for all platforms. Move the DLSUFFIX assignment from src/makefiles/ to src/templates/, have configure read it, and then substitute it into Makefile.global and pg_config.h. This avoids the need for all makefile rules that need it to locally set CPPFLAGS. It also resolves an inconsistent setup between the two Windows build systems. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/2f9861fb-8969-9005-7518-b8e60f2bead9@enterprisedb.com
2019-10-21Select CFLAGS_SL at configure time, not in platform-specific Makefiles.Tom Lane
Move the platform-dependent logic that sets CFLAGS_SL from src/makefiles/Makefile.foo to src/template/foo, so that the value is determined at configure time and thus is available while running configure's tests. On a couple of platforms this might save a few microseconds of build time by eliminating a test that make otherwise has to do over and over. Otherwise it's pretty much a wash for build purposes; in particular, this makes no difference to anyone who might be overriding CFLAGS_SL via a make option. This patch in itself does nothing with the value and thus should not change any behavior, though you'll probably have to re-run configure to get a correctly updated Makefile.global. We'll use the new configure variable in a follow-on patch. Per gripe from Kyotaro Horiguchi. Back-patch to all supported branches, because the follow-on patch is a portability bug fix. Discussion: https://postgr.es/m/20191010.144533.263180400.horikyota.ntt@gmail.com
2019-07-01Remove support for non-ELF BSD systemsPeter Eisentraut
This is long obsolete. Discussion: https://www.postgresql.org/message-id/8eacdc0d-123f-dbca-bacf-0a68766a4889@2ndquadrant.com
2019-02-04Move port-specific parts of with_temp_install to port makefile.Andrew Gierth
Rather than define ld_library_path_ver with a big nested $(if), just put the overriding values in the makefiles for the relevant ports. Also add a variable for port makefiles to append their own stuff to with_temp_install, and use it to set LD_LIBRARY_PATH_RPATH=1 on FreeBSD which is needed to make LD_LIBRARY_PATH override DT_RPATH if DT_RUNPATH is not set (which seems to depend in unpredictable ways on the choice of compiler, at least on my system). Backpatch for the benefit of anyone doing regression tests on FreeBSD. (For other platforms there should be no functional change.)
2019-01-02Ensure link commands list *.o files before LDFLAGS.Tom Lane
It's important for link commands to list *.o input files before -l switches for libraries, as library code may not get pulled into the link unless referenced by an earlier command-line entry. This is certainly necessary for static libraries (.a style). Apparently on some platforms it is also necessary for shared libraries, as reported by Donald Dong. We often put -l switches for within-tree libraries into LDFLAGS, meaning that link commands that list *.o files after LDFLAGS are hazardous. Most of our link commands got this right, but a few did not. In particular, places that relied on gmake's default implicit link rule failed, because that puts LDFLAGS first. Fix that by overriding the built-in rule with our own. The implicit link rules in src/makefiles/Makefile.* for single-.o-file shared libraries mostly got this wrong too, so fix them. I also changed the link rules for the backend and a couple of other places for consistency, even though they are not (currently) at risk because they aren't adding any -l switches to LDFLAGS. Arguably, the real problem here is that we're abusing LDFLAGS by putting -l switches in it and we should stop doing that. But changing that would be quite invasive, so I'm not eager to do so. Perhaps this is a candidate for back-patching, but so far it seems that problems can only be exhibited in test code we don't normally build, and at least some of the problems are new in HEAD anyway. So I'll refrain for now. Donald Dong and Tom Lane Discussion: https://postgr.es/m/CAKABAquXn-BF-vBeRZxhzvPyfMqgGuc74p8BmQZyCFDpyROBJQ@mail.gmail.com
2012-12-18Remove allow_nonpic_in_shlibPeter Eisentraut
This was used in a time when a shared libperl or libpython was difficult to come by. That is obsolete, and the idea behind the flag was never fully portable anyway and will likely fail on more modern CPU architectures.
2010-07-05Split the LDFLAGS make variable into two parts: LDFLAGS is now used forTom Lane
linking both executables and shared libraries, and we add on LDFLAGS_EX when linking executables or LDFLAGS_SL when linking shared libraries. This provides a significantly cleaner way of dealing with link-time switches than the former behavior. Also, make sure that the various platform-specific %.so: %.o rules incorporate LDFLAGS and LDFLAGS_SL; most of them missed that before. (I did not add these variables for the platforms that invoke $(LD) directly, however. It's not clear if we can do that safely, since for the most part we assume these variables use CC command-line syntax.) Per gripe from Aaron Swenson and subsequent investigation.
2008-11-14Set SQL man pages to be section 7 by default, and only transform them toPeter Eisentraut
another section if required by the platform (instead of the old way of building them in section "l" and always transforming them to the platform-specific section). This speeds up the installation on common platforms, and it avoids some funny business with the man page tools and build process.
2008-09-01Synchronize the shared object build rules in Makefile.port with Makefile.shlibPeter Eisentraut
somewhat by adding CFLAGS where the compiler is used and Makefile.shlib already used CFLAGS.
2006-04-19Remove use of lorder and tsort while building static libraries. There'sTom Lane
no evidence that any currently-supported platform needs this, and good reason to think that any platform that did need it couldn't use the static libraries anyway --- libpq, at least, has circular references. Removing the code shuts up tsort warnings about the circular references on some platforms.
2005-12-09Allow installation into directories containing spaces in the name.Peter Eisentraut
2005-08-24Back off allow_nonpic_in_shlib for FreeBSD builds: only set it on i386.Tom Lane
This might be overly conservative, but we know it does not work on amd64. Per buildfarm results.
2005-08-12Cleanups for FreeBSD linking (PIC) and plpython compiles.Bruce Momjian
FreeBSD ports, supplied by Jim C. Nasby
2004-12-21Add '-Wl,' prefix to linker switches consistently. Remove shlib_symbolicTom Lane
macros, which aren't used anywhere and haven't been for some time.
2004-11-19Modify the platform-specific makefiles so that macro 'rpath' is definedTom Lane
in terms of macro 'rpathdir', as I proposed a few weeks ago. In itself this commit shouldn't change the behavior at all, but it opens the door to using special rpaths for the PL shared libraries, as seems to be needed for plperl in particular.
2004-10-11Use -fPIC not -fpic for BSDen on Sparc. Also switch fromTom Lane
$(LD) -x -Bshareable to $(CC) -shared on OpenBSD (I suspect this should be carried over to the other two as well, but will refrain pending suggestions from people who actually use those platforms). Per Stefan Kaltenbrunner.
2001-08-29Install the SQL command man pages into a section appropriate for eachPeter Eisentraut
system. Some systems did not understand the 'l' section, and in general it wasn't entirely appropriate. On SCO OpenServer, the man pages won't be installed at all until someone figures out their man system.
2001-06-20Shared libraries should not be linked explicitly against -lc on FreeBSDPeter Eisentraut
(see http://mail.gnu.org/pipermail/libtool/2000-July/001824.html). But apparently it should still be present with -Bsymbolic.
2001-02-10Fix -Bsymbolic for FreeBSD and OpenBSD. NetBSD already had all these fixes.Bruce Momjian
2000-12-16Fix linker options for ODBC driver. See comment inPeter Eisentraut
src/interfaces/odbc/GNUmakefile.
2000-12-07Do not use 'ar cq' to build library archives, use 'ar cr' instead.Peter Eisentraut
2000-10-27Make use of system-specific linker option to embed shared library searchPeter Eisentraut
path into executables and shared libraries (-rpath or -R for most). Can be disabled with --disable-rpath, since some binary packaging standards do not like this option.
2000-10-21Move DLSUFFIX, AROPT, and CFLAGS_SL settings from template toPeter Eisentraut
Makefile.port, since they are of no use to configure and much of the library magic happens in Makefile.port anyway. Use __alpha, not __alpha__, since the former is universally available. Remove -DNOFIXADE from the compile command line and put it in the port include file.
2000-10-07Separate -Wl,-E or equivalent into separate make variable, since it's onlyPeter Eisentraut
necessary for the postgres/postmaster link, not every link.
1999-12-13New LDOUT makefile variable for QNX os.Bruce Momjian
1999-12-09Make LD -r as macros that can be changed for QNX.Bruce Momjian
1999-05-17Apply freebsd specific patches dealign with ELF system from FreeBSD'sMarc G. Fournier
ports collection ...
1998-11-02slight mods required for freebsd (elf vs aout stuff)Marc G. Fournier
1998-10-31Minor FreeBSD fixes put in placeMarc G. Fournier
From: SHIOZAKI Takehiko <takehi-s@ascii.co.jp> I tried snapshot(Oct30) and made some patches. # I think that it is confused to manage both Makefile.shlib and # makefiles/Makefile.*, don't you? * configure Now FreeBSD 2.X is not supported..., so I added its entry. If ELF_SYSTEM is set, gmake treat it defined even though it is "false". So nothing should be set to use "ifdef". BSD_SHLIB etc. may have same problems. * Makefile.shlib As you said, FreeBSD entry is much like BSD's. I only added ELF_SYSTEM code. * makefiles/Makefile.freebsd Ifdef/else/endif can not be indented with TABs.
1998-10-30Okay, this shoudl provide a fix for the freebsd problem...Marc G. Fournier
Added a ELF_SYS variable and check to configure.in...
1998-10-27Oops, don't forget to get rid ofthe -Bforcearchive option altogether...Marc G. Fournier
1998-10-27Starting with v3.0 of FreeBSD, we are now an elf system, and dont' have aMarc G. Fournier
-Bforcearchive flag for ld... Give FreeBSD its own special Makefile to get around the "bug"