<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Makefile - Includes für MySQL hinzufügen]]></title><description><![CDATA[<p>Hi,<br />
ich schreibe zur Zeit an einem Apache 2.0 Modul in C, was auch schon einigermaßen läuft. Da ich noch nicht lang unter Linux und C programmiere, weiß ich noch nicht so richtig wie das mit autoconf, automake etc. funktioniert. Deshalb hab ich mein Modul auf mod_line_edit aufgebaut, bzw. verwende eigentlich nur noch die Makefile davon.</p>
<p>Jetzt will ich jedoch MySQL-Unterstützung zu meinem Modul hinzufügen, wofür ich aber den Pfad &quot;/usr/include/mysql&quot; mit includen müsste.</p>
<p>Wenn ich eine normale Konsolen-Anwendung (also kein Apache Modul) mit MySQL-Unterstützung kompilieren würde, würde ich das so machen:</p>
<pre><code>gcc -c -I/usr/include/mysql mysql.c
gcc -o mysql mysql.o -L/usr/lib/mysql -lmysqlclient
</code></pre>
<p>Allerdings sieht meine Makefile jetzt so aus, und ich weiß nicht wo ich dort die Includes einbauen muss:</p>
<pre><code>##
##  Makefile -- Build procedure for mod_layerad Apache module
##
builddir=$(shell pwd)
top_srcdir=/usr/share/apache2
#usr/local/apache2
top_builddir=/usr/share/apache2
#usr/local/apache2
include /usr/share/apache2/build/special.mk
#usr/local/apache2/build/special.mk

#   the used tools
APXS=/usr/bin/apxs2
APACHECTL=apache2ctl
CC=`$(APXS) -q CC`
INC=-I`$(APXS) -q INCLUDEDIR` `$(APXS) -q CFLAGS`  #-DLAYOUT_FILEOWNER_NAME
LD_SHLIB=`apxs -q LDFLAGS_SHLIB`
VERSION = 1.0.0
DISTNAME = mod_layerad
DISTVNAME = $(DISTNAME)-$(VERSION)

SRC = mod_layerad.c
OBJ = ${SRC:.c=.o}
SOBJ = ${SRC:.c=.lo}

SHELL = /bin/sh
PERL = perl
NOOP = $(SHELL) -c true
RM_RF = rm -rf
SUFFIX = .gz
COMPRESS = gzip --best
TAR  = tar
TARFLAGS = cvf
PREOP = @$(NOOP)
POSTOP = @$(NOOP)
TO_UNIX = @$(NOOP)

#   additional defines, includes and libraries
# Apache itself won't compile with it this strict
#DEF = -Wall -DDEBUG -Wtraditional -Wshadow -Wid-clash-len -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings-Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wlong-long -Winline -Werror
#DEF = -Wall -DDEBUG 

#   the default target
all: mod_layerad.so

#   compile the shared object file
#mod_layout.so: $(OBJ)  Makefile
mod_layerad.so: $(OBJ)
	$(APXS) -o liblayerad.la -c $(SOBJ)
	#$(APXS) -c -o liblayerad $(SOBJ)
	#$(APXS) -i -a mod_layerad.la

mod_layerad.o : mod_layerad.c
	$(APXS) -c mod_layerad.c

#   install the shared object file into Apache 
install: 
	$(APXS) -i -n liblayerad.so -e liblayerad.la
	@echo &quot;+--------------------------------------------------------+&quot;; \
	echo &quot;| All done.                                              |&quot;; \
	echo &quot;|                                                        |&quot;; \
	echo &quot;| You will need to add the directive:                    |&quot;; \
	echo &quot;| LoadModule layerad_module modules/liblayerad.so        |&quot;; \
	echo &quot;|                                                        |&quot;; \
	echo &quot;| So that you can begin to use mod_layerad.              |&quot;; \
	echo &quot;|                                                        |&quot;; \
	echo &quot;| Thanks for installing mod_layerad.                     |&quot;; \
	echo &quot;+--------------------------------------------------------+&quot;; \

#   cleanup
clean:
	rm -f mod_layerad.o mod_layerad.so $(OBJ) *.gz *rpm
</code></pre>
<p>Bin für jede Hilfe dankbar.<br />
Jonas</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/166287/makefile-includes-für-mysql-hinzufügen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 15:52:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/166287.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Nov 2006 19:42:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Makefile - Includes für MySQL hinzufügen on Mon, 27 Nov 2006 19:42:30 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich schreibe zur Zeit an einem Apache 2.0 Modul in C, was auch schon einigermaßen läuft. Da ich noch nicht lang unter Linux und C programmiere, weiß ich noch nicht so richtig wie das mit autoconf, automake etc. funktioniert. Deshalb hab ich mein Modul auf mod_line_edit aufgebaut, bzw. verwende eigentlich nur noch die Makefile davon.</p>
<p>Jetzt will ich jedoch MySQL-Unterstützung zu meinem Modul hinzufügen, wofür ich aber den Pfad &quot;/usr/include/mysql&quot; mit includen müsste.</p>
<p>Wenn ich eine normale Konsolen-Anwendung (also kein Apache Modul) mit MySQL-Unterstützung kompilieren würde, würde ich das so machen:</p>
<pre><code>gcc -c -I/usr/include/mysql mysql.c
gcc -o mysql mysql.o -L/usr/lib/mysql -lmysqlclient
</code></pre>
<p>Allerdings sieht meine Makefile jetzt so aus, und ich weiß nicht wo ich dort die Includes einbauen muss:</p>
<pre><code>##
##  Makefile -- Build procedure for mod_layerad Apache module
##
builddir=$(shell pwd)
top_srcdir=/usr/share/apache2
#usr/local/apache2
top_builddir=/usr/share/apache2
#usr/local/apache2
include /usr/share/apache2/build/special.mk
#usr/local/apache2/build/special.mk

#   the used tools
APXS=/usr/bin/apxs2
APACHECTL=apache2ctl
CC=`$(APXS) -q CC`
INC=-I`$(APXS) -q INCLUDEDIR` `$(APXS) -q CFLAGS`  #-DLAYOUT_FILEOWNER_NAME
LD_SHLIB=`apxs -q LDFLAGS_SHLIB`
VERSION = 1.0.0
DISTNAME = mod_layerad
DISTVNAME = $(DISTNAME)-$(VERSION)

SRC = mod_layerad.c
OBJ = ${SRC:.c=.o}
SOBJ = ${SRC:.c=.lo}

SHELL = /bin/sh
PERL = perl
NOOP = $(SHELL) -c true
RM_RF = rm -rf
SUFFIX = .gz
COMPRESS = gzip --best
TAR  = tar
TARFLAGS = cvf
PREOP = @$(NOOP)
POSTOP = @$(NOOP)
TO_UNIX = @$(NOOP)

#   additional defines, includes and libraries
# Apache itself won't compile with it this strict
#DEF = -Wall -DDEBUG -Wtraditional -Wshadow -Wid-clash-len -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings-Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wlong-long -Winline -Werror
#DEF = -Wall -DDEBUG 

#   the default target
all: mod_layerad.so

#   compile the shared object file
#mod_layout.so: $(OBJ)  Makefile
mod_layerad.so: $(OBJ)
	$(APXS) -o liblayerad.la -c $(SOBJ)
	#$(APXS) -c -o liblayerad $(SOBJ)
	#$(APXS) -i -a mod_layerad.la

mod_layerad.o : mod_layerad.c
	$(APXS) -c mod_layerad.c

#   install the shared object file into Apache 
install: 
	$(APXS) -i -n liblayerad.so -e liblayerad.la
	@echo &quot;+--------------------------------------------------------+&quot;; \
	echo &quot;| All done.                                              |&quot;; \
	echo &quot;|                                                        |&quot;; \
	echo &quot;| You will need to add the directive:                    |&quot;; \
	echo &quot;| LoadModule layerad_module modules/liblayerad.so        |&quot;; \
	echo &quot;|                                                        |&quot;; \
	echo &quot;| So that you can begin to use mod_layerad.              |&quot;; \
	echo &quot;|                                                        |&quot;; \
	echo &quot;| Thanks for installing mod_layerad.                     |&quot;; \
	echo &quot;+--------------------------------------------------------+&quot;; \

#   cleanup
clean:
	rm -f mod_layerad.o mod_layerad.so $(OBJ) *.gz *rpm
</code></pre>
<p>Bin für jede Hilfe dankbar.<br />
Jonas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1182661</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1182661</guid><dc:creator><![CDATA[jonez]]></dc:creator><pubDate>Mon, 27 Nov 2006 19:42:30 GMT</pubDate></item><item><title><![CDATA[Reply to Makefile - Includes für MySQL hinzufügen on Tue, 28 Nov 2006 02:23:07 GMT]]></title><description><![CDATA[<p>würde auf die Zeile mit INC tippen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1182796</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1182796</guid><dc:creator><![CDATA[DrGreenthumb]]></dc:creator><pubDate>Tue, 28 Nov 2006 02:23:07 GMT</pubDate></item></channel></rss>