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
1ac1bea0
Commit
1ac1bea0
authored
May 20, 2008
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust -Wl,--asneeded test to avoid using the switch if it breaks
libreadline. What we will do for compatibility :-(
parent
9f194709
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
172 additions
and
136 deletions
+172
-136
config/c-compiler.m4
config/c-compiler.m4
+4
-2
configure
configure
+142
-118
configure.in
configure.in
+26
-16
No files found.
config/c-compiler.m4
View file @
1ac1bea0
# Macros to detect C compiler features
# $PostgreSQL: pgsql/config/c-compiler.m4,v 1.1
7 2008/05/18 20:13:12
tgl Exp $
# $PostgreSQL: pgsql/config/c-compiler.m4,v 1.1
8 2008/05/20 03:30:21
tgl Exp $
# PGAC_C_SIGNED
...
...
@@ -117,11 +117,13 @@ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
# ------------------------
# Given a string, check if the compiler supports the string as a
# command-line option. If it does, add the string to LDFLAGS.
# For reasons you'd really rather not know about, this checks whether
# you can link to a particular function, not just whether you can link.
AC_DEFUN([PGAC_PROG_CC_LDFLAGS_OPT],
[AC_MSG_CHECKING([if $CC supports $1])
pgac_save_LDFLAGS=$LDFLAGS
LDFLAGS="$pgac_save_LDFLAGS $1"
AC_LINK_IFELSE([AC_LANG_
PROGRAM(
)],
AC_LINK_IFELSE([AC_LANG_
CALL([],[$2]
)],
AC_MSG_RESULT(yes),
[LDFLAGS="$pgac_save_LDFLAGS"
AC_MSG_RESULT(no)])
...
...
configure
View file @
1ac1bea0
...
...
@@ -3977,9 +3977,6 @@ echo "$as_me: error: --enable-profiling is supported only when using GCC" >&2;}
fi
fi
{
echo
"
$as_me
:
$LINENO
: using CFLAGS=
$CFLAGS
"
>
&5
echo
"
$as_me
: using CFLAGS=
$CFLAGS
"
>
&6
;
}
# We already have this in Makefile.win32, but configure needs it too
if
test
"
$PORTNAME
"
=
"win32"
;
then
CPPFLAGS
=
"
$CPPFLAGS
-I
$srcdir
/src/include/port/win32 -DEXEC_BACKEND"
...
...
@@ -4318,116 +4315,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# If compiler will take -Wl,--as-needed then add that to LDFLAGS.
# This is much easier than trying to filter LIBS to the minimum for each
# executable. (Note that shared libraries won't use this switch, though.)
# On Darwin it's spelled -Wl,-dead_strip_dylibs, but don't try that elsewhere
if
test
"
$PORTNAME
"
!=
"darwin"
;
then
{
echo
"
$as_me
:
$LINENO
: checking if
$CC
supports -Wl,--as-needed"
>
&5
echo
$ECHO_N
"checking if
$CC
supports -Wl,--as-needed...
$ECHO_C
"
>
&6
;
}
pgac_save_LDFLAGS
=
$LDFLAGS
LDFLAGS
=
"
$pgac_save_LDFLAGS
-Wl,--as-needed"
cat
>
conftest.
$ac_ext
<<
_ACEOF
/* confdefs.h. */
_ACEOF
cat
confdefs.h
>>
conftest.
$ac_ext
cat
>>
conftest.
$ac_ext
<<
_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
if
{
(
ac_try
=
"
$ac_link
"
case
"((
$ac_try
"
in
*
\"
*
|
*
\`
*
|
*
\\
*
)
ac_try_echo
=
\$
ac_try
;;
*
)
ac_try_echo
=
$ac_try
;;
esac
eval
"echo
\"\$
as_me:
$LINENO
:
$ac_try_echo
\"
"
)
>
&5
(
eval
"
$ac_link
"
)
2>conftest.er1
ac_status
=
$?
grep
-v
'^ *+'
conftest.er1
>
conftest.err
rm
-f
conftest.er1
cat
conftest.err
>
&5
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
test
-z
"
$ac_c_werror_flag
"
||
test
!
-s
conftest.err
}
&&
test
-s
conftest
$ac_exeext
&&
$as_test_x
conftest
$ac_exeext
;
then
{
echo
"
$as_me
:
$LINENO
: result: yes"
>
&5
echo
"
${
ECHO_T
}
yes"
>
&6
;
}
else
echo
"
$as_me
: failed program was:"
>
&5
sed
's/^/| /'
conftest.
$ac_ext
>
&5
LDFLAGS
=
"
$pgac_save_LDFLAGS
"
{
echo
"
$as_me
:
$LINENO
: result: no"
>
&5
echo
"
${
ECHO_T
}
no"
>
&6
;
}
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest_ipa8_conftest.oo
\
conftest
$ac_exeext
conftest.
$ac_ext
else
{
echo
"
$as_me
:
$LINENO
: checking if
$CC
supports -Wl,-dead_strip_dylibs"
>
&5
echo
$ECHO_N
"checking if
$CC
supports -Wl,-dead_strip_dylibs...
$ECHO_C
"
>
&6
;
}
pgac_save_LDFLAGS
=
$LDFLAGS
LDFLAGS
=
"
$pgac_save_LDFLAGS
-Wl,-dead_strip_dylibs"
cat
>
conftest.
$ac_ext
<<
_ACEOF
/* confdefs.h. */
_ACEOF
cat
confdefs.h
>>
conftest.
$ac_ext
cat
>>
conftest.
$ac_ext
<<
_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
if
{
(
ac_try
=
"
$ac_link
"
case
"((
$ac_try
"
in
*
\"
*
|
*
\`
*
|
*
\\
*
)
ac_try_echo
=
\$
ac_try
;;
*
)
ac_try_echo
=
$ac_try
;;
esac
eval
"echo
\"\$
as_me:
$LINENO
:
$ac_try_echo
\"
"
)
>
&5
(
eval
"
$ac_link
"
)
2>conftest.er1
ac_status
=
$?
grep
-v
'^ *+'
conftest.er1
>
conftest.err
rm
-f
conftest.er1
cat
conftest.err
>
&5
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
test
-z
"
$ac_c_werror_flag
"
||
test
!
-s
conftest.err
}
&&
test
-s
conftest
$ac_exeext
&&
$as_test_x
conftest
$ac_exeext
;
then
{
echo
"
$as_me
:
$LINENO
: result: yes"
>
&5
echo
"
${
ECHO_T
}
yes"
>
&6
;
}
else
echo
"
$as_me
: failed program was:"
>
&5
sed
's/^/| /'
conftest.
$ac_ext
>
&5
LDFLAGS
=
"
$pgac_save_LDFLAGS
"
{
echo
"
$as_me
:
$LINENO
: result: no"
>
&5
echo
"
${
ECHO_T
}
no"
>
&6
;
}
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest_ipa8_conftest.oo
\
conftest
$ac_exeext
conftest.
$ac_ext
fi
# Create compiler version string
if
test
x
"
$GCC
"
=
x
"yes"
;
then
cc_string
=
"GCC
`
${
CC
}
--version
|
sed
q
`
"
...
...
@@ -5596,11 +5483,6 @@ rm -f conftest*
CPPFLAGS
=
"
$CPPFLAGS
$INCLUDES
"
LDFLAGS
=
"
$LDFLAGS
$LIBDIRS
"
{
echo
"
$as_me
:
$LINENO
: using CPPFLAGS=
$CPPFLAGS
"
>
&5
echo
"
$as_me
: using CPPFLAGS=
$CPPFLAGS
"
>
&6
;
}
{
echo
"
$as_me
:
$LINENO
: using LDFLAGS=
$LDFLAGS
"
>
&5
echo
"
$as_me
: using LDFLAGS=
$LDFLAGS
"
>
&6
;
}
...
...
@@ -25749,6 +25631,148 @@ echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;}
fi
fi
# If compiler will take -Wl,--as-needed then add that to LDFLAGS.
# This is much easier than trying to filter LIBS to the minimum for each
# executable. (Note that shared libraries won't use this switch, though.)
# On (at least) some Red-Hat-derived systems, this switch breaks linking to
# libreadline; therefore we postpone testing it until we know what library
# dependencies readline has. The test code will try to link with $LIBS.
if
test
"
$with_readline
"
=
yes
;
then
link_test_func
=
readline
else
link_test_func
=
exit
fi
if
test
"
$PORTNAME
"
!=
"darwin"
;
then
{
echo
"
$as_me
:
$LINENO
: checking if
$CC
supports -Wl,--as-needed"
>
&5
echo
$ECHO_N
"checking if
$CC
supports -Wl,--as-needed...
$ECHO_C
"
>
&6
;
}
pgac_save_LDFLAGS
=
$LDFLAGS
LDFLAGS
=
"
$pgac_save_LDFLAGS
-Wl,--as-needed"
cat
>
conftest.
$ac_ext
<<
_ACEOF
/* confdefs.h. */
_ACEOF
cat
confdefs.h
>>
conftest.
$ac_ext
cat
>>
conftest.
$ac_ext
<<
_ACEOF
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char
$link_test_func
();
int
main ()
{
return
$link_test_func
();
;
return 0;
}
_ACEOF
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
if
{
(
ac_try
=
"
$ac_link
"
case
"((
$ac_try
"
in
*
\"
*
|
*
\`
*
|
*
\\
*
)
ac_try_echo
=
\$
ac_try
;;
*
)
ac_try_echo
=
$ac_try
;;
esac
eval
"echo
\"\$
as_me:
$LINENO
:
$ac_try_echo
\"
"
)
>
&5
(
eval
"
$ac_link
"
)
2>conftest.er1
ac_status
=
$?
grep
-v
'^ *+'
conftest.er1
>
conftest.err
rm
-f
conftest.er1
cat
conftest.err
>
&5
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
test
-z
"
$ac_c_werror_flag
"
||
test
!
-s
conftest.err
}
&&
test
-s
conftest
$ac_exeext
&&
$as_test_x
conftest
$ac_exeext
;
then
{
echo
"
$as_me
:
$LINENO
: result: yes"
>
&5
echo
"
${
ECHO_T
}
yes"
>
&6
;
}
else
echo
"
$as_me
: failed program was:"
>
&5
sed
's/^/| /'
conftest.
$ac_ext
>
&5
LDFLAGS
=
"
$pgac_save_LDFLAGS
"
{
echo
"
$as_me
:
$LINENO
: result: no"
>
&5
echo
"
${
ECHO_T
}
no"
>
&6
;
}
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest_ipa8_conftest.oo
\
conftest
$ac_exeext
conftest.
$ac_ext
else
# On Darwin it's spelled -Wl,-dead_strip_dylibs, but don't try that elsewhere
{
echo
"
$as_me
:
$LINENO
: checking if
$CC
supports -Wl,-dead_strip_dylibs"
>
&5
echo
$ECHO_N
"checking if
$CC
supports -Wl,-dead_strip_dylibs...
$ECHO_C
"
>
&6
;
}
pgac_save_LDFLAGS
=
$LDFLAGS
LDFLAGS
=
"
$pgac_save_LDFLAGS
-Wl,-dead_strip_dylibs"
cat
>
conftest.
$ac_ext
<<
_ACEOF
/* confdefs.h. */
_ACEOF
cat
confdefs.h
>>
conftest.
$ac_ext
cat
>>
conftest.
$ac_ext
<<
_ACEOF
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char
$link_test_func
();
int
main ()
{
return
$link_test_func
();
;
return 0;
}
_ACEOF
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
if
{
(
ac_try
=
"
$ac_link
"
case
"((
$ac_try
"
in
*
\"
*
|
*
\`
*
|
*
\\
*
)
ac_try_echo
=
\$
ac_try
;;
*
)
ac_try_echo
=
$ac_try
;;
esac
eval
"echo
\"\$
as_me:
$LINENO
:
$ac_try_echo
\"
"
)
>
&5
(
eval
"
$ac_link
"
)
2>conftest.er1
ac_status
=
$?
grep
-v
'^ *+'
conftest.er1
>
conftest.err
rm
-f
conftest.er1
cat
conftest.err
>
&5
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
test
-z
"
$ac_c_werror_flag
"
||
test
!
-s
conftest.err
}
&&
test
-s
conftest
$ac_exeext
&&
$as_test_x
conftest
$ac_exeext
;
then
{
echo
"
$as_me
:
$LINENO
: result: yes"
>
&5
echo
"
${
ECHO_T
}
yes"
>
&6
;
}
else
echo
"
$as_me
: failed program was:"
>
&5
sed
's/^/| /'
conftest.
$ac_ext
>
&5
LDFLAGS
=
"
$pgac_save_LDFLAGS
"
{
echo
"
$as_me
:
$LINENO
: result: no"
>
&5
echo
"
${
ECHO_T
}
no"
>
&6
;
}
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest_ipa8_conftest.oo
\
conftest
$ac_exeext
conftest.
$ac_ext
fi
# Begin output steps
{
echo
"
$as_me
:
$LINENO
: using CFLAGS=
$CFLAGS
"
>
&5
echo
"
$as_me
: using CFLAGS=
$CFLAGS
"
>
&6
;
}
{
echo
"
$as_me
:
$LINENO
: using CPPFLAGS=
$CPPFLAGS
"
>
&5
echo
"
$as_me
: using CPPFLAGS=
$CPPFLAGS
"
>
&6
;
}
{
echo
"
$as_me
:
$LINENO
: using LDFLAGS=
$LDFLAGS
"
>
&5
echo
"
$as_me
: using LDFLAGS=
$LDFLAGS
"
>
&6
;
}
# prepare build tree if outside source tree
# Note 1: test -ef might not exist, but it's more reliable than `pwd`.
# Note 2: /bin/pwd might be better than shell's built-in at getting
...
...
configure.in
View file @
1ac1bea0
dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.56
1 2008/05/18 20:13:1
2 tgl Exp $
dnl $PostgreSQL: pgsql/configure.in,v 1.56
2 2008/05/20 03:30:2
2 tgl Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
...
...
@@ -426,8 +426,6 @@ if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
fi
fi
AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
# We already have this in Makefile.win32, but configure needs it too
if test "$PORTNAME" = "win32"; then
CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND"
...
...
@@ -450,16 +448,6 @@ fi
AC_PROG_CPP
AC_SUBST(GCC)
# If compiler will take -Wl,--as-needed then add that to LDFLAGS.
# This is much easier than trying to filter LIBS to the minimum for each
# executable. (Note that shared libraries won't use this switch, though.)
# On Darwin it's spelled -Wl,-dead_strip_dylibs, but don't try that elsewhere
if test "$PORTNAME" != "darwin"; then
PGAC_PROG_CC_LDFLAGS_OPT([-Wl,--as-needed])
else
PGAC_PROG_CC_LDFLAGS_OPT([-Wl,-dead_strip_dylibs])
fi
# Create compiler version string
if test x"$GCC" = x"yes" ; then
cc_string="GCC `${CC} --version | sed q`"
...
...
@@ -773,9 +761,6 @@ AC_SUBST(ELF_SYS)
CPPFLAGS="$CPPFLAGS $INCLUDES"
LDFLAGS="$LDFLAGS $LIBDIRS"
AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS])
AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
AC_ARG_VAR(LDFLAGS_SL)
PGAC_PROG_LD
...
...
@@ -1712,6 +1697,31 @@ AC_MSG_WARN([*** skipping thread test on Win32])
fi
fi
# If compiler will take -Wl,--as-needed then add that to LDFLAGS.
# This is much easier than trying to filter LIBS to the minimum for each
# executable. (Note that shared libraries won't use this switch, though.)
# On (at least) some Red-Hat-derived systems, this switch breaks linking to
# libreadline; therefore we postpone testing it until we know what library
# dependencies readline has. The test code will try to link with $LIBS.
if test "$with_readline" = yes; then
link_test_func=readline
else
link_test_func=exit
fi
if test "$PORTNAME" != "darwin"; then
PGAC_PROG_CC_LDFLAGS_OPT([-Wl,--as-needed], $link_test_func)
else
# On Darwin it's spelled -Wl,-dead_strip_dylibs, but don't try that elsewhere
PGAC_PROG_CC_LDFLAGS_OPT([-Wl,-dead_strip_dylibs], $link_test_func)
fi
# Begin output steps
AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS])
AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
# prepare build tree if outside source tree
# Note 1: test -ef might not exist, but it's more reliable than `pwd`.
# Note 2: /bin/pwd might be better than shell's built-in at getting
...
...
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