Changeset 7281ad1


Ignore:
Timestamp:
2012-09-15T15:59:17Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
b3d99e3
Parents:
68709f5
Message:

Allow building position-independent executables. #981, patch from brainsmoke.

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r68709f5 r7281ad1  
    171171$(objects): %.o: $(_SRCDIR_)%.c
    172172        @echo '*' Compiling $<
    173         @$(CC) -c $(CFLAGS) $< -o $@
     173        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    174174
    175175$(objects): Makefile Makefile.settings config.h
     
    177177$(OUTFILE): $(objects) $(subdirs)
    178178        @echo '*' Linking $(OUTFILE)
    179         @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS)
     179        @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LDFLAGS_BITLBEE) $(LFLAGS) $(EFLAGS)
    180180ifndef DEBUG
    181181        @echo '*' Stripping $(OUTFILE)
  • configure

    r68709f5 r7281ad1  
    4242ssl=auto
    4343
     44pie=1
     45
    4446arch=`uname -s`
    4547cpu=`uname -m`
     
    8082--debug=0/1     Disable/enable debugging                $debug
    8183--strip=0/1     Disable/enable binary stripping         $strip
     84--pie=0/1       Build position independent executable   $pie
    8285--gcov=0/1      Disable/enable test coverage reporting  $gcov
    8386--plugins=0/1   Disable/enable plugins support          $plugins
     
    9093--ssl=...       SSL library to use (gnutls, nss, openssl, bogus, auto)
    9194                                                        $ssl
     95
    9296
    9397--target=...    Cross compilation target                same as host
     
    198202else
    199203        [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing"
     204fi
     205
     206if [ "$pie" = "1" ]; then
     207        echo 'CFLAGS_BITLBEE=-fPIE' >> Makefile.settings
     208        echo 'LDFLAGS_BITLBEE=-pie' >> Makefile.settings
    200209fi
    201210
     
    748757fi
    749758
     759if [ "$pie" = "1" ]; then
     760        echo '  Building PIE executable'
     761else
     762        echo '  Building non-PIE executable'
     763fi
     764
    750765if [ "$strip" = "1" ]; then
    751766        echo '  Binary stripping enabled.'
  • lib/Makefile

    r68709f5 r7281ad1  
    4242$(objects): %.o: $(_SRCDIR_)%.c
    4343        @echo '*' Compiling $<
    44         @$(CC) -c $(CFLAGS) $< -o $@
     44        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4545
    4646-include .depend/*.d
  • protocols/Makefile

    r68709f5 r7281ad1  
    5555$(objects): %.o: $(_SRCDIR_)%.c
    5656        @echo '*' Compiling $<
    57         @$(CC) -c $(CFLAGS) $< -o $@
     57        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    5858
    5959-include .depend/*.d
  • protocols/jabber/Makefile

    r68709f5 r7281ad1  
    3838$(objects): %.o: $(_SRCDIR_)%.c
    3939        @echo '*' Compiling $<
    40         @$(CC) -c $(CFLAGS) $< -o $@
     40        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4141
    4242jabber_mod.o: $(objects)
  • protocols/msn/Makefile

    r68709f5 r7281ad1  
    3838$(objects): %.o: $(_SRCDIR_)%.c
    3939        @echo '*' Compiling $<
    40         @$(CC) -c $(CFLAGS) $< -o $@
     40        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4141
    4242msn_mod.o: $(objects)
  • protocols/oscar/Makefile

    r68709f5 r7281ad1  
    3939$(objects): %.o: $(_SRCDIR_)%.c
    4040        @echo '*' Compiling $<
    41         @$(CC) -c $(CFLAGS) $< -o $@
     41        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4242
    4343oscar_mod.o: $(objects)
  • protocols/purple/Makefile

    r68709f5 r7281ad1  
    3939$(objects): %.o: $(_SRCDIR_)%.c
    4040        @echo '*' Compiling $<
    41         @$(CC) -c $(CFLAGS) $< -o $@
     41        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4242
    4343purple_mod.o: $(objects)
  • protocols/twitter/Makefile

    r68709f5 r7281ad1  
    3838$(objects): %.o: $(_SRCDIR_)%.c
    3939        @echo '*' Compiling $<
    40         @$(CC) -c $(CFLAGS) $< -o $@
     40        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4141
    4242twitter_mod.o: $(objects)
  • protocols/yahoo/Makefile

    r68709f5 r7281ad1  
    3939$(objects): %.o: $(_SRCDIR_)%.c
    4040        @echo '*' Compiling $<
    41         @$(CC) -c $(CFLAGS) $< -o $@
     41        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4242
    4343yahoo_mod.o: $(objects)
Note: See TracChangeset for help on using the changeset viewer.