humzakt commented on issue #859: URL: https://github.com/apache/age/issues/859#issuecomment-1527102686
When you see #include statements like #include "postgres.h" and #include "fmgr.h" in the age.c file, it means that the source code relies on the header files postgres.h and fmgr.h provided by the PostgreSQL source code. The PostgreSQL build system uses the Makefile to specify the necessary include paths, libraries, and compilation flags. When compiling the Apache AGE extension, the PostgreSQL build system will automatically include the required header files from the PostgreSQL source code. The Makefile or Makefile.in (if using autoconf) in the Apache AGE extension should have a line similar to the following: `PG_CPPFLAGS = -I$(libpq_srcdir)` This line specifies that the PostgreSQL header files should be included from the libpq_srcdir directory, which is defined in the pg_config output. This allows the build system to find the required PostgreSQL header files without having to move them around manually. To build the extension, you should use the make command along with the appropriate PostgreSQL build environment. The pg_config tool provides information about the installed PostgreSQL instance, including the include paths and library paths. To ensure the correct paths are used when building the extension, you should use the pgxs build infrastructure. In the extension's Makefile, you'll typically find a line like: `PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS)` This sets up the necessary build environment for your extension, including the proper include paths for the PostgreSQL header files. In summary, you don't need to move the header files around as long as your build environment is set up correctly with the appropriate PostgreSQL paths. The Makefile and pg_config tool handle locating the required header files during the build process. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
