Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
cc07f8cf
Commit
cc07f8cf
authored
Aug 01, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a C version of pg_config.
Andrew Dunstan
parent
7510ac62
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
104 deletions
+55
-104
src/bin/pg_config/Makefile
src/bin/pg_config/Makefile
+14
-16
src/bin/pg_config/pg_config.sh
src/bin/pg_config/pg_config.sh
+0
-83
src/include/port.h
src/include/port.h
+3
-1
src/port/Makefile
src/port/Makefile
+3
-1
src/port/path.c
src/port/path.c
+35
-3
No files found.
src/bin/pg_config/Makefile
View file @
cc07f8cf
# $PostgreSQL: pgsql/src/bin/pg_config/Makefile,v 1.
7 2004/07/30 12:26:40 petere
Exp $
# $PostgreSQL: pgsql/src/bin/pg_config/Makefile,v 1.
8 2004/08/01 06:56:38 momjian
Exp $
subdir
=
src/bin/pg_config
top_builddir
=
../../..
include
$(top_builddir)/src/Makefile.global
all
:
pg_config
OBJS
=
pg_config.o exec.o
pg_config
:
pg_config.sh $(top_builddir)/src/Makefile.global Makefile
sed
-e
's,@bindir@,
$(bindir)
,g'
\
-e
's,@includedir@,
$(includedir)
,g'
\
-e
's,@includedir_server@,
$(includedir_server)
,g'
\
-e
's,@libdir@,
$(libdir)
,g'
\
-e
's,@pkglibdir@,
$(pkglibdir)
,g'
\
-e
's,@pgxsdir@,
$(pgxsdir)
,g'
\
-e
"s|@configure@|
$(configure_args)
|g"
\
-e
's,@version@,
$(VERSION)
,g'
\
$<
>
$@
chmod
a+x
$@
override CPPFLAGS
:
= -DFRONTEND -I$(libpq_srcdir) -DVAL_CONFIGURE="
\"
$(configure_args)
\"
" $(CPPFLAGS)
all
:
submake-libpgport pg_config
exec.c
:
% : $(top_srcdir)/src/port/%
rm
-f
$@
&&
$(LN_S)
$<
.
pg_config
:
$(OBJS)
$(CC)
$(CFLAGS)
$(OBJS)
$(LDFLAGS)
$(LIBS)
-o
$@$(X)
install
:
all installdirs
$(INSTALL_SCRIPT)
pg_config
$(DESTDIR)$(bindir)
/pg_config
$(INSTALL_SCRIPT)
pg_config
$(X)
$(DESTDIR)$(bindir)
/pg_config
$(X)
installdirs
:
$(mkinstalldirs)
$(DESTDIR)$(bindir)
...
...
@@ -28,4 +26,4 @@ uninstall:
rm
-f
$(DESTDIR)$(bindir)
/pg_config
clean distclean maintainer-clean
:
rm
-f
pg_config
rm
-f
pg_config
$(X)
$(OBJS)
exec.c
src/bin/pg_config/pg_config.sh
deleted
100644 → 0
View file @
7510ac62
#! /bin/sh
# This shell script saves various pieces of information about the
# installed version of PostgreSQL. Packages that interface to
# PostgreSQL can use it to configure their build.
#
# Author: Peter Eisentraut <peter_e@gmx.net>
# Public domain
# $PostgreSQL: pgsql/src/bin/pg_config/pg_config.sh,v 1.10 2004/07/30 12:26:40 petere Exp $
me
=
`
basename
$0
`
# stored configuration values
val_bindir
=
'@bindir@'
val_includedir
=
'@includedir@'
val_includedir_server
=
'@includedir_server@'
val_libdir
=
'@libdir@'
val_pkglibdir
=
'@pkglibdir@'
val_pgxsdir
=
'@pgxsdir@'
val_configure
=
"@configure@"
val_version
=
'@version@'
help
=
"
\
$me
provides information about the installed version of PostgreSQL.
Usage:
$me
OPTION...
Options:
--bindir show location of user executables
--includedir show location of C header files of the client
interfaces
--includedir-server show location of C header files for the server
--libdir show location of object code libraries
--pkglibdir show location of dynamically loadable modules
--pgxs show location of extension makefile
--configure show options given to 'configure' script when
PostgreSQL was built
--version show the PostgreSQL version, then exit
--help show this help, then exit
Report bugs to <pgsql-bugs@postgresql.org>."
advice
=
"
\
Try
\"
$me
--help
\"
for more information."
if
test
"$#"
-eq
0
;
then
echo
"
$me
: argument required"
1>&2
echo
"
$advice
"
1>&2
exit
1
fi
show
=
for
opt
do
case
"
$opt
"
in
--bindir
)
show
=
"
$show
\$
val_bindir"
;;
--includedir
)
show
=
"
$show
\$
val_includedir"
;;
--includedir-server
)
show
=
"
$show
\$
val_includedir_server"
;;
--libdir
)
show
=
"
$show
\$
val_libdir"
;;
--pkglibdir
)
show
=
"
$show
\$
val_pkglibdir"
;;
--pgxs
)
show
=
"
$show
\$
val_pgxsdir/src/makefiles/pgxs.mk"
;;
--configure
)
show
=
"
$show
\$
val_configure"
;;
--version
)
echo
"PostgreSQL
$val_version
"
exit
0
;;
--help
|
-
\?
)
echo
"
$help
"
exit
0
;;
*
)
echo
"
$me
: invalid argument:
$opt
"
1>&2
echo
"
$advice
"
1>&2
exit
1
;;
esac
done
for
thing
in
$show
do
eval
"echo
$thing
"
done
# end of pg_config
src/include/port.h
View file @
cc07f8cf
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/port.h,v 1.4
6 2004/08/01 06:19:24
momjian Exp $
* $PostgreSQL: pgsql/src/include/port.h,v 1.4
7 2004/08/01 06:56:39
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -44,6 +44,8 @@ extern void get_share_path(const char *my_exec_path, char *ret_path);
extern
void
get_etc_path
(
const
char
*
my_exec_path
,
char
*
ret_path
);
extern
void
get_include_path
(
const
char
*
my_exec_path
,
char
*
ret_path
);
extern
void
get_pkginclude_path
(
const
char
*
my_exec_path
,
char
*
ret_path
);
extern
void
get_includeserver_path
(
const
char
*
my_exec_path
,
char
*
ret_path
);
extern
void
get_lib_path
(
const
char
*
my_exec_path
,
char
*
ret_path
);
extern
void
get_pkglib_path
(
const
char
*
my_exec_path
,
char
*
ret_path
);
extern
void
get_locale_path
(
const
char
*
my_exec_path
,
char
*
ret_path
);
extern
void
set_pglocale_pgservice
(
const
char
*
argv0
,
const
char
*
app
);
...
...
src/port/Makefile
View file @
cc07f8cf
...
...
@@ -7,7 +7,7 @@
# with broken/missing library files.
# IDENTIFICATION
# $PostgreSQL: pgsql/src/port/Makefile,v 1.1
5 2004/05/30 14:07:47
momjian Exp $
# $PostgreSQL: pgsql/src/port/Makefile,v 1.1
6 2004/08/01 06:56:39
momjian Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -35,6 +35,8 @@ pg_config_paths.h: $(top_builddir)/src/Makefile.global
echo
"#define SYSCONFDIR
\"
$(sysconfdir)
\"
"
>>
$@
echo
"#define INCLUDEDIR
\"
$(includedir)
\"
"
>>
$@
echo
"#define PKGINCLUDEDIR
\"
$(pkgincludedir)
\"
"
>>
$@
echo
"#define INCLUDEDIRSERVER
\"
$(includedir_server)
\"
"
>>
$@
echo
"#define LIBDIR
\"
$(libdir)
\"
"
>>
$@
echo
"#define PKGLIBDIR
\"
$(pkglibdir)
\"
"
>>
$@
echo
"#define LOCALEDIR
\"
$(localedir)
\"
"
>>
$@
...
...
src/port/path.c
View file @
cc07f8cf
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/path.c,v 1.2
5 2004/07/12 19:27:31
momjian Exp $
* $PostgreSQL: pgsql/src/port/path.c,v 1.2
6 2004/08/01 06:56:39
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -205,10 +205,42 @@ get_pkginclude_path(const char *my_exec_path, char *ret_path)
/*
* get_includeserver_path
*/
void
get_includeserver_path
(
const
char
*
my_exec_path
,
char
*
ret_path
)
{
const
char
*
p
;
if
((
p
=
relative_path
(
PGBINDIR
,
INCLUDEDIRSERVER
)))
make_relative
(
my_exec_path
,
p
,
ret_path
);
else
StrNCpy
(
ret_path
,
INCLUDEDIRSERVER
,
MAXPGPATH
);
canonicalize_path
(
ret_path
);
}
/*
* get_lib_path
*/
void
get_lib_path
(
const
char
*
my_exec_path
,
char
*
ret_path
)
{
const
char
*
p
;
if
((
p
=
relative_path
(
PGBINDIR
,
LIBDIR
)))
make_relative
(
my_exec_path
,
p
,
ret_path
);
else
StrNCpy
(
ret_path
,
LIBDIR
,
MAXPGPATH
);
canonicalize_path
(
ret_path
);
}
/*
* get_pkglib_path
*
* Return library path, either relative to /bin or hardcoded
*/
void
get_pkglib_path
(
const
char
*
my_exec_path
,
char
*
ret_path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment