Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
Add Mac OSX support [Florian G. Pflug]
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.pgadmin.org/branches/REL-1_2_0_PATCHES@4182 a7884b65-44f6-0310-8a51-81a127f17b15
  • Loading branch information
dpage committed May 13, 2005
1 parent 87c1a19 commit 5a48158
Show file tree
Hide file tree
Showing 16 changed files with 726 additions and 16 deletions.
9 changes: 7 additions & 2 deletions Makefile.am
Expand Up @@ -3,7 +3,7 @@
# This software is released under the Artistic Licence
#
# Makefile - Makefile for *nix systems
SUBDIRS = src
SUBDIRS = src pkg
EXTRA_DIST = \
README.txt \
BUGS.txt \
Expand Down Expand Up @@ -35,7 +35,7 @@ EXTRA_DIST = \
pkg/win32/licence.rtf \
pkg/win32/pgadmin3.wsi

nobase_dist_pkgdata_DATA = \
TMP_docs = \
docs/en_US/pg/*.html \
docs/en_US/pg/*.css \
docs/en_US/images/*.png \
Expand All @@ -44,3 +44,8 @@ nobase_dist_pkgdata_DATA = \
docs/en_US/pgadmin3.hh* \
docs/en_US/tips.txt

if !APPBUNDLE
nobase_dist_pkgdata_DATA = $(TMP_docs)
else
nobase_dist_data_DATA = $(TMP_docs)
endif
74 changes: 63 additions & 11 deletions acinclude.m4
Expand Up @@ -53,6 +53,7 @@ CFLAGS="-Wall -g -O0"
CXXFLAGS="-Wall -g -O0"],
[pg_debug_build=no])
])
AC_SUBST(pg_debug_build)

############################
# Static build of pgAdmin3 #
Expand All @@ -64,6 +65,22 @@ AC_DEFUN([ENABLE_STATIC],
[pg_static_build=no])
])

############################
# Build an pgAdmin III.app #
############################
AC_DEFUN([ENABLE_APPBUNDLE],
[AC_ARG_ENABLE(appbundle,
[ --enable-appbundle Build pgAdmin3.app],
[pg_appbundle=yes
prefix=$(pwd)/tmp
bundledir="$(pwd)/pgAdmin3.app"
bindir="$bundledir/Contents/MacOS"
datadir="$bundledir/Contents/SharedSupport"
AC_SUBST(bundledir)
],
[pg_appbundle=no])
])

########################################
# Check for PostgreSQL library (libpq) #
########################################
Expand Down Expand Up @@ -115,7 +132,18 @@ then
AC_LANG_SAVE
AC_LANG_C
AC_CHECK_LIB(pq, PQexec, [pgsql_cv_libpq=yes], [pgsql_cv_libpq=no])
AC_CHECK_LIB(pq, SSL_connect, [pgsql_ssl_libpq=yes], [pgsql_ssl_libpq=no])
if test "$build_cpu-$build_vendor" = "powerpc-apple"; then
echo -n "Checking if libpq links against libssl: "
if test "$(otool -L ${LIBPQ_HOME}/lib/libpq.?.dylib | grep -c libssl)" -gt 0
then
pgsql_ssl_libpq="yes"
else
pgsql_ssl_libpq="no"
fi
echo $pgsql_ssl_libpq
else
AC_CHECK_LIB(pq, SSL_connect, [pgsql_ssl_libpq=yes], [pgsql_ssl_libpq=no])
fi
AC_LANG_RESTORE
if test "$pgsql_include" != ""
Expand All @@ -127,11 +155,18 @@ then
if test "$pg_static_build" = "yes"
then
if test "$build_cpu-$build_vendor" = "powerpc-apple"
then
CRYPT_LIB=""
else
CRYPT_LIB="-lcrypt"
fi
if test "$pgsql_ssl_libpq" = "yes"
then
LIBS="${LIBPQ_HOME}/lib/libpq.a -lcrypt $LIBS -lssl -lcrypto"
LIBS="${LIBPQ_HOME}/lib/libpq.a $CRYPT_LIB $LIBS -lssl -lcrypto"
else
LIBS="${LIBPQ_HOME}/lib/libpq.a -lcrypt $LIBS -lcrypto"
LIBS="${LIBPQ_HOME}/lib/libpq.a $CRYPT_LIB $LIBS -lcrypto"
fi
else
if test "$pgsql_ssl_libpq" = "yes"
Expand Down Expand Up @@ -184,10 +219,10 @@ else
fi], [
AC_MSG_RESULT(yes)
WX_HOME=/usr/local/wx2
if test ! -f "${WX_HOME}/include/wx-2.5/wx/wx.h"
if test ! -f "${WX_HOME}/include/wx-2.5/wx/wx.h" -a ! -f "${WX_HOME}/include/wx-2.6/wx/wx.h"
then
WX_HOME=/usr/local
if test ! -f "${WX_HOME}/include/wx-2.5/wx/wx.h"
if test ! -f "${WX_HOME}/include/wx-2.5/wx/wx.h" -a ! -f "${WX_HOME}/include/wx-2.6/wx/wx.h"
then
WX_HOME=/usr
fi
Expand Down Expand Up @@ -237,12 +272,12 @@ then
# Which version of wxWindows is this?
WX_VERSION=`${WX_CONFIG} --version`
case "${WX_VERSION}" in
2.6*)
WX_VERSION="2.6"
;;
2.5*)
WX_VERSION="2.5"
;;
2.4*)
WX_VERSION="2.4"
;;
*)
;;
esac
Expand Down Expand Up @@ -295,6 +330,14 @@ then
LIBS="$LIBS ${WX_HOME}/lib/libwx_mac_stc-${WX_VERSION}.a"
LIBS="$LIBS $WX_NEW_LDFLAGS"
;;
*libwx_macu-*)
LIBS="$LIBS ${WX_HOME}/lib/libwx_macu_stc-${WX_VERSION}.a ${WX_HOME}/lib/libwx_macu_ogl-${WX_VERSION}.a"
LIBS="$LIBS $WX_NEW_LDFLAGS"
;;
*libwx_macu_core*)
LIBS="$LIBS ${WX_HOME}/lib/libwx_macu_stc-${WX_VERSION}.a ${WX_HOME}/lib/libwx_macu_ogl-${WX_VERSION}.a"
LIBS="$LIBS $WX_NEW_LDFLAGS"
;;
*libwx_gtk2ud-*)
LIBS="$LIBS ${WX_HOME}/lib/libwx_gtk2ud_stc-${WX_VERSION}.a"
LIBS="$LIBS $WX_NEW_LDFLAGS"
Expand Down Expand Up @@ -392,6 +435,14 @@ then
LIBS="$LIBS -lwx_mac_stc-${WX_VERSION}"
LIBS="$LIBS $WX_NEW_LDFLAGS"
;;
*wx_macu-*)
LIBS="$LIBS -lwx_macu_stc-${WX_VERSION} -lwx_macu_ogl-${WX_VERSION}"
LIBS="$LIBS $WX_NEW_LDFLAGS"
;;
*wx_macu_core*)
LIBS="$LIBS -lwx_macu_stc-${WX_VERSION} -lwx_macu_ogl-${WX_VERSION}"
LIBS="$LIBS $WX_NEW_LDFLAGS"
;;
*wx_gtk2ud-*)
LIBS="$LIBS -lwx_gtk2ud_stc-${WX_VERSION}"
LIBS="$LIBS $WX_NEW_LDFLAGS"
Expand Down Expand Up @@ -450,7 +501,7 @@ then
fi
WX_NEW_CPPFLAGS=`${WX_CONFIG} --cxxflags`
CPPFLAGS="$CPPFLAGS $WX_NEW_CPPFLAGS -I${WX_HOME}/include/wx-2.5"
CPPFLAGS="$CPPFLAGS $WX_NEW_CPPFLAGS -I${WX_HOME}/include/wx-${WX_VERSION}"
case "${host}" in
*-apple-darwin*)
CPPFLAGS="$CPPFLAGS -no-cpp-precomp -fno-rtti"
Expand All @@ -459,11 +510,11 @@ then
;;
esac
wx_wx_h="yes"
if test ! -f "${WX_HOME}/include/wx-2.5/wx/version.h"
if test ! -f "${WX_HOME}/include/wx-${WX_VERSION}/wx/version.h"
then
wx_wx_h="no"
fi
if test ! -f "${WX_HOME}/include/wx-2.5/wx/stc/stc.h"
if test ! -f "${WX_HOME}/include/wx-${WX_VERSION}/wx/stc/stc.h"
then
AC_MSG_ERROR([you need to install the stc package from wxWindows/contrib/src/stc])
wx_wx_h="no"
Expand All @@ -481,3 +532,4 @@ then
fi
fi
])
AC_SUBST(WX_CONFIG)
6 changes: 5 additions & 1 deletion configure.ac
Expand Up @@ -30,6 +30,8 @@ AC_FUNC_STRTOD
AC_CHECK_FUNCS([gethostbyname inet_ntoa memmove memset strchr])

# Custom checks
ENABLE_APPBUNDLE
AM_CONDITIONAL([APPBUNDLE], [test x$pg_appbundle = xyes])
CHECK_WX_CONFIG_BINARY
CHECK_PGSQL_INCLUDE
ENABLE_DEBUG
Expand All @@ -38,5 +40,7 @@ CHECK_PGSQL
CHECK_WXWINDOWS

AC_CONFIG_FILES([Makefile
src/Makefile])
src/Makefile
pkg/Makefile
pkg/mac/Makefile])
AC_OUTPUT
24 changes: 24 additions & 0 deletions pkg/mac/Info-Debug.plist
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>pgAdmin3-Debug</string>
<key>CFBundleIdentifier</key>
<string>org.postgresql.pgadmin3</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>1.2</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>CFBundleIconFile</key>
<string>pgAdmin3-Debug.icns</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>
24 changes: 24 additions & 0 deletions pkg/mac/Info.plist
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>pgAdmin3</string>
<key>CFBundleIdentifier</key>
<string>org.postgresql.pgadmin3</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>1.2</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>CFBundleIconFile</key>
<string>pgAdmin3.icns</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>

0 comments on commit 5a48158

Please sign in to comment.