Files
mercury/extras/odbc/Mmakefile
Julien Fischer 133d040411 Use a different library name for the ODBC binding.
When building the ODBC binding as a library, name it libmercury_odbc, rather
than libodbc; unixODBC uses the former name, which is at the very least
confusing and appears to the source of linker errors on some platforms.

extras/odbc/mercury_odbc.m:
    An empty module importing odbc, that is used to force the library
    name to be libmercury_odbc instead of libodbc.

extras/odbc/Mmakefile:
    Do not warn about the module we use force the library name not exporting
    anything.

    Delete a workaround for really old versions of GCC.
2022-01-17 14:12:51 +11:00

71 lines
2.1 KiB
Plaintext

#-----------------------------------------------------------------------------#
# vim: ts=8 sw=8 noexpandtab
#-----------------------------------------------------------------------------#
# Copyright (C) 1997-2000, 2003, 2006 The University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
# extras/odbc/Mmakefile - Mmake file for building the ODBC interface.
#-----------------------------------------------------------------------------#
# Configuration
# The driver manager.
# Legal values for MODBC_DRIVER are MODBC_IODBC, MODBC_UNIX, and MODBC_MS.
# Feel free to add more (and handle them in odbc.m).
MODBC_DRIVER=MODBC_UNIX
# The database.
# Legal values for MODBC_DB are MODBC_MYSQL and MODBC_SQL_SERVER.
# Feel free to add more (and handle them in odbc.m).
MODBC_DB = MODBC_MYSQL
# Pathname for iODBC (only for MODBC_IODBC)
#IODBC_DIR=
# Pathname for the ODBC SDK (only for MODBC_MS)
ODBC_SDK_DIR=/odbcsdk
INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
-include ../Mmake.params
# Do not issue a warning because mercury_odbc does not export anything.
MCFLAGS-mercury_odbc = --no-warn-nothing-exported --no-warn-interface-imports
#-----------------------------------------------------------------------------#
ifeq ($(MODBC_DRIVER),MODBC_MS)
ODBC_INCL_DIR=$(ODBC_SDK_DIR)/include
MLLIBS=-lodbc32
else
#ODBC_LIB_DIR=$(IODBC_DIR)/lib
#ODBC_INCL_DIR=$(IODBC_DIR)/include
# The following are for Debian.
# for unixODBC
MLLIBS=-lodbc -lpthread -lltdl -ldl
# for iODBC
# MLLIBS=-liodbc -lpthread -ldl
# note: on a DEC Alpha using OSF1 remove the -ldl.
endif
MAIN_TARGET=odbc_test
.PHONY: depend
depend: odbc_test.depend
.PHONY: check
check:
true
#-----------------------------------------------------------------------------#
MGNUCFLAGS=-D$(MODBC_DRIVER) -D$(MODBC_DB) -I$(ODBC_INCL_DIR)
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#