]> git.pld-linux.org Git - packages/dhcp.git/commitdiff
- use PIC objects to create .so
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 25 Dec 2007 12:16:30 +0000 (12:16 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dhcp-libdhcp4client.make -> 1.2

dhcp-libdhcp4client.make

index 624d7465db02198e93eab9de58f79b1da4170c7d..53f30126fe213da1924132940497057a8911af46 100644 (file)
@@ -72,6 +72,7 @@ DHCP_HEADERS = dhcpd.h cdefs.h osdep.h arpa/nameser.h minires/minires.h \
 HDRS = dhcp4client.h
 SRCS = $(COMMON_SRCS) $(CLIENT_SRCS)
 OBJS = $(SRCS:.c=.o)
+LOBJS = $(SRCS:.c=.lo)
 
 INCLUDES = -I$(TOP) -I$(TOP)/includes -I$(TOP)/dst -I.
 CFLAGS   = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS) \
@@ -92,7 +93,7 @@ depend:
        $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRCS)
 
 clean:
-       -rm -f $(OBJS)
+       -rm -f $(OBJS) $(LOBJS)
 
 realclean: clean
        -rm -f $(PROG) *~ #*
@@ -137,6 +138,9 @@ libres.a:
        ln ../minires/libres.a .; \
        $(AR) x libres.a
 
+%.lo: %.c
+       $(CC) -o $@ $(CFLAGS) -fPIC -c $<
+
 # Create the libraries
 # minires/res_query.o contains an undefined symbol __h_errno_set, is not
 # used by any dhcp code, and is optimized out by the linker when producing
@@ -144,7 +148,7 @@ libres.a:
 libdhcp4client.a: $(OBJS) libres.a
        $(AR) crus $@ $(OBJS) `$(AR) t libres.a | grep -v res_query.o`
 
-libdhcp4client-$(VER).so.0: $(OBJS) libres.a
-       $(CC) -shared -o $@ -Wl,-soname,$@ $(OBJS) `$(AR) t libres.a | grep -v res_query.o`
+libdhcp4client-$(VER).so.0: $(LOBJS) libres.a
+       $(CC) $(LDFLAGS) $(CFLAGS) -shared -o $@ -Wl,-soname,$@ $(LOBJS) `$(AR) t libres.a | grep -v res_query.o`
 
 # Dependencies (semi-automatically-generated)
This page took 0.161788 seconds and 4 git commands to generate.