summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2001-09-23 13:32:24 +0000
committerPeter Eisentraut2001-09-23 13:32:24 +0000
commit091a7659d4bce29017365e71deb74abf19a62513 (patch)
treef83459e28a99bbd716bf97b2c4ad384c7bbbd61c
parentbb2bf2d401cba3af61792b95941ee6a368ad8d56 (diff)
Don't refer to odbcinst.ini by absolute path. SQLGetPrivateProfileString
handles this. Don't install our own odbcinst.ini. That's the driver manager's business.
-rw-r--r--src/interfaces/odbc/GNUmakefile9
-rw-r--r--src/interfaces/odbc/dlg_specific.h14
-rw-r--r--src/interfaces/odbc/gpps.c8
3 files changed, 14 insertions, 17 deletions
diff --git a/src/interfaces/odbc/GNUmakefile b/src/interfaces/odbc/GNUmakefile
index 8585f57cfef..e92d7b75bf7 100644
--- a/src/interfaces/odbc/GNUmakefile
+++ b/src/interfaces/odbc/GNUmakefile
@@ -2,7 +2,7 @@
#
# GNUMakefile for psqlodbc (Postgres ODBC driver)
#
-# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.20 2001/09/22 22:54:32 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.21 2001/09/23 13:32:24 petere Exp $
#
#-------------------------------------------------------------------------
@@ -19,7 +19,7 @@ endif
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 27
-override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
+override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
@@ -40,6 +40,7 @@ SHLIB_LINK += -liodbcinst
endif
ifeq ($(with_unixodbc)$(with_iodbc),nono)
OBJS += gpps.o
+override CPPFLAGS += -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
endif
all: all-lib
@@ -54,16 +55,14 @@ LINK.shared += $(shlib_symbolic)
install: all installdirs
- $(INSTALL_DATA) $(srcdir)/odbcinst.ini $(DESTDIR)$(odbcinst_ini_dir)/odbcinst.ini
$(INSTALL_DATA) $(srcdir)/odbc.sql $(DESTDIR)$(datadir)/odbc.sql
$(MAKE) install-lib
installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(odbcinst_ini_dir) $(DESTDIR)$(datadir)
+ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(datadir)
uninstall: uninstall-lib
rm -f $(DESTDIR)$(datadir)/odbc.sql
-# XXX Uninstall the .ini file as well?
clean distclean maintainer-clean: clean-lib
rm -f $(OBJS)
diff --git a/src/interfaces/odbc/dlg_specific.h b/src/interfaces/odbc/dlg_specific.h
index 16a159c3d1a..4a221469b03 100644
--- a/src/interfaces/odbc/dlg_specific.h
+++ b/src/interfaces/odbc/dlg_specific.h
@@ -22,20 +22,14 @@
#define UNKNOWNS_AS_DONTKNOW 1
#define UNKNOWNS_AS_LONGEST 2
-/* INI File Stuff */
+/* ODBC initialization files */
#ifndef WIN32
#define ODBC_INI ".odbc.ini"
-#ifdef ODBCINSTDIR
-#define ODBCINST_INI ODBCINSTDIR "/odbcinst.ini"
+#define ODBCINST_INI "odbcinst.ini"
#else
-#define ODBCINST_INI "/etc/odbcinst.ini"
+#define ODBC_INI "ODBC.INI"
+#define ODBCINST_INI "ODBCINST.INI"
#endif
-#else /* WIN32 */
-#define ODBC_INI "ODBC.INI" /* ODBC initialization
- * file */
-#define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation
- * file */
-#endif /* WIN32 */
#define INI_DSN DBMS_NAME /* Name of default
diff --git a/src/interfaces/odbc/gpps.c b/src/interfaces/odbc/gpps.c
index 3f013bc5d2e..5128966c02d 100644
--- a/src/interfaces/odbc/gpps.c
+++ b/src/interfaces/odbc/gpps.c
@@ -43,12 +43,16 @@
#define FALSE ((BOOL)0)
#endif
+#ifndef ODBCINSTDIR
+#error "ODBCINSTDIR must be defined to compile this file"
+#endif
+
/*
* theIniFileName is searched for in:
* $HOME/theIniFileName
* theIniFileName
- * ODBCINST_INI
+ * ODBCINSTDIR/ODBCINST_INI
*/
DWORD
GetPrivateProfileString(const char *theSection, /* section name */
@@ -102,7 +106,7 @@ GetPrivateProfileString(const char *theSection, /* section name */
{
aFile = (FILE *) fopen(theIniFileName, PG_BINARY_R);
if (!aFile)
- aFile = (FILE *) fopen(ODBCINST_INI, PG_BINARY_R);
+ aFile = (FILE *) fopen(ODBCINSTDIR "/" ODBCINST_INI, PG_BINARY_R);
}
aLength = (theDefault == NULL) ? 0 : strlen(theDefault);